United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6502822 suspend/resume cleanup: SR_lock() usage and platform-specific code
6502822 : suspend/resume cleanup: SR_lock() usage and platform-specific code

Details
Type:
Enhancement
Submit Date:
2006-12-11
Status:
Closed
Updated Date:
2012-10-13
Project Name:
JDK
Resolved Date:
2007-01-17
Component:
hotspot
OS:
generic
Sub-Component:
runtime
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs10

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
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)

                                    

Comments
EVALUATION

See description.
                                     
2006-12-11



Hardware and Software, Engineered to Work Together