socketry / async

An awesome asynchronous event-driven reactor for Ruby.
MIT License
2.15k stars 89 forks source link

Add support for `Fiber::Scheduler#blocking_operation_wait`. #352

Closed ioquatix closed 5 days ago

ioquatix commented 2 weeks ago

This is a very basic implementation of the Fiber::Scheduler#blocking_operation_wait hook.

See https://bugs.ruby-lang.org/issues/20876 for more context.

Types of Changes

Contribution

ioquatix commented 5 days ago

Confirmed tests passing on ruby-head.

tenderlove commented 5 days ago

Does this mean that every time something releases the GVL, async will create a new thread?

ioquatix commented 5 days ago

Yes the current implementation is a bit naive. I’ll implement a thread pool if it makes sense to do so. The overhead of thread creation isn’t so bad though - will need to spend some time testing it.