Question

Does anybody know of a test that reproduces "broken double checked locking" problem in java?

Was it helpful?

Solution

Checkout this project: java-concurrency-torture. It is written by Alexey Shipilev. He is Java Performance Engineer who works at Oracle. Here is a bunch of tests for different kinds of singleton initialization practices.

Important: To maximize your chances to see DCL bug you should run these tests with -server flag on 32-bit jvm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top