Bill Pugh wrote:
> "Roach motel semantics" are only an approximation to the semantics of
> synchronization and volatiles.
> Roach motel semantics guarantee that you can
> * move non-volatile memory accesses into a synchronized block,
> * reorder a non-volatile memory access and a following volatile read
> * reorder a volatile write and a following non-volatile access
> Roach motel semantics do _not_ say you may never reorder:
> * a non-volatile memory access out of a synchronized block
> * reorder a non-volatile memory access and a following volatile write
> * reorder a volatile read and a following non-volatile access
Roach motel was always expressed as "you can move in but you can't move
out". You've now stated that you can move out. That makes no sense to me as
essentially you are now allowing the accesses being synchronized to be moved
out of the code that causes the synchronization! That would be broken.
The reason you couldn't move out was because of the happens before edges
that the synchronization actions established.
Well you've now totally lost me. ???
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:01:01 EDT