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

support threads in precompile and jl_task_wait_empty #52445

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Dec 7, 2023

Add a nrunning counter which identifies (when zero) when there is nothing running anymore. Allowing us to gate all tasks on all threads on reaching a quiescent state, not just thread 0. This should let us better support running precompile with threads (since we will be ensured that all of them are asleep in a consistent state before serialization tries to inspect the process state). We could additionally stop them afterwards to make sure there is no way for them to begin running, even if we forgot about some other event source, but that seems unnecessary paranoia for now.

Fixes #52435

@vtjnash vtjnash added the multithreading Base.Threads and related functionality label Dec 7, 2023
@vtjnash vtjnash requested a review from vchuravy December 7, 2023 19:21
src/jl_uv.c Outdated Show resolved Hide resolved
src/scheduler.c Outdated Show resolved Hide resolved
src/scheduler.c Outdated Show resolved Hide resolved
Add a `nrunning` counter which identifies (when zero) when there is
nothing running anymore. Allowing us to gate all tasks on all threads on
reaching a quiescent state, not just thread 0. This should let us better
support running precompile with threads (since we will be ensured that
all of them are asleep in a consistent state before serialization tries
to inspect the process state). We could additionally stop them
afterwards to make sure there is no way for them to begin running, even
if we forgot about some other event source, but that seems unnecessary
paranoia for now.
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Dec 8, 2023
@vtjnash vtjnash merged commit bb28222 into master Dec 11, 2023
6 of 8 checks passed
@vtjnash vtjnash deleted the jn/precompile-threads branch December 11, 2023 17:25
@ufechner7
Copy link

Should this be back-ported to 1.10 ?

@vtjnash
Copy link
Member Author

vtjnash commented Dec 11, 2023

No, it is a new feature

@vtjnash
Copy link
Member Author

vtjnash commented Dec 11, 2023

@N5N3 N5N3 removed the merge me PR is reviewed. Merge when all tests are passing label Dec 14, 2023
@IanButterworth
Copy link
Member

IanButterworth commented Aug 28, 2024

@ufechner7 just checking you are handling the 1.10 backport that Jameson suggested here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Precompilation can't handle serialization of Task's enqued in Channels
6 participants