[concurrency-interest] Unsafe publication of new objects question
davidcholmes at aapt.net.au
Wed Oct 6 07:06:36 EDT 2010
Joseph Seigh writes:
> How did the JVM get around to fixing the unsafe publication
> problem of new object state, i.e. basic type safety for
> primative types? Exploiting load dependency perhaps?
Primitive types are type safe by definition. The only guarantee you have
regarding unsafe publication is that you can never see uninitialized state -
at a minimum you must see the default initialization values (which is easily
achieved by allocating out of pre-zeroed memory).
More information about the Concurrency-interest