[cpp-threads] Alternatives to SC

Peter Dimov pdimov at mmltd.net
Sun Jan 14 14:42:15 GMT 2007


Doug Lea wrote:

> Atomics can be used to create SC constructions like locks.
> But atomics can also be used in other ways that are not necessarily
> SC. As it turns out, all usages on cache-coherent causally consistent
> machines are at least nearly SC.

Isn't it true that most usages are PC? The one exception that I know of is 
hazard pointers. Do we really need the #StoreLoads? :-)

Speaking of hazard pointers... as an aside, the two main problems with 
turning an academic paper into a real C++ implementations are that (1) most 
papers assume SC when giving the pseudocode, (2) most papers either assume 
garbage collection, or don't mention the issue of memory management at all. 
Even given SC atomics, the second problem remains. Yet the discussion 
doesn't mention it at all. Do the proponents of "SC atomics for the masses" 
also assume that they will only be usable in a GC environment? :-) I simply 
don't see how a non-expert can reasonably handle the memory management of a 
typical lock-free container, no matter how sequentially consistent the 
atomics are. 




More information about the cpp-threads mailing list