[concurrency-interest] Assignment of references atomic?

Jeremy Manson jmanson at cs.purdue.edu
Wed Oct 12 16:07:47 EDT 2005


Joe Bowbeer wrote:
> Tim Peierls <tim at peierls.net> wrote:
> 
>>The situation with doubles is even worse: not only will threads not necessarily see
>>the most recent value, but the value seen might not be a value that was ever written
>>by any thread, a so-called "out of thin air" value.
> 
> Minor point: I think "out of thin air" is too strong a term to use for
> the corruption that is permitted for (64-bit) longs and doubles.
> 
> http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.7
> 
> "For the purposes of the Java programming language memory model, a
> single write to a non-volatile long or double value is treated as two
> separate writes: one to each 32-bit half. This can result in a
> situation where a thread sees the first 32 bits of a 64 bit value from
> one write, and the second 32 bits from another write."
> 

It isn't actually out of thin air, which we reserve specifically for 
causality discussions.  However, from the perspective of the programmer, 
it might as well be...

					Jeremy


More information about the Concurrency-interest mailing list