|
Boost : |
Subject: Re: [boost] [Circular Buffer] Partial thread-safety
From: Tim Blechmann (tim_at_[hidden])
Date: 2008-11-26 08:08:02
>>> Where is the magic? Can you point to some documentation or how to use
>>> it?
>>
>> It seems to make the assumption that volatile variable reads and writes
>> are atomic. This, among with careful organization of those operations,
>> allows safe concurrent access.
>>
> This sort of assumption looks wrong. volatile should only instruct the
> compiler not to optimize the variable (e.g. in a register).
the ringbuffer is known not to be smp-safe without memory barriers ...
btw, i have a boost-style lockfree fifo class [1], with support for
multiple concurrent producers/consumers ... i haven't found the time to
make it ready for a submission, yet ...
cheers, tim
[1] http://tim.klingt.org/git?p=boost_lockfree.git
-- tim_at_[hidden] http://tim.klingt.org Art is either a complaint or do something else John Cage quoting Jasper Johns
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk