The stupid question is the question not asked | |
PerlMonks |
Re^4: Gtk2 app -- what's better, threads, or multiple timeouts?by ttlgreen (Sexton) |
on Feb 06, 2009 at 04:43 UTC ( [id://741791]=note: print w/replies, xml ) | Need Help?? |
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!
In Section
Seekers of Perl Wisdom
|
|