The point he was trying to make is that the Win32::GUI module is NOT THREADSAFE. This is true of many modules that use global variables, which is usually true with GUI toolkits. There are ways around it, usually by creating your threads first, before invoking Win32::GUI. This has been discussed so many times that I will leave it up to you to search for solutions. Since Tk is the most widely used GUI toolkit with Perl, searching Google for "perl Tk thread safety" will yield all the discussions and solutions. Usually the solutions involve creating your threads first, before any GUI statements ( because threads are copies of the originating script), and not putting any GUI code in the threads. The idea is to keep any GUI variables out of the threads. A proper design keeps your GUI code confined to the original thread to handle the display, and a means of communicating information between the spawned threads and the display thread, usually thru a timer to update, or some sort of fileevent.
| [reply] |
Well, I was thinking about a Win32::GUI specific issue, but I understand this is common. That's probably why I didn't find answers on other posts.
Anyway, thank you both for your time & help. I think I get the point now
| [reply] |