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

Foreign threads: improve handling of adoption during GC #49960

Open
maleadt opened this issue May 26, 2023 · 0 comments
Open

Foreign threads: improve handling of adoption during GC #49960

maleadt opened this issue May 26, 2023 · 0 comments
Labels
feature Indicates new feature / enhancement requests multithreading Base.Threads and related functionality

Comments

@maleadt
Copy link
Member

maleadt commented May 26, 2023

#49928 shows that thread adoption (jl_adopt_thread) during GC execution causes segmentation faults, because it hits safepoints before the necessary signal handlers are installed. A workaround was merged in #49934, which makes thread adoption wait until GC finishes, and disables it until the thread is fully set-up.

That workaround isn't great. It would be better if jl_adopt_thread installs signal handlers earlier, so that it can use the regular safepoint mechanism instead of having to spin (necessitating changes to safepoint handling, see https://github.com/JuliaLang/julia/pull/49934/files#diff-bee600bf97e7c6c270d5ee24948080e9e92ba903b34c76e6c2d34b18bc3771ba). As noted in #49934, that isn't straightforward, and some functionality will have to be split off / made compatible with execution during task set-up.

@maleadt maleadt added multithreading Base.Threads and related functionality feature Indicates new feature / enhancement requests labels May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature / enhancement requests multithreading Base.Threads and related functionality
Projects
None yet
Development

No branches or pull requests

1 participant