Boost logo

Boost :

Subject: Re: [boost] boost::atomic<T> foo;
From: cg (chengang31_at_[hidden])
Date: 2008-09-20 22:45:09


Janek Kozicki wrote:
> Hi,
>
> I looked through Boost.Threads and Boost.Interprocess libraries, but
> (as far as I can tell) none of them offers me simple:
>
> class Foo {
> boost::atomic<int> bar;
> }
>
> which would mean that *ALL* attempts to access bar would be atomic,
> eg. bar=10;
>

I am also wondering if there is any ongoing efforts to bring such atomic
operations library into boost, which is in new C++ draft spec now:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2723.pdf

> Am I left with troublesome usage of boost::mutex to block all that
> access attempts by myself?
>

AFAK, it is the only choose, for now.


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