Skip to content

Instantly share code, notes, and snippets.

@joonan30
Last active August 30, 2019 05:33
Show Gist options
  • Select an option

  • Save joonan30/c50f91a1b431a54d97bf5e764ad4c5ce to your computer and use it in GitHub Desktop.

Select an option

Save joonan30/c50f91a1b431a54d97bf5e764ad4c5ce to your computer and use it in GitHub Desktop.
mp.py
# python 3
import multiprocessing as mp
from multiprocessing import Pool, cpu_count
number_threads = 8
## Creating a pool for parallel processing
pool = mp.Pool(number_threads)
pool.imap_unordered(os.system, cmds )
pool.close()
pool.join()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment