I need to make a thread to wait till the command run on shell get completed.
The use case is given below
- Pick one archive from the queue.
- Now untar that archive in a directory. This operation is fired using bac kticks operator.
- Repeat above steps till the queue is not empty.
Now above operations will be performed by a set of threads. So the problem is that thread don't till the execution over the shell get completed and they are overloading the system.
So is there a way I can make thread to wait till the execution over the shell get completed.