JavaMemoryModel: Double checked locking in C#

From: Bill Pugh (pugh@cs.umd.edu)
Date: Mon Jul 29 2002 - 13:25:44 EDT


Here is an article encouraging the use of double checked locking in C#.

http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=486

Sigh...

Does anyone know if CLI/C# makes the same guarantees as Java for
synchronization and class initialization? It does guarantee that
classes are initialized before first use. So I presume it must
include synchronization requirements as Java does. So the standard
technique works of just declaring it as a static variable in a
seperate class works.

        Bill Pugh

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:40 EDT