> From: Jeff Bogda [mailto:firstname.lastname@example.org]
> One may argue that this synchronization is not useless
> because it makes the
> value "true" for "initialized" visible to thread 2. However,
> I agree with
> Jeremy (although I am not sure where in his paper he states
> this) and feel
> that these synchronized blocks (like all empty synchronized
> blocks) are
I think the last parenthetical comment is an overgeneralization. Consider
set up some global shared state S;
The empty synchronized block is used to wait for the initialization of S.
Removing it is clearly incorrect.
This is probably uncommon in Java, but I believe it's correct under all
current proposals. I've used it a few times with a pthreads like thread
model, without s separate start operation.
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel
This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:31 EDT