Dynamic reads without locking.

Tim Kientzle kientzle at acm.org
Fri Oct 10 00:57:25 PDT 2003


Terry Lambert wrote:
> For certain uses, however, it's safe to not lock before the
> read *on Intel architectures*.  This can go out the window on
> SPARC or PPC, or any architecture where there is no guarantee
> that there won't be speculative execution or out-of-order
> execution without explicit synchronization.

Even on Intel architectures, the compiler can and will reorder
operations.  Hardware-level issues are only a part of the story.

I followed the Java Memory Model mailing lists for a while.
A lot of very bright, very experienced people thought they
had found ways to avoid locking and were wrong.

This stuff is hard.  Do NOT underestimate it.

Tim



More information about the freebsd-hackers mailing list