[kaffe] Lock patch
Guilhem Lavaux
guilhem at kaffe.org
Tue Mar 8 10:00:08 PST 2005
Timothy Stack wrote:
>
> On Mar 8, 2005, at 5:38 AM, Helmer Krämer wrote:
>
>>
>> If *lkp does not point to a heavy lock, a new one is allocated on the
>> heap.
>
Hi Tim,
>
> I just want to interject a little note here, which I'm not sure is even
> relevant...
> Basically, Pat Tullmann (i think) once observed that the maximum number
> of heavy locks needed by the system was the same as the number of threads
> in the system. In other words, every thread is either: running, blocked
> trying
> to obtain a lock, or blocked in an Object.wait(). Therefore, you could
> preallocate all of the lock objects when creating threads and not have to
> try and allocate memory when taking a lock. Of course, this may not apply
> anymore since y'all seem to be leaving the heavies in place. Anyways,
> there is an implementation of this in the janosvm if you're interested.
>
Yep. I've though about caching the semaphore but not the heavy lock. As
I've detected another deadlock with the new implementation I will
stabilize it a little more then maybe add a cache in threadData as
JanosVM do.
Thanks Tim !
Regards,
Guilhem.
More information about the kaffe
mailing list