GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — Add a simple deadlock detector for require locks. by headius · Pull Request #4095 · jruby/jruby Conversation
Member
This detector works only with two threads, using the following
We may want a more advanced detector that can handle arbitrarily See #3341.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
I made a modification to mitigate known issue 2 above: it now will attempt to lock FIRST, only doing deadlock detection if that attempt fails. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
should safe fail when mx ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@kares Indeed...it would likely just skip this code. This general pattern may be applicable elsewhere, so this should move into its own utility class. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
0c53b64 to
2d6762e
Compare
|
Punting to 9.1.4.0. Too risky to stitch in at the last moment for 9.1.3.0. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2d6762e to
58cc903
Compare
|
Needs rebase and more thought. Bumping and rebasing. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This detector works only with two threads, using the following heuristic: 1. If the lock is already acquired, obtain its owner thread. 2. Check if the owner thread is waiting on a lock. 3. If the lock the owner is waiting on is held by the current thread, raise an error. 4. If there's no owner and no deadlock, try to lock the thread for 500ms + rand(100)ms. 5. If the file has been locked, return success. 6. Otherwise, start over at 1. We may want a more advanced detector that can handle arbitrarily many threads, but it would be much heavier and require scanning all threads in the system, including those unrelated to the current program and those not actually trying to require files. See #3341.
58cc903 to
a6e70e3
Compare
|
De-targeting. This may be useful some day but there's work required and many open questions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.