On Sun, 8 Dec 2002 23:06, Leo Sutic wrote:
> if the deadlock happens inside the ClassLoader, you must synchronize on
> *all* objects that may access that CL instance. For example, consider this:

yep.

> The same problem exist here - the deadlock is in the classloader, meaning
> that we must have a mutex for *all* access paths to the CL instance. I'm
> not convinced that your patch does that. Could you provide some argument
> for it?

It does not solve it - just makes it less likely to happen. As most JVMs 
resolve .class files on load nowadays - especially with things like hotspot. 
Thus the main access to classloader occurs on initial class load.The 

ClassLoader mechanism is relatively thread-safe except when one thread becomes 
re-enters classloader (ie ClassLoader.loadClass() --> static initializer 
block --> ClassLoader.loadClass()) and another thread is in classloader.

I vaguely recall seeing the detailed explanation somewhere but can't for the 
life of me remember where.

Anyways the patch does not solve it but it will hopefully make it less likely 
occurence.

-- 
Cheers,

Peter Donald
----------------------------------------
"Liberty means responsibility. That is 
      why most men dread it." - Locke
---------------------------------------- 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to