2 ms·
This requires you to wait for the whole batch to complete, instead of starting a new process as soon as one finishes. For these cases, I started using GNU para
by icebraining 12y ago
This requires you to wait for the whole batch to complete, instead of starting a new process as soon as one finishes.
For these cases, I started using GNU parallel instead of plain shell. It does the heavy concurrency lifting for you, and even allow almost seamless parallelization across different machines.
For example, your final code could be written as such:
parallel ./settings.sh python bin/migrate_media.py {} $LIMIT ::: $(seq 0 $LIMIT $NUMPLAYLISTS)
http://www.gnu.org/software/parallel/ http://www.gnu.org/software/parallel/
- zenogais 12y agoThis is great! Appreciate the tip