12-02-2008
7,
0
Join Date: Dec 2008
Last Activity: 15 December 2008, 8:09 AM EST
Posts: 7
Thanks Given: 0
Thanked 0 Times in 0 Posts
race condition with wait() function
Hi,
I'm currently writing a bash script, that starts multiple threads:
____________________
#!/bin/bash
loop=0
while((loop!=10))
do
thread &
((loop++))
done
#wait for all sub-processes (thread) to finish
wait
___________________
Now I want to know, what happens, if a sub-process (thread) is finished,
before the main-script gets to the wait parameter.
Will the wait parameter realize, that the thread has already finished or will it wait to infinity?
Thnaks for your help...