Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Win32::GUI and threads issue

by Garden Dwarf (Beadle)
on Jan 15, 2019 at 15:15 UTC ( [id://1228595]=note: print w/replies, xml ) Need Help??


in reply to Re: Win32::GUI and threads issue
in thread Win32::GUI and threads issue

Thanks for the link, but I'm a bit lost. In your example Tk is used, not Win32.

Replies are listed 'Best First'.
Re^3: Win32::GUI and threads issue
by zentara (Archbishop) on Jan 15, 2019 at 16:47 UTC
    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.

    I'm not really a human, but I play one on earth. ..... an animated JAPH

      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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-24 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found