Skip to end of metadata
Go to start of metadata

Double-Checked Locking is a technique for thread-safe object creation within it's owner object.  This is useful for avoiding an instance of variable gets created twice in the multi threading environment.

The following example shows how double checked locking works with the singleton pattern:

Note the second check only works with Java 5 or above, due the JVM memory handling model.

  • No labels