[cpp-threads] Somewhat relevant technical report

Boehm, Hans hans.boehm at hp.com
Thu Dec 15 20:09:58 GMT 2005


Report HPL-2005-217, "Reordering Constraints for Pthread-Style Locks",
became available at
http://www.hpl.hp.com/techreports/2005/HPL-2005-217.html .

This basically asks and answers the question of what memory fences are
required by pthread locks, if you try as much as possible to take the
current spec at face value.  (Pthread_mutex_lock() requires a full
barrier, pthread_mutex_unlock() doesn't.)  I thought it was worth making
this precise, since it allows us to reason about what, if anything,
we're changing.  I'd be surprised if there were much consistency in what
vendors actually do on machines with weak memory models, especially
since the rules seem to be both subtle and at least partially
accidental.  So don't read this as a spec for current implementations.
(And you should probably disbelieve lock-intensive multithreaded pthread
benchmarks unless you check what the implementation actually does.)

I don't believe any of this is central to what we're trying to do.

Hans



More information about the cpp-threads mailing list