Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra thread when using IJulia #1072

Open
carstenbauer opened this issue Apr 20, 2023 · 1 comment
Open

Extra thread when using IJulia #1072

carstenbauer opened this issue Apr 20, 2023 · 1 comment

Comments

@carstenbauer
Copy link
Member

In the REPL (with JULIA_NUM_THREADS=6)

Threads.nthreads(:default) # gives 6
count(i -> threadpool(i) == :default, 1:Threads.maxthreadid()) # gives 6

as expected. However, in Jupyter (IJulia) I get

Threads.nthreads(:default) # gives 6
count(i -> threadpool(i) == :default, 1:Threads.maxthreadid()) # gives 7 ?!?!

I assume that the extra thread is the heartbeat thread. But in any case, this seems inconsistent. Upstream issue?

@stevengj
Copy link
Member

stevengj commented Apr 20, 2023

Yup.

I'm not sure if there is a way to prevent Julia from claiming ownership of this thread? See also JuliaLang/julia#47196.

Or maybe Threads.nthreads should not count foreign threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants