Last active
August 30, 2019 05:33
-
-
Save joonan30/c50f91a1b431a54d97bf5e764ad4c5ce to your computer and use it in GitHub Desktop.
mp.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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