开发者

CompilerThread state on tomcat 6

Runnig a thread dump for a tomcat process I just notice the follow:

"CompilerThread0" daemon prio=10 tid=0x02b57400 nid=0xe0c waiting on condition [0x00000000]
   java.lang.Thread.State: RUNNABLE

My understood is that t开发者_如何学编程he CompilerThread(anynumber) are run by JVM for compiling bytecode into native code, but I would like a confirmation on this. But my main concern is about the thread saying to be in 'waiting on condition' but later declared in RUNNABLE state. What am I misunderstanding ? And finally what's the meaning of [0x00000000] ?

thanks


So a field by field breakdown :

  1. "CompilerThread0" - Tomcat has the compiler thread for compiling JSPs. JSPs get compiled into a java class the first time they're accessed.
  2. daemon - it's a daemon thread so as not to keep your app alive when you choose to exit
  3. prio=10 - highest priority so that JSP compilation takes precedence over other requests.
  4. nid=0xe0c - don't actually know. ;)
  5. waiting on condition [0x0000000] - the thread is currently blocking waiting for someone to signal it to wake up and do something. as with nid, I'm not actually sure of what the [0x000000] refers to. I suspect that it would hold the address of an object monitor if that's what we were waiting on.
  6. java.lang.Thread.State: RUNNABLE - a thread waiting on a condition is still seen to be as RUNNABLE

One thing that looks confusing it first is that the thread is RUNNABLE even though it's waiting. This is counterintuitive, but it has to do with the fact that the JVM differentiates between a condition and an object monitor (e.g. the mechanism used for wait/notify).

Hope that helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜