Question

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

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top