Skip to content

Different behaviour when spawning to thread 1 or other threads #21

@mmiller-max

Description

@mmiller-max

Hi, I'm not sure if this is expected but this is the behaviour I'm seeing:

julia> ThreadPools.@tspawnat 1 twith(ThreadPools.StaticPool(3:8)) do pool
           @tthreads pool for i in 1:8
               sleep(0.1);println(i, Threads.threadid())
           end
       end
Task (runnable) @0x0000000132cab850
78
13
35
46
24
57
88
67
julia> ThreadPools.@tspawnat 2 twith(ThreadPools.StaticPool(3:8)) do pool
           @tthreads pool for i in 1:8
               sleep(0.1);println(i, Threads.threadid())
           end
       end
Task (runnable) @0x0000000132e96410
12
22
32
42
52
62
72
82

When spawning to thread 1, all of thread 3:8 can be used by the pool, but when spawning to thread 2 only thread 2 is used. Ideally I'd like to spawn to thread 2, and then use threads 3:8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions