From: Godmar Back (gback@cs.utah.edu)
Date: Wed Jan 13 1999 - 15:20:07 EST
>
> Given this can anyone see how to optimize multiple entry of the same lock, or the
> common case where a lock is never in contention?
>
By "multiple entry" you mean a recursive entry by the lock holder?
Are you referring to some static optimization, such as inferring when
you already hold a lock, like when one synchronized function calls
another? This may be doable by specializing functions, i.e., creating
a synchronized and an unsynchronized methods in the jit. Cost is memory.
Other than that, it is of course true that the lock cache will optimize
recursive entries cause you will always have a hit.
As for locks that are never contended, what Joust (Scout's JVM) purportedly
does is to turn locks off completely until a second thread is started.
It's not quite clear how this works, but the code is available for
download.
- Godmar
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:41 EDT