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
This page is posted |
http://mindprod.com/jgloss/volatile.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\volatile.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[100.28.231.85] |
| |
Feedback |
You are visitor number | |