Skip to content

testdrivenio/parallel-concurrent-examples-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

414faee · Jul 3, 2022

History

3 Commits
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Oct 11, 2020
Jul 1, 2022
Oct 11, 2020

Repository files navigation

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