Gary:
Thanks for your response. I will try to quantify the actual cost of the current
implementation. I would think that a more efficient implementation would incur
this class loading cost once per thread...
Thanks,
Glenn
-----Original Message-----
From: Gary L Peskin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 29, 2001 12:00 PM
To: [EMAIL PROTECTED]
Subject: Re: Contention on Class Loader for Extensions class
> "Boysko, Glenn" wrote:
> I was finding that by just running two threads concurrently, both
> threads where
> blocking on the same monitor which was owned by the system class
> loader.
>
> I guess I'm assuming that if two threads are both trying to load the
> same class at the same
> time that there will be synchronization, such that thread A will wait
> for thread B to finish
> loading the class. Is this not the case?
Glenn --
I'm really not familiar with the internals of particular versions of
Sun-supplied classloaders. However, I would think that if there was any
synchronization at all, it would be very, very short or multithreading
of any sort would never work well. Besides, once the class is loaded,
it should stay loaded for that classloader. It isn't loaded twice so
there really should be a very tiny wait.
I understand that you're seeing this in OptimizeIt but it's difficult
for me to believe that this is the cause of any performance problems.
Gary
