Boost logo

Boost :

From: Chris Thomasson (cristom_at_[hidden])
Date: 2006-11-14 20:22:15


"Roland Schwarz" <roland.schwarz_at_[hidden]> wrote in message
news:45573FB1.70304_at_chello.at...
> Neal Becker wrote:
>> Perhaps of some interest:
>>
>> http://www.hpl.hp.com/research/linux/atomic_ops/
>
> You might also look at:
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2047.html
>
> Hans Boehm's proposal seems to build upon this library you
> were pointing at. (Not surprisingly, since he is the author of it.)
>
> I am currently trying to prototype something along his proposal, to
> see how far I can get.
>
> Until now I have found some loopholes I am trying to figure out.

Here is how I define rules for my atomic<T>:

Can't use any constructors, destructors, base classes, virtual functions,
or anything else that violates POD requirements.

Can't use any operators

Atomic operation API must have static interface that operates on pointers to
T as the destination of any operation. Usage is like:

static foo s_foo = 0;
typedef atomic<foo> atomic_foo_t;

void something() {
  atomic_foo_t::cas<mb::storeload>(&s_foo, 0, 5);
}

Any thoughts on this approach?


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