[concurrency-interest] Significance of volatile static
mohanr at fss.co.in
Wed Jun 22 00:55:43 EDT 2011
I have read the presentation "Finalizers, Thread and the Java
memory model" by Hans J. Boehm and I can't claim to understand
everything but I have a question.
I am a beginner and I am trying to understand what the author means by
"Store reference to object into volatile static, then
immediately clear it"
Is there any particular semantics associated with 'volatile static' and
the way it is used in this context ?
Reachability, visibility solutions
We want something that
Synchronizes to create a happens-before relationship
between ordinary methods and finalizer.
Options provided by JSR133:
Store into volatile field in ordinary method.
Read field in finalizer.
Store reference to object into volatile static, then
immediately clear it.
Read volatile static in finalizer.
Release lock on object at end of ordinary method.
Acquire lock at beginning of finalizer.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest