From: Michael Dickey (mike_at_[hidden])
Date: 2008-04-17 18:23:09
I wrote a C++ lock free queue implementation recently based on the
Michael & Scott algorithm, that uses APR's atomics. It's available at:
You're welcome to use it but you should be aware that it's not quite
debugged yet. It has issues when I tried using more than 1 producer
and 1 consumer thread. I wasn't sure if this was a mistake I made in
the code, or a limitation of the algorithm, but I assume it's the
former. Anyway, in the end I decided not to use the code for what I
was working on... But if you can find and fix the bug, it's all
Of course, it depends on APR's atomics.. Boost does not have any
compare-and-swap abstraction as I far as I know, which seems to be a
basic requirement for any lock-free programming. Or maybe it does and
I just don't know?
On Apr 17, 2008, at 12:57 PM, Cory Nelson wrote:
> On Wed, Apr 16, 2008 at 9:58 PM, Patrick Twohig <p-twohig_at_[hidden]>
>> I've been looking through the docs and I was wondering if boost has
>> lock-free threadsafe containers. I know it's been brought up on
>> the list
>> before, but I was curious if anybody had a working implementation.
>> somebody is working on them, I'd like to lend a hand if possible.
> I have some lock-free stack/queue code for x86/x64/ia64 in c++. It
> only works with vc++ 2008 intrinsics right now, and the x64 version is
> dependant on the windows memory manager if used on older CPUs. If
> people are interested in boostifying and porting it, I suppose we
> could do that.
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk