make thread 1 interactive when there is an interactive pool, so it can run the event loop#49094
Merged
KristofferC merged 1 commit intomasterfrom Apr 13, 2023
Merged
make thread 1 interactive when there is an interactive pool, so it can run the event loop#49094KristofferC merged 1 commit intomasterfrom
KristofferC merged 1 commit intomasterfrom
Conversation
vtjnash
approved these changes
Mar 22, 2023
Member
vtjnash
left a comment
There was a problem hiding this comment.
Do we need to add an API at the same time for people to enumerate all worker thread ids (to keep the @threads macro working correctly)?
kpamnany
reviewed
Mar 22, 2023
Member
|
Thanks for this fix! I've been meaning to dig into why our interactive thread isn't being very interactive... |
3428071 to
c374808
Compare
Member
Author
|
Ok I have implemented all of the above. I wasn't sure we wanted to always have 2 threadpools but I guess there is no harm. The new function is provisionally named |
kpamnany
reviewed
Mar 23, 2023
Member
|
Removing |
Member
|
Bump |
NHDaly
reviewed
Apr 11, 2023
…n run the event loop
e97a32f to
20fa695
Compare
Xnartharax
pushed a commit
to Xnartharax/julia
that referenced
this pull request
Apr 19, 2023
…n run the event loop (JuliaLang#49094)
This was referenced May 1, 2023
vtjnash
pushed a commit
that referenced
this pull request
Jan 31, 2024
Since #49094, the docstring of `nthreads` has been incorrect. It currently states that > The threads in default have id numbers `1:nthreads(:default)`. whereas that is no longer true: ```julia julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid()) 3-element Vector{Int64}: 1 2 3 julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid()) 6-element Vector{Int64}: 4 5 6 7 8 9 ```
KristofferC
pushed a commit
that referenced
this pull request
Feb 6, 2024
Since #49094, the docstring of `nthreads` has been incorrect. It currently states that > The threads in default have id numbers `1:nthreads(:default)`. whereas that is no longer true: ```julia julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid()) 3-element Vector{Int64}: 1 2 3 julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid()) 6-element Vector{Int64}: 4 5 6 7 8 9 ``` (cherry picked from commit 95ae27f)
Drvi
pushed a commit
to RelationalAI/julia
that referenced
this pull request
Jun 7, 2024
Since JuliaLang#49094, the docstring of `nthreads` has been incorrect. It currently states that > The threads in default have id numbers `1:nthreads(:default)`. whereas that is no longer true: ```julia julia> filter(i -> Threads.threadpool(i) == :interactive, 1:Threads.maxthreadid()) 3-element Vector{Int64}: 1 2 3 julia> filter(i -> Threads.threadpool(i) == :default, 1:Threads.maxthreadid()) 6-element Vector{Int64}: 4 5 6 7 8 9 ``` (cherry picked from commit 95ae27f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a major problem preventing interactive threads from working well, which is that outside an
@threadsregion thread 1 is still the only one allowed to run the event loop. Responding to events is kind of the whole deal with interactive threads, so they need to be able to enter the event loop. We can't fully fix this until_threadedregionis finally removed. So to make interactive threads work in the meantime, this PR proposes making the interactive pool the first one, so thread 1 is interactive. For code like the following:this PR takes it from not working to working.