Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Signals vs. Windows

by nikosv (Hermit)
on Oct 04, 2012 at 10:34 UTC ( #997214=note: print w/ replies, xml ) Need Help??


in reply to Signals vs. Windows

Windows work with messages while signals are emulated in console mode.

Aside from that,on Windows for thread synchronization or notification you can you use events and WaitForMultipleObjects or WaitForMultipleObjectsEx. You can use the Win32::Event to get to them from Perl

Each child thread can work and poll on when the event is signalled and abort if it does.

Another advantage is that they are kernel events so they can pertain across processes too.


Comment on Re: Signals vs. Windows
Re^2: Signals vs. Windows
by BrowserUk (Pope) on Oct 04, 2012 at 10:36 UTC

    All very well and good; but none of it helps the OP timeout a blocking read.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      I see,so you mean that the child thread can't poll. What if he combines polling the event with non blocking IO ?
        What if he combines polling the event with non blocking IO ?

        That is certainly an option, but once you move to non-blocking IO and polling, a simple shared variable transitioning from false to true is far simpler than a kernel-based event mechanism.

        The problem with non-blocking IO is that you then have manually replicate all the functionality of readline, eof etc. in user code which is a retrograde step. Especially when there are simpler ways.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (18)
As of 2014-12-18 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (56 votes), past polls