[cpp-threads]atomic operations package

Alexander Terekhov alexander.terekhov at gmail.com
Mon Aug 15 10:01:46 BST 2005


On 8/14/05, Doug Lea <dl at cs.oswego.edu> wrote:
> Boehm, Hans wrote:
> > Since the details of the atomic operations package seem to influence the
> > memory model and our terminology, and I haven't seen any concrete
> > proposals for the interface to the package, I put up a concrete though
> > very preliminary proposal at:
> >
> > http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/atomics.h.txt
> >
> > Please comment.
> >
> 
> 
>         template <ordering_constraint c>
>             void store(const T&);
>             // Compile-time error if c is neither none nor release.
>         template <ordering_constraint c>
>             T load();
>             // Compile-time error if c is neither none nor acquire.
> 
> 
> I think this is fine. I know that neither Peter Dimov nor
> Alexander Terekhov think this suffices to support usages
> they say they need. (Which is the main reason I gave up
> on variants of this.)
> 
> Peter and/or Alexander: Could you soon post something
> (re)stating your concerns so we can make a decision about it
> rather than continuing to stall?

One concern is that it won't suffice to efficiently support things 
like reference counting for immutable objects and read-only locks
(all without suppressing reordering of writes). In the case of 
read-only locks and when refcounts reach zero, we want (at most) 
dd-/cc- hsb on read{-modify-write} ops for dependent writes (which 
you seem to be ready to impose implicitly on all reads, if I 
understand "the compromise" correctly).

regards,
alexander.




More information about the cpp-threads mailing list