You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I've been wondering if there have been any attempts to get the GTK loop running in a task scheduled on the interactive pool if available.
A while ago I made a quick attempt at just scheduling the glib_main in the interactive pool but things crashed. I'd be willing to try again with some pointers
The text was updated successfully, but these errors were encountered:
I did look into this a bit and (at least in 1.9) the GTK loop runs in the interactive pool, if it exists, without any extra setup.
This code, whether run in the REPL or as a script, for me prints "interactive" when there's an interactive thread pool. The @idle_add macro calls a function from the main loop so it's an easy way to check this.
using Gtk4
@idle_add println(Threads.threadpool())
if !isinteractive()
Gtk4.GLib.start_main_loop()
sleep(0.1) # allow println to be called before the loop is stopped
end
I just added a few examples that use threads to do work, and (at least for me, on Linux) things work well whether I start Julia with an interactive threadpool or not.
Ah, very cool! I just tried it out and yes it just works 😄
The context is that previously we had a very IO intensive task running along our GUI and the GTK loop halved our data transmission rates. Now with just adding the thread pool we are back to the expected rate!
Hello! I've been wondering if there have been any attempts to get the GTK loop running in a task scheduled on the interactive pool if available.
A while ago I made a quick attempt at just scheduling the
glib_main
in the interactive pool but things crashed. I'd be willing to try again with some pointersThe text was updated successfully, but these errors were encountered: