https://github.com/JuliaLang/julia
Raw File
Tip revision: 08e1fc0abb959ce5bd4c75b05518a41b85e4aba1 authored by Kristoffer Carlsson on 10 April 2024, 08:40:44 UTC
release-1.11: Update VERSION to 1.11.0-beta1 (#54004)
Tip revision: 08e1fc0
threadpool_use.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
using Base.Threads

@test nthreadpools() == 2
@test threadpool() === :interactive
@test threadpool(2) === :default
@test fetch(Threads.@spawn Threads.threadpool()) === :default
@test fetch(Threads.@spawn :default Threads.threadpool()) === :default
@test fetch(Threads.@spawn :interactive Threads.threadpool()) === :interactive
tp = :default
@test fetch(Threads.@spawn tp Threads.threadpool()) === :default
tp = :interactive
@test fetch(Threads.@spawn tp Threads.threadpool()) === :interactive
tp = :foo
@test_throws ArgumentError Threads.@spawn tp Threads.threadpool()
@test Threads.threadpooltids(:interactive) == [1]
@test Threads.threadpooltids(:default) == [2]
back to top