in reply to Re^2: Need help in using threads in Tk
in thread Need help in using threads in Tk

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