Hi, Under RHAT 9. I'm executing several groups of processes that must complete in the same sequence in which they are started. I'm using wait() to try to accomplish this...
example...
program1.py
Print "Step 1"
for x in list
spawnv(..function1...x + x....)
wait() #these must complete before Step 2 starts
Print "Step 2"
for x in list
spawnv(..function2...x + x....)
wait()
When I execute program1.py and redirect the output for analysis...
python program1.py 1>out1 2>out2
out1 seems to indicate that function1 does start first and in general it completes prior to function2 but this is not always the case. The output may look like...
function1 start x
function1 start xx
function1 start xxx
function1 end x
function2 start x
function1 end xx
function2 start xx
function1 end xxx
function2 start xxx
Step 1
Step 2
function2 end x
function2 end xx
function2 end xxx
So it appears that the wait() is not working.
Shouldn't all of the spawnv statements prior to a wait() complete before the continuing beyond the wait?
Thanks for your help.
example...
program1.py
Print "Step 1"
for x in list
spawnv(..function1...x + x....)
wait() #these must complete before Step 2 starts
Print "Step 2"
for x in list
spawnv(..function2...x + x....)
wait()
When I execute program1.py and redirect the output for analysis...
python program1.py 1>out1 2>out2
out1 seems to indicate that function1 does start first and in general it completes prior to function2 but this is not always the case. The output may look like...
function1 start x
function1 start xx
function1 start xxx
function1 end x
function2 start x
function1 end xx
function2 start xx
function1 end xxx
function2 start xxx
Step 1
Step 2
function2 end x
function2 end xx
function2 end xxx
So it appears that the wait() is not working.
Shouldn't all of the spawnv statements prior to a wait() complete before the continuing beyond the wait?
Thanks for your help.