Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 680 Bytes

File metadata and controls

28 lines (20 loc) · 680 Bytes

Parallelism, Concurrency, and AsyncIO in Python - by example

Speeding up CPU-bound and IO-bound operations with multiprocessing, threading, and AsyncIO

Blog post: Parallelism, Concurrency, and AsyncIO in Python - by example

Setup

  1. Fork/Clone
  2. Create and activate a virtual environment
  3. Install the dependencies

IO-bound Operation

$ python io-bound_sync.py
$ python io-bound_concurrent_1.py
$ python io-bound_concurrent_2.py
$ python io-bound_concurrent_3.py

CPU-bound Operation

$ python cpu-bound_sync.py
$ python cpu-bound_parallel_1.py
$ python cpu-bound_parallel_2.py