Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Win32::GUI sending Windows messages between threads

by dasgar (Deacon)
on Jan 17, 2013 at 15:29 UTC ( #1013801=note: print w/ replies, xml ) Need Help??


in reply to Win32::GUI sending Windows messages between threads [solved]

Here's something that I personally would try.

Launch a thread and create Win32::GUI::Timer object. When the timer goes off, have it check to see if the thread is joinable. If it's not, do nothing. If if it is, then you can join the thread and kill the Win32::GUI::Timer object.

However, if you're needing the thread to continue running for a long time and return stuff periodically, you can tweak the above steps so that you're checking on shared variable(s) instead of checking to see if the thread is joinable.


Comment on Re: Win32::GUI sending Windows messages between threads
Re^2: Win32::GUI sending Windows messages between threads
by shadrack (Acolyte) on Jan 17, 2013 at 16:22 UTC
    I definitely need the child thread to run for a long time -- possibly the entire lifetime of the program. Sounds like you're suggesting I essentially poll inside the timer handler. I am considering that as a fallback if I can't get the message passing thing to work, but ultimately it's polling and it's inefficient and the message passing approach seems much better, so I want to pursue it first.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2014-07-25 00:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls