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

Re: Non-blocking IO and threads

by BrowserUk (Pope)
on Oct 06, 2011 at 17:11 UTC ( #930022=note: print w/ replies, xml ) Need Help??


in reply to Non-blocking IO and threads

This code will hang at count = 10 until something is read from the command prompt. How do I avoid this block?

That isn't what happens running your code on my system. I waited until the count reached 14 the typed 'x' 3 times and ^C once:

c:\test>junk85 test, count:0 test, count:1 test, count:2 test, count:3 test, count:4 test, count:5 test, count:6 test, count:7 test, count:8 test, count:9 test, count:10 test, count:11 @test, count:12 @test, count:13 test, count:14 x->120 @test, count:15 x->120 test, count:16 x->120 @test, count:17 Terminating on signal SIGINT(2)

Hard to advise on how to avoid something that doesn't happen?


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.


Comment on Re: Non-blocking IO and threads
Download Code
Re^2: Non-blocking IO and threads
by PhillyR (Acolyte) on Oct 06, 2011 at 18:03 UTC
    What if I tell you I'm using ActiveState 5.8 on a Windows machine?
      I, too, am seeing a "hang" at "test, count:10" (under Activestate 5.12.4/Windows XP). And I must note that I'm not seeing that "hang" under Ubuntu-"Natty Narwhal".
      I'm using ActiveState 5.8 on a Windows machine?

      I used AS 5.10.1 on Windows above. I just tried it with AS 5.8.9 and it blocks as you describe.

      I do not have an explanation for that, but the work-around is obvious. Upgrade.


      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.

Log In?
Username:
Password:

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

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

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (108 votes), past polls