JDK-4950589 : JVMTI spec: thread status constants - normalize names, renumber, add park
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2003-11-07
  • Updated: 2003-11-07
  • Resolved: 2003-11-07
Related Reports
Duplicate :  
Relates :  
Description
The rfe 4937022 (for adding I/O wait status) included much of the below,
but I/O wait status will not be implemented, so that rfe is being pulled.

JSR-166 adds a park concept (LockSupport.park) which needs a corresponding
thread status -- PARKED will be added (the JVMTI_THREAD_STATUS_
prefix is omitted here for readability)..

The ordering and numbering of thread status constants does not allow for the
logical addition of more constants, thus the constants need to be reordered
and renumbered.

The constant names are inconsistent and do not match common usage or the
java.lang.management.ThreadState API.  The following renamings will be made:

    ZOMBIE  ==> TERMINATED
    MONITOR ==> BLOCKED
    WAIT ==> WAITING

The old names will be available as synonyms during a transition period.

The BLOCKED state is specified as:

    Thread is waiting to enter a synchronization block.

and will be clarified to:

    Thread is waiting to enter a synchronization block or waiting to 
re-enter
    a synchronization block after an Object.wait()

Also, a thread status flag willed added to indicate timed waits and 
timed parks:

    JVMTI_THREAD_STATUS_FLAG_TIMED


Comments
EVALUATION See description ans suggested fix
11-06-2004

SUGGESTED FIX Thread Status Enumeration (jvmtiThreadStatus) Constant Value Description JVMTI_THREAD_STATUS_MIN 100 Minimum status value. JVMTI_THREAD_STATUS_UNKNOWN 100 Status unknown. JVMTI_THREAD_STATUS_NOT_STARTED 101 Thread has not yet been started. JVMTI_THREAD_STATUS_TERMINATED 102 Thread has completed execution. JVMTI_THREAD_STATUS_ZOMBIE 102 Same as JVMTI_THREAD_STATUS_TERMINATED. For transition only, will be removed. JVMTI_THREAD_STATUS_RUNNABLE 103 Thread is runnable. JVMTI_THREAD_STATUS_SLEEPING 104 Thread sleeping. (Thread.sleep() has been called.) JVMTI_THREAD_STATUS_BLOCKED 105 Thread is waiting to enter a synchronization block or waiting to re-enter a synchronization block after an Object.wait() JVMTI_THREAD_STATUS_MONITOR 105 Same as JVMTI_THREAD_STATUS_BLOCKED. For transition only, will be removed. JVMTI_THREAD_STATUS_WAITING 106 Thread waiting. (Object.wait() has been called.) JVMTI_THREAD_STATUS_WAIT 106 Same as JVMTI_THREAD_STATUS_WAITING. For transition only, will be removed. JVMTI_THREAD_STATUS_PARKED 107 Thread parked (LockSupport.park() has been called.) JVMTI_THREAD_STATUS_MAX 107 Maximum status value. -------------- Thread Status Flags Constant Value Description ... JVMTI_THREAD_STATUS_FLAG_TIMED 32 Thread status is JVMTI_THREAD_STATUS_WAITING or JVMTI_THREAD_STATUS_PARKED and the wait or park is timed.
11-06-2004