[concurrency-interest] Significance of volatile static

Doug Lea dl at cs.oswego.edu
Sat Jun 25 13:30:29 EDT 2011

(Sorry for the delay; I was traveling.)

On 06/22/11 19:59, Boehm, Hans wrote:
> As far as I know, a real fix for this has unfortunately never made it into the
> language specification. (Doug?) Doug had a proposal as part of the fence
> proposal. But I think it ended up as collateral damage of that debate. The

Yes; exactly so. We will need to come up with a different way to
propose this for jdk8.


> current solutions to this problem are all both ugly and slow. It’s not hard to
> add something like keepAlive() to the, and make the result just ugly. To also
> get rid of the ugliness we would need to stop the compiler from eliminating dead
> reference variables, at least in some contexts. This would involve a smallish
> slowdown in a lot of code in order to support a fairly esoteric feature
> (finalizers and weak references). Whether this is worthwhile is open to debate.

More information about the Concurrency-interest mailing list