[cpp-threads] High-level vs. low-level

Alexander Terekhov alexander.terekhov at gmail.com
Fri Jul 14 10:28:20 BST 2006


On 7/14/06, Boehm, Hans <hans.boehm at hp.com> wrote:
> > -----Original Message-----
> > From: Alexander Terekhov
> > > [Peter:]
> > > This is a very good question. I'm still undecided on whether:
> > >
> > >     atomic_load_acq( &x );
> > >
> > > should work on x being a plain int.
> >
> > Should not.
> >
> I think there is a strong argument to the contrary: Existing practice.
> That's why the current proposal takes the opposite route, in spite of
> the fact that Lawrence once convinced me of Alexander's opinion.
>
> I think nearly every compiler currently provides intrinsics that perform
> atomic read-modify-write operations on ordinary integers.  I have yet to
> find one that provides a corresponding atomic read (or simple store)
> operation, so I think these are all somewhat broken.  (And you can't
> reasonably provide those operations without seriously addressing
> ordering issues, which they generally don't.)  But certainly by 2009
> there will be a fair amount of code that uses them,

First this is just speculation. Second, existing practice prior C++
standardization for "new", for example, was to return zero (and not
throw). The standard broke a lot of existing practice code.

regards,
alexander.



More information about the cpp-threads mailing list