Strange behaviour of addprocs on Julia 1.12-rc1

I used to use this call to add a process:

using DistributedNext
addprocs(1)

I use the new process for plotting based on PyPlot, which normally works fine. I use a separate process for plotting because PyPlot doesn’t like multi-threading. So I do the calculations multi-threaded in the main process, and plotting single-threaded in a worker process.

But the tests on Github crash if I do that on Julia 1.12-rc1.

The crashes disappeared when I use this command:

addprocs(1; exeflags=["-t 1", "--project", "--gcthreads=1,0"])

Any idea why? Shouldn’t it do exactly the same?

Probably caused by first point in NEWS.md:

Julia now defaults to 1 “interactive” thread, in addition to the 1 default “worker” thread. i.e. -t1,1. This means in default configuration the main task and repl (when in interactive mode), which both run on thread 1, now run within the interactive threadpool. The libuv IO loop also runs on thread 1, helping efficient utilization of the worker threadpool used by Threads.@spawn. Asking for specifically 1 thread (-t1/JULIA_NUM_THREADS=1) or passing 0 will disable the interactive thread i.e. -t1,0 or JULIA_NUM_THREADS=1,0 , or -tauto,0 etc. Asking for more than 1 thread will enable the interactive thread so -t2 will set the equivalent of -t2,1 (#57087).

Thanks!

But does it make sense to start Julia with an interactive thread when you create a worker process?

1 Like