Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

•Re: Don't wait: waitpid. Why?

by merlyn (Sage)
on Feb 26, 2003 at 14:13 UTC ( [id://238772]=note: print w/replies, xml ) Need Help??


in reply to Don't wait: waitpid. Why?
in thread Run N similar tasks in parallel

Possibility to make waitpid a non-blocking call?
Ahh, yes. That's it. Although my little snippet of code would never need to wait for more than one process (it'll just loop the outer loop if the waited process is not one of our kids), there are times when I would change just that part of the loop to a "wait until there are no more kids" before moving on.

So, I'm a bit more familiar with waitpid now, and it makes it easy to step sideways to the multi-wait loop.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: Don't wait: waitpid. Why?
by Abigail-II (Bishop) on Feb 26, 2003 at 14:42 UTC
    Eh, if you wanted to wait until there are no more kids, you want a blocking call, inside a loop, wouldn't you?

    I usually do 1 until -1 == wait;, but waitpid would work just as well.

    Abigail

        Ah, I see. I thought you wanted to wait till all children had finished.

        Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-03-19 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found