Welcome to the Monastery | |
PerlMonks |
Re: segmentation fault while using thread and gtk2by SuicideJunkie (Vicar) |
on Jan 07, 2015 at 16:05 UTC ( [id://1112504]=note: print w/replies, xml ) | Need Help?? |
What is it you're trying to do there? Bad things tend to happen if you try to mix threads and Tk. A much safer way to go about it is to start your threads up front and keep them isolated from each other. Have one thread which does all of the GUI & Tk stuff. Have another thread (or thread pool) for doing background processing. Only the single GUI thread should ever touch the Tk elements, and the processing threads should pass their results to the GUI thread (eg: via shared memory) and let it draw the results. Don't spawn new threads from the GUI thread, and definitely don't do it after you have started creating Tk elements unless you like coding in the Twilight Zone. PS: The word you're looking for is segmentation, not sigmentation. Searches won't work very well that way.
In Section
Seekers of Perl Wisdom
|
|