-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Take advantage of Ruby 3 scheduler. #111
Conversation
0fa7c7b
to
e567794
Compare
Okay, interesting, macOS is passing, Linux is failing.
|
Async Scheduler thread tests:
Seems like |
Okay, at least part of this was a bug due to the GVL releasing code being backwards in the EPoll backend of |
41cfe3c
to
a9a83b3
Compare
I found an interesting problem today. In In addition, I considered that some parts of async-pool can invoke non-blocking interfaces, e.g. any time we call a method on the supplied class we should be cautious that it can fail with an exception... so we need to probably improve the robustness of the implementation. |
Ruby 3 allows mixing `Fiber#resume/#yield` and `Fiber#transfer`. We can take advantage of that to minimise the impact of non-blocking operations on user flow control. Previously, non-blocking operations would invoke `Fiber.yield` and this was a user-visible side-effect. We did take advantage of it, but it also meant that integration of Async with existing usage of Fiber could be problematic. We tracked the most obvious issues in `enumerator_spec.rb`. Now, non-blocking operations transfer directly to the scheduler fiber and thus don't impact other usage of resume/yield.
…sient tasks from finishing.
3aaa564
to
544094a
Compare
# Conflicts: # lib/async/scheduler.rb
544094a
to
f36d350
Compare
bcb0653
to
9d2790b
Compare
Description
Take direct advantage of the Ruby 3 scheduler interface. While we will try to maintain compatibility as much as possible, there might be some internal scheduler changes which impact the concurrency model (order of operations).
Types of Changes