RFR: 8317433: Async UL: Only grab lock once when write():ing
Johan Sjölen
jsjolen at openjdk.org
Wed Oct 4 09:18:19 UTC 2023
Hi,
The writer thread used to await for `_data_available` to become true through using the async log lock as a condition variable. When data is available it'd let go of the lock and then call `AsyncLogWriter::write()`, which would immediately try to acquire that same lock. We can remove this second instance by moving the work needed to be done under lock to `run`.
Thank you for considering this.
-------------
Commit messages:
- Copyright
- Do not copy the stringStream's underlying buffer
- Only acquire the lock once for writing
Changes: https://git.openjdk.org/jdk/pull/16030/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16030&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8317433
Stats: 45 lines in 2 files changed: 18 ins; 23 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/16030.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16030/head:pull/16030
PR: https://git.openjdk.org/jdk/pull/16030
More information about the hotspot-runtime-dev
mailing list