LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 01-05-2008, 01:54 AM   #1
indiancosmonaut
Member
 
Registered: Feb 2007
Posts: 65

Rep: Reputation: 15
Parallel processing and Process management.


Hi guys,

I am trying to write a master script which should pass filename to another script running in background [one file is passed at a time i.e. 1 background process]. Now the contraint is that I can have only 3 instances of the slave script at any point in time.

Initially there will be 3 background processes. Now suppose one finishes. So immedietly the next file should be passed. How can I achieve this. I assume ps command can be used, but correctly how?

Also, I have to update a status log when one background process ends.
The problem is that there is one status log and if 2 scripts complete at the same time, they would try to write to the status log at the same time! I have tried using 'wait' for this. Here process management comes into play.

I am facing some problem on how to implement. Please give a cue and I can go furthur. Some code snippet would be useful.

Any inputs would be helpful.

Thanks in advance...

Kind regards,

indiancosmonaut
 
Old 01-30-2008, 10:54 AM   #2
Michael AM
Member
 
Registered: May 2006
Distribution: AIX 5.3, AIX 6.1, AIX 7.1
Posts: 123

Rep: Reputation: 33
You might be able to do this using the AIX queueing mechanism. This used to be called the bsh queue - but ksh would probably be the preferred mechanism now.

The idea is that you use ksh as if it were a printer. Rather than print jobs the queue executes ksh scripts.

Advantage: jobs can be submitted at any time, even when the queue is not 'printing'. Stopping the queue lets the last job complete. Starting the queue starts the first job in queue.

As AIX enq supports the concept of 1 input queue 'printing' to multiple 'printers' you should be able to have scripts running in parallel.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
parallel processing of threads in java nickraj Programming 16 10-05-2006 10:15 AM
Building a parallel processing system with a few 120MHz 16MB machines on Red Hat 7.0 vhasun Linux - Networking 1 05-08-2006 04:47 PM
parallel processing between linux & windows kapil_dev Linux - Software 1 10-14-2005 12:54 AM
Parallel processing with Intel 4 560 processor jbmorla Linux - Hardware 0 12-14-2004 07:24 AM
is parallel processing possible in distrributed system? sabeen Linux - Distributions 1 03-26-2004 06:40 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration