Boost logo

Boost :

Subject: Re: [boost] Notice: Boost.Atomic (atomic operations library)
From: Helge Bahmann (hcb_at_[hidden])
Date: 2009-12-01 17:34:00


Am Tuesday 01 December 2009 15:30:12 schrieb Peter Dimov:
> I will add _consume to boost/memory_order.hpp.

thanks, memory_order.hpp is going to be removed from Boost.Atomic

> I think that your PPC trailing fence (isync) is wrong for loads. isync
> should only be used after a conditional jump (if one wants acquire
> semantics). For loads, you need either a trailing lwsync, or a fake
> never-taken branch + isync.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2745.html

this is very helpful indeed, will fix the implementation

> Your use of a single lock for seq_cst operations has given me pause, but
> now that I've thought about it some more, I think that this is not
> necessary. Per-location locks also provide sequential consistency.

yes you're right -- I guess this was guided by the mistaken idea that the
actual memory accesses must be serialized (instead of just considering the
observable behaviour)

> There is already boost/smart_ptr/detail/spinlock_pool.hpp that you may use
> for the fallback - if you like.

this looks like what I need, but maybe such a thing should live under "thread"
perhaps, instead of smart_ptr?

Thanks for the feedback!

Helge


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