Usage in Microsoft Visual C++
Double-checked locking can be implemented in Visual C++ 2005 and above if the pointer to the resource is declared with the C++ keyword volatile. Visual C++ 2005 guarantees that volatile variables will behave as fence instructions, as in J2SE 5.0, preventing both compiler and CPU arrangement of reads and writes with acquire semantics (for reads) and release semantics (for writes). There is no such guarantee in previous versions of Visual C++. However, marking the pointer to the resource as volatile may harm performance elsewhere, if the pointer declaration is visible elsewhere in code, by forcing the compiler to treat it as a fence elsewhere, even when it is not necessary.
Read more about this topic: Double-checked Locking
Famous quotes containing the words usage and/or visual:
“Girls who put out are tramps. Girls who dont are ladies. This is, however, a rather archaic usage of the word. Should one of you boys happen upon a girl who doesnt put out, do not jump to the conclusion that you have found a lady. What you have probably found is a lesbian.”
—Fran Lebowitz (b. 1951)
“For women ... bras, panties, bathing suits, and other stereotypical gear are visual reminders of a commercial, idealized feminine image that our real and diverse female bodies cant possibly fit. Without these visual references, each individual womans body demands to be accepted on its own terms. We stop being comparatives. We begin to be unique.”
—Gloria Steinem (b. 1934)