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.
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
| 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.
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.
Could the signal 10 be related to/fixed by #56477 ?
fc001e6 to
920085e
Compare
|
Building on @JamesWrigley's work we've done a push to more extensively test and fix Distributed's thread safety, including running its own tests with I believe that was the only blocking issue here? |
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
920085e to
eb92c57
Compare
Part of #43672
So:
default== 1 default, 1 interactive-t1== 1 default, 1 interactive-t1,0== 1 default, 0 interactiveetc.
Motivations
Todo
:interactivethreadpool, and that a bare@spawnor@threadswill schedule in the:defaultthreadpool-t1,0:interactivethreadpool during precompilation/PackageCompilerIssues
-t4,4to shake issues out) 🤖 [master] Bump the Distributed stdlib from c613685 to 8890288 #57169