-
Notifications
You must be signed in to change notification settings - Fork 419
New Exchanger Implementation #396
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
Conversation
a22dd3f
to
980e779
Compare
f5bdb0a
to
4add0c3
Compare
I believe this new implementation is functionally correct. Both the original condition variable implementation and the later MVar implementation had known bugs, which is why we moved Exchanger into Edge. So I don't think there is any harm in merging it, even if we discover bugs later. @mighe @chrisseaton @pitr-ch I know you are all very busy, but if any of you have a chance to review this PR I would appreciate it. |
The crucial method for anyone else reviewing this: https://github.com/ruby-concurrency/concurrent-ruby/pull/396/files#diff-8a5aa6ad7f52e71c4ce9a64573329694R163 I don't understand the high-level algorithm here so it's hard to verify that it's a correct algorithm, or that it's correctly implemented. Can you describe the algorithm in a comment, or reference the code where it is from? |
@chrisseaton Done. The algorithm is described (in detail) in the source. Once I wrote it all out I discovered a bug so that was a bonus. |
I've read carefully both the algorithm and the code, I've also run the code "by hand" looking for race conditions. |
This PR has been rebased against the latest master (after thread_safe was merged). I would like to include this PR in the 1.0.0.pre1 release but that is not essential. I'll leave it open for a couple of days to get more review/feedback. We'll release 1.0.0.pre1 next week with or without this PR. |
New Exchanger Implementation
Brand new implementation based on OpenJDK 8