-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Default to 1 interactive thread #57087
base: master
Are you sure you want to change the base?
Default to 1 interactive thread #57087
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
bd7417f
to
ac4361b
Compare
function test_thread_range() | ||
a = zeros(Int, threadpoolsize()) | ||
@threads for i in 1:threadid() | ||
a[i] = 1 | ||
end | ||
for i in 1:threadid() | ||
@test a[i] == 1 | ||
end | ||
for i in (threadid() + 1):threadpoolsize() | ||
@test a[i] == 0 | ||
end | ||
end | ||
test_thread_range() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out what this test is actually testing, given the test script always runs from thread 1
5949b51
to
84a85b0
Compare
84a85b0
to
0eaf9c1
Compare
fix test thread indexing make threads_exec work being called from :interactive and :default pools add tests for threaded construct default pools etc.
0eaf9c1
to
4b52062
Compare
4b52062
to
339c71f
Compare
339c71f
to
50a8cce
Compare
I believe these make more sense as async than spawn, otherwise more orchestration is needed in the example. Were changed to spawn in JuliaLang#55315
@@ -614,7 +614,7 @@ Start some other operations that use `f(x)`: | |||
julia> g(x) = f(x) | |||
g (generic function with 1 method) | |||
julia> t = Threads.@spawn f(wait()); yield(); | |||
julia> t = @async f(wait()); yield(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were changed to @spawn
in #55315 but I think they make sense as @async
otherwise more orchestration is needed when multiple threads are available to make the examples work as expected.
Part of #43672
So:
default
== 1 default, 1 interactive-t1
== 1 default, 1 interactive-t1,0
== 1 default, 0 interactiveetc.
Motivations
Todo
:interactive
threadpool, and that a bare@spawn
or@threads
will schedule in the:default
threadpool-t1,0
:interactive
threadpool during precompilation/PackageCompilerIssues