module Rubellite::Concurrency

Defined in:

rubellite/concurrency.cr

Class Method Summary

Class Method Detail

def self.with_gvl(&block : -> U) : U forall U #

Runs a Crystal block while holding the Ruby GVL (from a thread that currently doesn't hold it).


[View source]
def self.without_gvl(&block : -> U) : U forall U #

Runs a Crystal block with the Ruby Global VM Lock (GVL) released. Allows other Ruby threads to run concurrently while this thread performs blocking I/O, waiting on channels, or heavy computations.


[View source]