XP is just a number | |
PerlMonks |
Re^3: Need help in using threads in Tkby zentara (Archbishop) |
on Apr 28, 2012 at 11:29 UTC ( [id://967799]=note: print w/replies, xml ) | Need Help?? |
Your big problem as far as threads and Tk goes, is that you are trying to start threads after Tk code has been written. Tk is not threadsafe. It looks like you should be able to reorganize your code fairly easily. See PerlTk on a thread... for a simple Th with threads example, and some rules to follow. Also, if you are on a single cpu machine, using threads probably will not increase your performance. So, create your thread first, before tkinit, then confine all your network code to the thread. By the way, not to confuse you further, but Perl/Gtk2 will allow you to create threads after the GUI code is init'ed, but it still is a good rule to keep thread code and GUI code separate. I'm not really a human, but I play one on earth. Old Perl Programmer Haiku ................... flash japh
In Section
Seekers of Perl Wisdom
|
|