JDK-6502822 : suspend/resume cleanup: SR_lock() usage and platform-specific code
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-12-11
  • Updated: 2012-10-13
  • Resolved: 2007-01-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Related Reports
Relates :  
The removal of vm_suspend/vm_resume in 6498391 exposed further areas where the Java suspend/resume code can be cleaned up to reduce complexity:

1. The SR_lock() is used in a number of places within the thread creation code to protect access to OSThread state. This protection is unnecessary for two reasons:
 a) The OSThread instance, and the associated JavaThread instance has not been
    published at the time and so can not be concurrently accessed. Further, its use
    in this context is inconsistent across different platform code.
 b) There is no need to protect access to the OSThread state at all because
    - it is volatile and defined as a "hint"
    - it is usually set with no lock held
    - it is read with no lock held (target is often suspended)

By removing the use of the SR_lock() with OSThread state the SR_lock now serves solely as the lock/monitor used by the Java "external" suspend/resume mechanism, and
general protection of the _suspend_flags field. This cleanup also makes it easier to see how to remove the use of OSThread altogether - which is occurring in a seperate task

2. The "platform dependent" pd_self_suspend_thread method is no longer platform dependent (and hasn't been for some time). All platforms have a thread self-suspend by waiting on the SR_lock() monitor. This code can be moved directly into the JavaThread::java_suspend_self method, thereby simplifying the code and removing platform-specific functionality (which is a good goal)

EVALUATION See description.