[cpp-threads] Visibility question

Boehm, Hans hans.boehm at hp.com
Wed Aug 2 19:04:12 BST 2006


> From:  Peter Dimov
> 
> Do you know of an architecture/platform where <ordered> 
> atomics aren't (going to be) fences?
I don't know of any such hardware platforms.

They probably wouldn't be fences on a software DSM platform.  (There are
arguments about whether we should care.  Give that memory latencies and
minimum packet latencies over a network seem to be getting surprisingly
close, I'd be inclined to say that we should.)

The other general concern, recently also expressed to me by David
Callahan, is that under the right conditions, it should be possible for
the compiler to merge excessively fine-grained threads, and remove the
synchronization between them.  This argues that synchronization
operations should not have global implications beyond the threads the
threads that access the synchronization object.  In that case, a
synchronization object that is touched only by a single thread after
such a merge can be removed, or replaced by a usually much cheaper
single-threaded construct.

(This was a major argument behind the Java approach, where it's
important to eliminate synchronization thread-local objects.  I don't
think C++ shares that problem per se, but I still think David's argument
is correct, though perhaps not as pressing.)

Hans
 
> 
> > Nonetheless, I'll take this as a vote against calling this a race?
> 
> Not yet. :-) 
> 
> 
> --
> cpp-threads mailing list
> cpp-threads at decadentplace.org.uk
> http://www.decadentplace.org.uk/cgi-bin/mailman/listinfo/cpp-threads
> 



More information about the cpp-threads mailing list