grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Use `rb_nogvl(..., RB_NOGVL_OFFLOAD_SAFE)` for compatibility with the fiber scheduler.

Open ioquatix opened this issue 8 months ago • 1 comments

This adds RB_NOGVL_OFFLOAD_SAFE to the blocking operations that release the GVL, allowing them to be offloaded in the fiber scheduler, preventing blocking the event loop. More testing is required, but this won't affect non-fiber scheduler code paths so it should be safe to merge.

Specifically, I'll follow up with additional testing within the async gem, and we need to review if grpc itself has any thread-local storage shared during no-gvl operations (my guess is that it doesn't but I haven't explicitly checked yet).

ioquatix avatar Apr 18 '25 00:04 ioquatix

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: ioquatix / name: Samuel Williams (8f4893d1dc727e4fb364458fcc14b74900c5789d)

It'd be helpful to use grpc with fibers. Anything I could do to help make it happen sooner?

arjun810 avatar Aug 23 '25 22:08 arjun810