JDK-8320317 : ObjectMonitor NotRunnable is not really an optimization
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21,22,23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-11-17
  • Updated: 2024-04-02
  • Resolved: 2024-01-08
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 23
23 b05Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
This function and the comment block that precedes it are an attempt to avoid spinning if the object that owns the lock is off proc, but it can't really tell that from the things it's testing.  According to [~dice] the original intent was that Solaris would provide a secret API to tell that.
Instead it's a function that increases the complexity of the spinning algorithm.

We should run some benchmarks to determine if this function does anything and remove it if not.

This function doesn't work if we use the ThreadID as owner for the ObjectMonitor which helps Loom. See JDK-8320320.
Changeset: 29397d29 Author: Fredrik Bredberg <fbredberg@openjdk.org> Committer: Erik Ă–sterlund <eosterlund@openjdk.org> Date: 2024-01-08 13:32:17 +0000 URL: https://git.openjdk.org/jdk/commit/29397d29baac3b29083b1b5d6b2cb06e456af0c3

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17050 Date: 2023-12-11 09:50:37 +0000