The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fork() problem ddx08 High Level Programming 3 03-01-2007 06:06 AM
Error Checking Problem pokeycam Shell Programming and Scripting 4 09-13-2006 12:38 AM
fork problem qntmteleporter High Level Programming 4 01-25-2006 03:56 AM
link error problem niukun Linux 4 11-18-2004 01:14 AM
fork error santoshsonawane UNIX for Dummies Questions & Answers 1 08-17-2002 06:59 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 07-14-2008
Registered User
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 250
It's simple enough.
Code:
#define MAXC 25
pid_t do_child(char *cmd, char *args[]);

int main(void) {
int v = 0, x =0;
pid_t p_arrays[MAXC];

            while (v  <  MAXC) {p_arrays[v] = do_child(...); v++);
            while (x < (MAXC - 1)) {
                   if (waitpid(0,NULL,WNOHANG)) > 0) {x++;}
                   sleep(1);
             }
}
/*do_child with fork + execv is simple as is parsing and passing args to do_child in main*/
Reply With Quote
Forum Sponsor
  #9  
Old 09-04-2008
Registered User
 

Join Date: Oct 2007
Posts: 21
Thumbs up

Sorry for the delay
And thanks all for your replies..

I really helped..
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 02:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0