On Mon, 3 Dec 2007, Alfred Perlstein wrote:

[on the double-checked locking idiom]

> Karsten, _typically_ (but not always) an "unlock" operation
> requires that writes prior to the unlock be globally visible.
> This is why it works almost everywhere.

Perhaps, but if you use it you should probably mark the code with
/* XXX not guaranteed to be correct by POSIX */

Double-checked locking is broken without an appropriate barrier.
"Correctness over speed" should surely be our watchword :-)


jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
Tel +44 (0)117 3317661 http://ioctl.org/jan/
Hang on, wasn't he holding a wooden parrot? No! It was a porcelain owl.
freebsd-arch@freebsd.org mailing list
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"