Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: multiple infinitive loops

by ikegami (Patriarch)
on Oct 06, 2004 at 17:03 UTC ( [id://397091]=note: print w/replies, xml ) Need Help??


in reply to Re^2: multiple infinitive loops
in thread multiple infinitive loops

I don't know anything about these scripting/locator things, but a quick look at the MSDN Library shows that NextEvent accepts a timeout. Therefore, a simple solution is:

use constants TIMEOUT => 50; use constants wbemErrTimedOut => 0x80043001; while (1) { $o1 = $h1->NextEvent(TIMEOUT); ProcessEvent1($h1, $o1) if ($o1 != wbemErrTimedOut); $o2 = $h2->NextEvent(TIMEOUT); ProcessEvent2($h2, $o2) if ($o2 != wbemErrTimedOut); }

Replies are listed 'Best First'.
Re^4: multiple infinitive loops
by ozkaa (Acolyte) on Oct 06, 2004 at 17:10 UTC
    yes, but I don't want it to timeout because its a critical thing to keep on monitoring the processes

    Oscar
      It depends on how NextEvent works. If it just gets something from a queue (likely), you won't lose anything. It'll just get the event the next pass through the loop.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found