[concurrency-interest] Simple ScheduledFuture problem

Brian Goetz brian at quiotix.com
Mon Sep 4 15:49:01 EDT 2006


> yes, but presumably a more elegant solution is for the other "setting
> methods" to invoke the single setter, and treat the volatile field as
> a javabeans property.

No, that wouldn't work.  Otherwise, two threads racing to increment 
could result in a lost update.  Volatile is tricky!


More information about the Concurrency-interest mailing list