File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -66,15 +66,25 @@ Returns the number of threadpools currently configured.
6666nthreadpools () = Int (unsafe_load (cglobal (:jl_n_threadpools , Cint)))
6767
6868"""
69- Threads.threadpoolsize()
69+ Threads.threadpoolsize(pool::Symbol = :default) -> Int
7070
71- Get the number of threads available to the Julia default worker-thread pool.
71+ Get the number of threads available to the default thread pool (or to the
72+ specified thread pool).
7273
7374See also: `BLAS.get_num_threads` and `BLAS.set_num_threads` in the
7475[`LinearAlgebra`](@ref man-linalg) standard library, and `nprocs()` in the
7576[`Distributed`](@ref man-distributed) standard library.
7677"""
77- threadpoolsize () = Threads. _nthreads_in_pool (Int8 (0 ))
78+ function threadpoolsize (pool:: Symbol = :default )
79+ if pool === :default
80+ tpid = Int8 (0 )
81+ elseif pool === :interactive
82+ tpid = Int8 (1 )
83+ else
84+ error (" invalid threadpool specified" )
85+ end
86+ return _nthreads_in_pool (tpid)
87+ end
7888
7989function threading_run (fun, static)
8090 ccall (:jl_enter_threaded_region , Cvoid, ())
You can’t perform that action at this time.
0 commit comments