-
-
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
0eaf9c1
to
4b52062
Compare
339c71f
to
50a8cce
Compare
@@ -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.
// single threaded mode | ||
// Note: with -t1,1 a signal 10 occurs in task_scanner | ||
jl_options.nthreadpools = 1; | ||
jl_options.nthreads = 1; | ||
int16_t ntpp[] = {jl_options.nthreads}; | ||
jl_options.nthreads_per_pool = ntpp; |
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.
Could the signal 10 be related to/fixed by #56477 ?
fix test thread indexing make threads_exec work being called from :interactive and :default pools add tests for threaded construct default pools etc.
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
fc001e6
to
920085e
Compare
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