testdrivenio / parallel-concurrent-examples-python

examples of parallelism, concurrency, and asyncio in python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

examples of parallelism, concurrency, and asyncio in python

License:MIT License


Languages

Language:Python 100.0%