[cairo] Thoughts on thread safety of user-data

Carl Worth cworth at cworth.org
Wed Jul 30 15:50:13 PDT 2008


On Thu, 2008-07-24 at 14:22 -0400, Behdad Esfahbod wrote:
> But then again, Owen keeps telling me that double-check locking is
> dangerous and I keep overlooking the reason.

Most descriptions of the problem focus on Java, but it's not a
Java-specific issue. This page describes a fix for broken double-checked
locking in C++ code by using a processor-specific memory barrier
instruction:

http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

-Carl





More information about the cairo mailing list