Skip to content

Surprising behavior for default/interactive thread pools #53217

Closed as not planned
@samtkaplan

Description

@samtkaplan

By default, it appears that work is assigned to the interactive thread pool (if it exists) rather than the default thread pool. The expected behavior is that, by default, work gets assigned to the default thread pool, and assignment to the interactive thread pool requires either appropriate use of the interactive REPL, or use of Threads.@spawn :interactive. Please also see a corresponding discourse post.

Here are some examples that reproduce the problem:

Example 1

julia -t 1,1 -e 'print(stdout, "$(Threads.threadpool())\n")'

outputs:

interactive

Example 3

julia -t 1,1 -e 'Threads.threadid() in Threads.threadpooltids(:interactive) ? println("interactive") : println("default"); println(isinteractive())'

outputs

interactive
false

Example 4

julia -t 3,1 -E 'Threads.threadpool()'
:interactive

Metadata

Metadata

Assignees

No one assigned

    Labels

    multithreadingBase.Threads and related functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions