Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Perl/Tk and threads on Win32

by Anonymous Monk
on Oct 28, 2006 at 21:24 UTC ( [id://581109]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl/Tk and threads on Win32
in thread Perl/Tk and threads on Win32

The points made above are good. In addition I believe tk has issues with threads because it maintains its own state seperate to that of perl, so if you have tk objects accessed by multiple perl threads it will fall to pieces. To avoid these problems, spawn multiple threads early on, and create/interface with tk from your main thread/one thread only. Pass information or actions from your gui/tk thread to your worker threads via shared variables / thread safe queues or IPC etc. One possible advantage to this is that you have a better chance of ensuring your gui doesnt freeze during blocking actions as they will be passed to your worker threads. On the downside... your apps memory usage may well be huge by adding a gui - thats been my experience. Good luck, Rossco

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://581109]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-25 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found