![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| parallel processing | audippa | Shell Programming and Scripting | 3 | 03-01-2007 09:01 AM |
| Make : parallel execution | suman_jakkula | AIX | 0 | 03-14-2006 12:33 AM |
| parallel environment in aix | mzzt | AIX | 0 | 01-09-2006 12:32 PM |
| How to run processes in parallel? | sbasak | Shell Programming and Scripting | 3 | 11-03-2004 10:12 AM |
| How to do parallel processing?? | zing | UNIX for Dummies Questions & Answers | 1 | 06-23-2003 09:47 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Parallel Execution
Hello,
I wish to run parallel process forked from one script. Currently I doing is submit them in background. For example: --------------------------------------------------------------- #!/usr/bin/ksh process1 & process2 & process3 & ..... ..... #here I check for completion of all process success. #each process writes its status to a file while true do # code to check success done --------------------------------------------------------------- Is there a better way to execute jobs in paralle? If yes please advise. Thanks, Rishi |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Assuming that by running separate processes you get better throughput, this is a fine way to proceed.
|
|
#3
|
|||
|
|||
|
What about something like...
#!/bin/ksh ./a.sh & pid_a=$! ./b.sh & pid_b=$! ./c.sh & pid_c=$! wait $pid_a echo "a.sh returned $?" wait $pid_b echo "b.sh returned $?" wait $pid_c echo "c.sh returned $?" -Om |
|
#4
|
||||
|
||||
|
it can be good replacement if I was not seeking parallel execution...
I believe with wait the execution will become sequential...and waiting for all the process finishing starting from one... my requirement is suppose one process is finished I need to start some processing on data prepared by tht process.... in this case say process a takes largest time then I need to wait till process a to finish before I begin for processing of b,c...z though they have already finished... Rishi |
|
#5
|
|||
|
|||
|
RishiPahuja -
We use the control file method just like you do. Sorry for any confusion |
|||
| Google The UNIX and Linux Forums |