Boost logo

Boost :

From: Holger Grund (yahoo_at_[hidden])
Date: 2004-09-05 11:56:43


>
> > > As for more efficient lock-free impleentations (using CAS) Microsoft
has
> > > (relatively recently) added singly linked lock-free list to Win32 API.
> There
> >
> > could you post a link? thanks.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/interlocked_singly_linked_lists.asp
>
> Exported from kernel32 but only on XP and Server 2003.
>
FWIW implementing a queue (it's structured like a list but
you can't really walk it short of removing entries from the head)
is fairly trivial on x86. VC 8 introduces support for certain
intrinsics (which the compiler knows enough about to apply
optimizations) including the one corresponding to an
interlocked cmpxchg8b.
Most other compilers targetting x86 should at least provide it
via inline asm or a separate assembler.

It's probably much harder for certain other architectures.

-hg


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk