pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jruby/jruby/pull/9144

/assets/global-0bd78641c0a1f3e0.css" /> Initial hack to avoid exceptions in sleep wakes by headius · Pull Request #9144 · jruby/jruby · GitHub
Skip to content

Initial hack to avoid exceptions in sleep wakes#9144

Draft
headius wants to merge 1 commit intojruby:10.1-devfrom
headius:mutex_wake_without_exception
Draft

Initial hack to avoid exceptions in sleep wakes#9144
headius wants to merge 1 commit intojruby:10.1-devfrom
headius:mutex_wake_without_exception

Conversation

@headius
Copy link
Copy Markdown
Member

@headius headius commented Dec 18, 2025

As described in #9140, sleep logic in JRuby based on a lock currently wakes that sleep by triggering an
InterruptedException. This adds significant overhead to every such wake-up operation, and is generally unnecessary if the thread doing the waking owns the lock and could simply signal it.

This attempts to reduce the chances that an InterruptedException will be triggered by first trying to signal the condition associated with the lock. If the lock is not owned, this will trigger an IllegalMonitorStateException and we proceed to the previous interrupt logic.

This does mean that non-owned lock wake-ups will have double the performance hit they did before, but such cases are generally only to shock a thread out of a lock sleep. This fix is also not ready for prime-time and will be pushed as a draft until we properly handle all lock-sleep uses without triggering any exceptions.

As described in jruby#9140, sleep logic in JRuby based on a
lock currently wakes that sleep by triggering an
InterruptedException. This adds significant overhead to every such
wake-up operation, and is generally unnecessary if the thread doing
the waking owns the lock and could simply signal it.

This attempts to reduce the chances that an InterruptedException
will be triggered by first trying to signal the condition
associated with the lock. If the lock is not owned, this will
trigger an IllegalMonitorStateException and we proceed to the
previous interrupt logic.

This does mean that non-owned lock wake-ups will have double the
performance hit they did before, but such cases are generally only
to shock a thread out of a lock sleep. This fix is also not ready
for prime-time and will be pushed as a draft until we properly
handle all lock-sleep uses without triggering any exceptions.
@headius headius added this to the JRuby 10.1.0.0 milestone Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy