RFR: 8358621: Avoid using a spinlock as the synchronization point returning from native in CPU Time Profiler

Aleksey Shipilev shade at openjdk.org
Tue Jul 15 11:49:38 UTC 2025


On Tue, 15 Jul 2025 11:36:51 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:

> Simple optimization to avoid busy waiting in safepoint handlers.

There is an utility for this, look in `utilities/spinYield.hpp`. Would be something like:


SpinYield sy;
while (...) {
  sy.wait();
}


Also, well, this does not _avoid_ the spinlock, it only makes it less aggressive.

I read the original improvement suggested using the actual / blocking `Mutex`/`Monitor`.

-------------

PR Review: https://git.openjdk.org/jdk/pull/26314#pullrequestreview-3019955256


More information about the hotspot-jfr-dev mailing list