in reply to Re^3: Gtk2 app -- what's better, threads, or multiple timeouts?
in thread Gtk2 app -- what's better, threads, or multiple timeouts?

The solution is to use a hybrid architecture whereby the threads post results and updates for the gui to a Thread::Queue, and you use a timer in the gui to regularly check (poll) that queue from the main (gui) thread looking for those updates.

Sounds good enough, I'll have to check that out. I might be able to manage just having the (non gui-related) dirty work done in threads but I'll have to play around.

I never did get GTK2 to work with perl on my (win32) system (though it runs fine here from Ocaml), so I cannot offer you a sample, but I'm fairly sure that zentara has posted some GTK2 + threads snippets, and we've both posted Tk samples that demonstrate the techiques.

Great! I'll see if I can locate some of those. I assume you mean those are here in the monastary...

Thanks for the help!

  • Comment on Re^4: Gtk2 app -- what's better, threads, or multiple timeouts?