[cpp-threads] Alternatives to SC (prohibiting data races, etc.)
Lawrence Crowl
Lawrence at Crowl.org
Thu Feb 1 18:56:36 GMT 2007
On 1/31/07, Paul E. McKenney <paulmck at linux.vnet.ibm.com> wrote:
> OK, so the real name is atomic_load_relaxed() as opposed to load_raw()?
In the current paper, yes. I hesitate to make a claim about the standard
itself as there are several months and several votes left. :-)
> And this will do a load without memory barriers or atomics,
That is an implementation question that can only be answered with
respect to a given platform.
The paper has a (really, really) minimal conforming implementation,
and its atomic_load_relaxed() effectively uses a lock.
Some people believe that on x86, a simple load is sufficient.
> but with no danger of subsequent refetches?
What do you mean by "refetch" here?
> And, if applied to a lock_free() datum, the load is atomic in that it
> sees the value from a particular prior store (or the initial value)?
That should be true regardless of the result of lock_free().
(Remember to be careful about what "prior" means.)
--
Lawrence Crowl
More information about the cpp-threads
mailing list