Skip to content

Instantly share code, notes, and snippets.

@odoku
Created May 10, 2019 07:14
Show Gist options
  • Save odoku/458a429f394088660ea9925d57db0ed9 to your computer and use it in GitHub Desktop.
Save odoku/458a429f394088660ea9925d57db0ed9 to your computer and use it in GitHub Desktop.
python - multi processing
import concurrent.futures
def wait():
print('Waiting')
for x in range(10 ** 100):
z = 10 + 20
print('Done')
def main():
executor = concurrent.futures.ProcessPoolExecutor(max_workers=10)
for x in range(0, 10):
executor.submit(wait)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment