For example, the semantics of volatile are not strong enough to make the increment operation (x++) atomic, unless you can guarantee that the variable is written only from a single thread.Atomicity of ++ on volatile variables (or non-volatile for that matter) is not guaranteed. volatile x ++ is treated as load x, add 1, store x. A second thread doing x ++ could interleave, causing x to be incremented only once.
Java Concurrency in Practice
available on the web at:
optional Replicator mirror
Your face IP:[126.96.36.199]
|Feedback||You are visitor number 258,975.|