JDK-8307068 : store a JavaThread* in the java.lang.Thread object after the JavaThread* is added to the main ThreadsList
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2023-04-27
  • Updated: 2023-07-25
  • Resolved: 2023-05-13
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 17 JDK 21
17.0.9-oracleFixed 21 b23Fixed
Related Reports
Blocks :  
Description
During the lengthy discussions and analysis of the following fix:

    JDK-8305670 Performance regression in LockSupport.unpark with lots of idle threads

we concluded that a JavaThread* should be stored in the java.lang.Thread
object after the JavaThread* has been added to the main ThreadsList.
Publishing that JavaThread* early can lead to situations where the
JavaThread* can be accessed/used before it is protected by a
ThreadsListHandle which is not safe.
Comments
Fix request [17u] I backport this for parity with 17.0.9-oracle. Medium risk, adding synchronization may slow down matters. I had to patch a lot by hand, also javaThread is in thread.cpp in 17. SAP nighlty testing passes.
18-07-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk17u-dev/pull/1587 Date: 2023-07-17 09:14:25 +0000
17-07-2023

Changeset: ceca198e Author: Daniel D. Daugherty <dcubed@openjdk.org> Date: 2023-05-13 14:41:19 +0000 URL: https://git.openjdk.org/jdk/commit/ceca198ef21b9003492b456d87180d2f48774f73
13-05-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13723 Date: 2023-04-28 17:09:55 +0000
28-04-2023