-
Notifications
You must be signed in to change notification settings - Fork 188
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
Threads appears to be unstable #1445
Comments
I went looking for a document that explains our threading model, but I can't find one. We do actually have some major innovations in thread safety - look at our papers under the parallelism and concurrency section of https://rubybib.org. We're also the major contributors now to Concurrent Ruby. This seems like a bug which @eregon will be able to fix, rather than some fundamental problem. We're very interested in other thread stress tests and failures you find so please keep them coming if you find more. We should also write a document on our threading and memory model, using work from those papers, and we'll compare it to JRuby. |
It's not as bad as all that. Two of the errors were due to a race condition in some Eventbox test cases, so that I completed my list of issues now. So sorry for the noise and thank you for your awesome work on Ruby! |
Thank you for the report, this case is a race condition when creating a new thread, I'll fix it soon. TruffleRuby tries to follow the proposed Ruby Memory Model. |
@larskanis I fixed the issue in 2c7190c. Documenting our threading and memory model would be nice, but I consider it out of scope of this issue, as the original bug is fixed. |
@eregon Thank you for fixing this! And thank you for linking to the proposed Ruby Memory Model. I wasn't aware of this document and the related discussion. But this is interesting and sure, I have my own opinions about it... |
@larskanis please share your thoughts on the Ruby tracker, feedback is welcome :) |
While testing Eventbox on Truffleruby I noticed all kinds of errors due to the heavy threads usage. I'm unsure whether Truffleruby currently intends to be threadsafe and whether it intends to follow the concurrency rules of JRuby. As a first example here is a small script that raises a Java error with a 50% probability. I'll try to break the problems into more such failing scripts, if this is desired.
Fails with:
Tested on
The text was updated successfully, but these errors were encountered: