[concurrency-interest] a question regarding non-volatile long

Trilok Khairnar trilokgk at gmail.com
Mon Aug 27 11:54:37 EDT 2007

Possible (multi core or not) since the JVM does not treat assignment two a
64 bit number as one single operation, but two. Apparently because 64 bit
architectures were not widely prevalent when the JVM specification was
written. (This is correct if I was not too low on caffeine while reading the
excellent 'Java Concurrency on Practice' Brian Goetz et. al. the other day)
Is this behaviour going to change though, and does it still hold true on the
latest modern JVM?


From: concurrency-interest-bounces at cs.oswego.edu
[mailto:concurrency-interest-bounces at cs.oswego.edu] On Behalf Of Yechiel
Sent: Monday, August 27, 2007 8:23 PM
To: concurrency-interest at cs.oswego.edu
Subject: [concurrency-interest] a question regarding non-volatile long

If, in multi-core 32 bits system, 2 threads are assigning values to a long
variable concurrently (non volatile long)- is it possible that the final
result will contain an inconsistent result- i.e. the first 32 bits part of
the long variable will contain half of the long assigned by thread 1 while
the second half will contain assignment from thread #2 ? 




-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070827/326b61ab/attachment.html 

More information about the Concurrency-interest mailing list