Skip to content
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

Removing the threadpool for Fibers #2551

Closed
eregon opened this issue Dec 17, 2021 · 0 comments
Closed

Removing the threadpool for Fibers #2551

eregon opened this issue Dec 17, 2021 · 0 comments
Assignees

Comments

@eregon
Copy link
Member

eregon commented Dec 17, 2021

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 eregon self-assigned this Dec 17, 2021
@eregon eregon added this to the 22.3.0 milestone Jun 13, 2022
john-heinnickel pushed a commit to thermofisher-jch/truffleruby that referenced this issue Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant