Boost logo

Boost :

Subject: Re: [boost] boost::atomic<T> foo;
From: Kris Rousey (krousey_at_[hidden])
Date: 2008-09-21 10:00:11

> cg wrote:
>> 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;

If all you're wanting is atomic operators, ACE's
( ACE_Atomic_Op template
provides that. It synchronizes all arithmetic, assignment, and
comparison operators. I've used it before to do intrusive reference
counting on shared closures. A utility class that just synchronizes
operations shouldn't be too hard to write "boost" way.


Boost list run by bdawes at, gregod at, cpdaniel at, john at