![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multi-threading-- calling same function through different threads | arunchaudhary19 | High Level Programming | 1 | 12-10-2007 11:54 AM |
| Multi threading? | enuenu | High Level Programming | 4 | 05-29-2007 06:17 AM |
| Regarding Multi-Threading | matrixmadhan | High Level Programming | 5 | 07-20-2005 06:54 AM |
| Multi-threading questions | DreamWarrior | High Level Programming | 1 | 11-02-2003 11:34 PM |
| Multi threading using posix thread library | shushilmore | High Level Programming | 2 | 09-09-2002 08:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi, I have written a code which will run a set of process using fork. I want to know from You how can i start another job when one of my job in my loop is completed My code is Code:
#include<stdio.h>
#include<ctype.h>
main() {
int pid,cid;
ChildProcess();
pid=getpid();
printf("pid : %d\n",pid);
printf(" FORK DEMO ");
if(!fork()) {
cid=getpid();
printf(" cid : %d ",cid);
printf("i m the child process");
ChildProcess();
exit(0);
}
printf("waiting for child");
wait(NULL);
printf(" child finished ");
}
ChildProcess() {
int i;
for(i=0;i<10;i++) {
system("sh runcpty.sh"); //here i wrote code to run pgms
printf(" %d ",i);
sleep(0);
}
}
This program will run only start processing 10 programs, But i want to start another program automatically when one of process out of ten is completed (i.e Multi Tasking) Can U please solve this problem I added code tags for readability -- Perderabo Last edited by Perderabo; 11-27-2003 at 06:00 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|