Gtk4.jl icon indicating copy to clipboard operation
Gtk4.jl copied to clipboard

REPL locks up after `using Gtk4` in julia 1.11 with multiple threads

Open jwahlstrand opened this issue 1 year ago • 3 comments

When Julia 1.11 is started with more than one interactive thread, or started with 2 or more default threads and no interactive thread, the REPL locks up after calling using Gtk4. So this occurs when starting julia with julia -t y or julia -t x,y for y>1.

Reported here https://github.com/jwahlstrand/AravisCameras.jl/issues/5 but it's a Gtk4 issue. I can reproduce it on Linux and others have reported it on Mac OS and Windows.

It doesn't happen in Julia 1.10.

jwahlstrand avatar Dec 06 '24 15:12 jwahlstrand

Just encountered this. It looks like it is not locked entirely (at least on MacOS), every key stroke take several seconds to be delivered, but they eventually do get delivered. So this is perhaps due to some cross-event loop communication issues (between Julia's event loop and Gtk's) ... perhaps.

srikumarks avatar Jan 04 '25 14:01 srikumarks

Thanks, good to know it's an issue on MacOS too. I do think it's an event loop conflict of some kind but am not sure what do to about it. For me at least, it can be avoided by starting Julia with julia -t N,1 (or setting the environment variable JULIA_NUM_THREADS = N,1). It deserves a note in the README and the documentation.

jwahlstrand avatar Jan 04 '25 17:01 jwahlstrand

It happens on Windows 11 as well.

RechercheStochastique avatar Feb 08 '25 01:02 RechercheStochastique