> From: sebb [mailto:seb...@gmail.com] 
> Subject: Re: bug in TC6 ContainerBase class?

> Do you mean:
> * the compiler must assume that there is no synch, or
> * the compiler must assume that there is synch.

The latter; in the absence of information to the contrary, the compiler must 
assume the worst case - that synchronization can occur as a side effect of the 
method call.

> > Nope, it's required to be reloaded due to the constraints 
> > mentioned above.

> If any reloading is required, it surely only applies to the 
> current thread.

Correct.  The one under discussion is the one with the "while (!threadDone)" 
loop.

> So as far as I can tell, calling non-synch. methods only affects
> compiler optimisation - it does not affect visibility of changes in
> other threads.

True - but the javac compiler cannot be certain that there's no synchronization 
going on inside the called methods or any nested method calls therein.  A JIT 
could, in theory, have access to that information (and all other side effects), 
and optimize out non-volatile memory references, but the overhead of doing so 
is impractical.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to