From 4d6559fdbac974e0d0e50dbbb953d0328713b6cb Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Tue, 30 Jan 2024 13:30:23 +0100 Subject: [PATCH 1/3] fix incorrect documentation --- base/threadingconstructs.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index a5a1294be049b..2f4a4fc1d286d 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -44,8 +44,9 @@ maxthreadid() = Int(Core.Intrinsics.atomic_pointerref(cglobal(:jl_n_threads, Cin """ Threads.nthreads(:default | :interactive) -> Int -Get the current number of threads within the specified thread pool. The threads in default -have id numbers `1:nthreads(:default)`. +Get the current number of threads within the specified thread pool. The threads in `:interactive` +have id numbers `1:nthreads(:interactive)`, and the threads in `:default` have id numbers in +`nthreads(:interactive):nthreads(:default)+nthreads(:interactive)`. See also `BLAS.get_num_threads` and `BLAS.set_num_threads` in the [`LinearAlgebra`](@ref man-linalg) standard library, and `nprocs()` in the [`Distributed`](@ref man-distributed) From e7406940a5c7aeab1bd3705eb714dee783902607 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Tue, 30 Jan 2024 13:41:14 +0100 Subject: [PATCH 2/3] fix whitespace --- base/threadingconstructs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 2f4a4fc1d286d..7de66a96fa51d 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -45,7 +45,7 @@ maxthreadid() = Int(Core.Intrinsics.atomic_pointerref(cglobal(:jl_n_threads, Cin Threads.nthreads(:default | :interactive) -> Int Get the current number of threads within the specified thread pool. The threads in `:interactive` -have id numbers `1:nthreads(:interactive)`, and the threads in `:default` have id numbers in +have id numbers `1:nthreads(:interactive)`, and the threads in `:default` have id numbers in `nthreads(:interactive):nthreads(:default)+nthreads(:interactive)`. See also `BLAS.get_num_threads` and `BLAS.set_num_threads` in the [`LinearAlgebra`](@ref From 0579b5711f8eb37d3adbb38833dfc8715896bf18 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Tue, 30 Jan 2024 22:07:21 +0100 Subject: [PATCH 3/3] Update base/threadingconstructs.jl Co-authored-by: Jameson Nash --- base/threadingconstructs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/threadingconstructs.jl b/base/threadingconstructs.jl index 7de66a96fa51d..e202bb0acb317 100644 --- a/base/threadingconstructs.jl +++ b/base/threadingconstructs.jl @@ -46,7 +46,7 @@ maxthreadid() = Int(Core.Intrinsics.atomic_pointerref(cglobal(:jl_n_threads, Cin Get the current number of threads within the specified thread pool. The threads in `:interactive` have id numbers `1:nthreads(:interactive)`, and the threads in `:default` have id numbers in -`nthreads(:interactive):nthreads(:default)+nthreads(:interactive)`. +`nthreads(:interactive) .+ (1:nthreads(:default))`. See also `BLAS.get_num_threads` and `BLAS.set_num_threads` in the [`LinearAlgebra`](@ref man-linalg) standard library, and `nprocs()` in the [`Distributed`](@ref man-distributed)