https://github.com/JuliaLang/julia
Raw File
Tip revision: e48a0c99bef949a84979c05dc33fd5578f684c1d authored by Nicu Stiurca on 02 February 2023, 08:09:03 UTC
Clarify usage of JULIA_PROJECT=@. envvar (#48492)
Tip revision: e48a0c9
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() === :default
@test threadpool(2) === :interactive
dtask() = @test threadpool(current_task()) === :default
itask() = @test threadpool(current_task()) === :interactive
dt1 = @spawn dtask()
dt2 = @spawn :default dtask()
it = @spawn :interactive itask()
wait(dt1)
wait(dt2)
wait(it)
back to top