![]() |
|
|
|
|
|||||||
| 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 |
| Repeated execution of Autosys Jobs | Data469 | Shell Programming and Scripting | 2 | 02-28-2008 12:24 PM |
| Running 2 Drives simultaneously? | Infidel | Filesystems, Disks and Memory | 4 | 01-24-2008 04:55 AM |
| background jobs exit status and limit the number of jobs to run | GrepMe | Shell Programming and Scripting | 1 | 06-11-2007 03:56 PM |
| How to parse 2 files simultaneously | Awanka | Shell Programming and Scripting | 8 | 04-12-2007 05:00 PM |
| cp & mkdir simultaneously | enuenu | UNIX for Dummies Questions & Answers | 5 | 03-13-2007 01:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Execution of two jobs simultaneously
Hi All,
I have a script and a diff program,(lets say a java program) which needs to be excuted simulaneously. What I am currently doing is excuting one in foregound and the other in the back ground. But as running the job in the background does not always fruitful, especially when the jobs are really taking few hours to get completed. Why I need simultaneous execution is both the jobs are taking hours to execute, so I just can not wait for the first one to get executed and then the next. Even my task does not stop there. I have to process some thing more after the execution of these two jobs. Am sure that I will get several alternatives to my approach. Looking for all of them.. Thanks in advance, Regards, ...rin... |
| Forum Sponsor | ||
|
|
|
|||
|
You can "multi-process" jobs, we do it all the time. For example, take the apply payments to accounts job. Running the account payment job on all accounts takes four hours.
Running the eight simultaneous versions of the same job (passing a parameter) and having each job work on a subset of accounts has a total run-time of about 40 minutes. like this: Code:
#!/bin/ksh acctjob 1-10000 & acctjob 10001-20000 & ...... wait |
|
|||
|
Quote:
there is no relation or relavance in running a process bg or fg and the time it takes to complete. only thing, background process when attempting to block on a read call through the command interpretor would be signalled to stop temporarily by the kernel. |
|
|||
|
Quote:
Jim, I am currently working the same way what you have mentioned. But I am not very much sure about your point of time getting splitted among different processes. In fact this is a load on the processor and the time for processing for uni processor machines will get affected. Hence it will take more time to execute each individual. Let me put the way, I am doing. #! /usr/bin/ksh ksh abc.ksh & ## knowing that this job will take less time (2 hrs) java xyz ## this is a quite longer job (4hrs) wait ## assuming a case when the script will takemore ## time than the java . .. ... #some other processing which needs both the jobs finised ... .. . Earlier I used to run the jobs sequencially which was talking 6hrs+. But after doing the above said way, I did not feel any noticable improvements. That is the reason why I came up putting in from of right people. What I need is the above jobs should get executed with a maximum time of time taken by java program, i.e 4 hrs in this case. Any suggestion is welcome. Regards, ...rin... |
|
|||
|
Quote:
nice -n 4 ksh abc.ksh & But let me repeat, this job is taking comparatively less time. Hence I need not put priority to this job. Rather I can do the same for the other job. Till now we are talking about one solution only. What I was expecting was multiple solutions to my problem, from the Gurus' like you people. Come up with any probable solution and we can always discuss on that. Hats up to Unix Gurus'... |