Unix Programming - waiting for subset of child processes

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > March 2004 > waiting for subset of child processes





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author waiting for subset of child processes
Tejas Kokje

2004-03-20, 10:38 am

Hi,

How to wait for a subset of child processes. I mean if my parent
process forks 10 child process , i want to wait for only first five .

Regards,
Tejas Kokje
those who know me have no need of my name

2004-03-20, 9:56 pm

in comp.unix.programmer i read:

>How to wait for a subset of child processes. I mean if my parent
>process forks 10 child process , i want to wait for only first five .


take note of the pids and do some wait'ing.

--
a signature
Michael Kerrisk

2004-03-22, 3:33 am

On Sat, 20 Mar 2004 00:32:47 -0800, Tejas Kokje <kokje@usc.edu> wrote:

>Hi,
>
>How to wait for a subset of child processes. I mean if my parent
>process forks 10 child process , i want to wait for only first five .
>
>Regards,
>Tejas Kokje


Process groups may assist. You could place different children in
different process groups (setpgid()), and then use waitpid() to wait
for children within a particular group.

It would help if you said a bit more about WHY you want to do this.
(There may be better solutions than the one I describe.)

Cheers,

Michael
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com