truffleruby icon indicating copy to clipboard operation
truffleruby copied to clipboard

Removing the threadpool for Fibers

Open eregon opened this issue 3 years ago • 0 comments

We plan to remove the threadpool for Fibers because it adds tons of complexity and can cause correctness issues (the same Java Thread is used for Fibers of belonging to different Ruby Threads). It also forces an extra indirection for ContextThreadLocal, and other languages might reuse their ContextThreadLocal for different Fibers over time, belonging even potentially to different Ruby Threads, which could lead to various issues.

That will make Fiber creation slower though, until we have Loom. Running bench/micro/fiber/create.rb: JVM-CE: ~40k vs ~8k Native CE: ~44k vs ~10k The numbers are also much more stable without the pool.

Related: GR-37076

eregon avatar Dec 17 '21 17:12 eregon