JVMCI compiler thread idle state is RUNNABLE

Christian Thalinger cthalinger at twitter.com
Wed Sep 7 17:19:05 UTC 2016


> On Sep 7, 2016, at 12:34 AM, Doug Simon <doug.simon at oracle.com> wrote:
> 
> 
>> On 06 Sep 2016, at 23:39, Christian Thalinger <cthalinger at twitter.com> wrote:
>> 
>> One thing we noticed here at Twitter is that JVMCI threads are not hidden (is_hidden_from_external_view) but at the same time they show up as always active.
>> 
>> I don’t know the history here but I’m speculating that since compiler threads were always hidden no-one bothered.  In the SIGQUIT thread dump compiler threads show up as RUNNABLE:
>> 
>> "C1 CompilerThread3" #8 daemon prio=9 os_prio=31 tid=0x00007fdcc2016800 nid=0x5103 waiting on condition [0x0000000000000000]
>>   java.lang.Thread.State: RUNNABLE
>> 
>> "C2 CompilerThread2" #7 daemon prio=9 os_prio=31 tid=0x00007fdcc2821800 nid=0x4f03 waiting on condition [0x0000000000000000]
>>   java.lang.Thread.State: RUNNABLE
>> 
>> The specification of RUNNABLE is:
>> 
>>        /**
>>         * Thread state for a runnable thread.  A thread in the runnable
>>         * state is executing in the Java virtual machine but it may
>>         * be waiting for other resources from the operating system
>>         * such as processor.
>>         */
>>        RUNNABLE,
>> 
>> and that makes sense.  But this is very confusing to the user (as one of our internal users reported to me).  Maybe JVMCI threads should just be hidden, too?
> 
> Why is this very confusing? All sorts of non-app threads show up in a SIGQUIT thread dump don’t they?

The confusing part is that JVMCI threads show up but C1/C2 threads don’t.  Oh, maybe I wasn’t clear enough.  I’m not talking about a SIGQUIT thread dump; I’m talking about the thread list you can get in Java code (JVM_GetAllThreads aka. “external view”).

> 
> Not sure if this is covered by your proposal/question but I don’t think JVMCI compiler threads should be hidden from JVMTI otherwise they could never be debugged by a Java IDE.

I don’t know which threads JVMTI sees but I would assume it’s not using the “external view”.

> 
> -Doug



More information about the hotspot-compiler-dev mailing list