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.
66
66
nthreadpools () = Int (unsafe_load (cglobal (:jl_n_threadpools , Cint)))
67
67
68
68
"""
69
- Threads.threadpoolsize()
69
+ Threads.threadpoolsize(pool::Symbol = :default) -> Int
70
70
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).
72
73
73
74
See also: `BLAS.get_num_threads` and `BLAS.set_num_threads` in the
74
75
[`LinearAlgebra`](@ref man-linalg) standard library, and `nprocs()` in the
75
76
[`Distributed`](@ref man-distributed) standard library.
76
77
"""
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
78
88
79
89
function threading_run (fun, static)
80
90
ccall (:jl_enter_threaded_region , Cvoid, ())
You can’t perform that action at this time.
0 commit comments