-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BEAM crash from from port/NIF thread #8209
Conversation
CT Test Results 3 files 141 suites 49m 25s ⏱️ Results for commit 698fe88. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
6bdb8fc
to
d2e8b15
Compare
d2e8b15
to
7e66483
Compare
Rebased onto OTP-23.3.4 + 184634a which is mergeable to all newer release branches. Also tweaked solution with a global atomic to get some "randomness". |
The sample I attached to #8208 (and now it is actually attached!) includes a rudimentary benchmark. There's a lot of variance in the results but they seem to consistently be a few % slower with Sverker's tweak. And in that simple test there is also no contention for the new atomic which I imagine would further degrade performance. |
What if you change
|
If something like this was what you had in mind then it was about the same. |
Given that the random number is used to pick a random pivot element in quicksort, performance is expected to vary as a result of this change, and the consistently worse performance might just be bad luck (or rather, very good luck with the original implementation always returning a good constant). |
7e66483
to
698fe88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dotsimon Forgot about this PR. Now rebased into one commit and push to your repo.
This patch prevents non-scheduler threads from crashing the emulator.
Fixes #8208