Skip to content

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jul 11, 2024

Also add a missing lock call in jl_safepoint_suspend_thread.

Instead of only preventing access to LLVM and inference (via the codegen lock), this prevents further access to all internals by disabling the safepoints and waiting for the threads to stop (or to be in unmanaged code that we don't care about).

This then uses that to also make staticdata loading a bit safer, since jl_lookup_cache_type_ assumes there are no concurrent mutator threads, and we can make that true by pausing all of those.

@vtjnash vtjnash added the multithreading Base.Threads and related functionality label Jul 11, 2024
Also add a missing lock call in jl_safepoint_suspend_thread.

Instead of only preventing access to LLVM and inference (via the codegen
lock), this prevents further access to all internals by disabling the
safepoints and waiting for the threads to stop (or to be in unmanaged
code that we don't care about).

This then uses that to also make staticdata loading a bit safer, since
`jl_lookup_cache_type_` assumes there are no concurrent mutator threads,
and we can make that true by pausing all of those.
@vtjnash vtjnash force-pushed the jn/safe-exit-pause branch from e9fd108 to 3e7c90d Compare July 13, 2024 12:52
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Jul 13, 2024
@fatteneder fatteneder merged commit 6e11ffc into master Jul 13, 2024
@fatteneder fatteneder deleted the jn/safe-exit-pause branch July 13, 2024 21:12
@fatteneder fatteneder removed the merge me PR is reviewed. Merge when all tests are passing label Jul 13, 2024
@vtjnash vtjnash mentioned this pull request Jan 2, 2025
51 tasks
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.

2 participants