From: Steve Shih-wei Liao <[EMAIL PROTECTED]>
> - Re-entrant JIT: Many JITs are not re-entrant. When running, for instance,
> MTRT in SPECJVM, because multiple threads are running, multiple JITTing may
> happen concurrently if there is no locking. The Execution Manager can put
> locks before each JITTing in order to ensure that no multiple JITTing is
> going on concurrently.
Do you know an actual JIT compiling the same method simultaneously?
HotSpot VM has a thread dedicated to JIT compilation and the compiling
thread receive a compilation request from a queue.
A JIT I have developed took another way in which a thread executing an
application compiles the application. The JIT allows multiple threads
to do JIT compilation simultaneously but a method is not compiled
multiple times because of appropriate locks assined to each stage
of JIT compilation.
There are choices on the relationship between threads and JIT
compilation:
- Separated threads dedicated to JIT compilation.
- Number of locks by JIT gets fewer?
- Compilation takes much time in case that there are many active
application threads. It leads to further starvation.
Note that HotSpot VM has -Xbatch option to lighten this problem.
- Exploits more processors remaining?
- Application threads which also perform JIT compilation.
- Exploits multiple processors for JIT compilation naturally.
Kazuyuki Shudo [EMAIL PROTECTED] http://www.shudo.net/