diff --git a/README.md b/README.md index 80bf466e..b6ea179c 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Other registered packages extend the functionality of Gtk4.jl: - [Gtk4Makie.jl](https://github.com/JuliaGtk/Gtk4Makie.jl): provides integration with the popular plotting package [Makie.jl](https://github.com/MakieOrg/Makie.jl), specifically its interactive, high performance GLMakie backend. ## Current status +**Note:** On Julia 1.11, Gtk4 causes the Julia REPL to freeze if Julia is started with more than one default thread and no interactive threads or with two interactive threads. This can be avoided with little-to-no performance penalty by being careful to start julia with `--threads N,1` or setting the environment variable `JULIA_NUM_THREADS = "N,1"` where N is the number of default threads to use. + For auto-generated code, Gtk4.jl relies on GObject introspection data generated on a Linux x86_64 machine, which may result in code that crashes on 32 bit computers. This mostly seems to affect obscure parts of GLib that are unlikely to be useful to Julia users, but 32 bit users should be aware of this. Note that this package uses binaries for the GTK library and its dependencies that are built and packaged using [BinaryBuilder.jl](https://github.com/JuliaPackaging/BinaryBuilder.jl). On Linux it does **not** use the binaries that are packaged with your distribution. The build scripts for the binaries used by Gtk4.jl, including the library versions currently being used, can be found by perusing [Yggdrasil.jl](https://github.com/JuliaPackaging/Yggdrasil.jl). diff --git a/src/Gtk4.jl b/src/Gtk4.jl index 9097ff34..f5bfcc35 100644 --- a/src/Gtk4.jl +++ b/src/Gtk4.jl @@ -138,6 +138,13 @@ end function __init__() in("Gtk",[x.name for x in keys(Base.loaded_modules)]) && error("Gtk4 is incompatible with Gtk.") + + if VERSION >= v"1.11" && isinteractive() + if (Threads.nthreads(:default) > 1 && Threads.nthreads(:interactive) == 0) || + Threads.nthreads(:interactive) > 1 + @warn("Gtk4 may freeze the REPL if there is more than one thread in its thread pool. Please set JULIA_NUM_THREADS to N,1 (for N default threads) and restart Julia.") + end + end # check that GTK is compatible with what the GI generated code expects vercheck = G_.check_version(MAJOR_VERSION,MINOR_VERSION,0)