Concurrency with Processes

Note

Note: Python Global Interpreter Lock (GIL) The GIL is an interpreter-level lock. This lock prevents execution of multiple threads at once in the Python interpreter. Each thread that wants to run must wait for the GIL to be released by the other thread, which means your multi-threaded Python application is actually single threaded. The GIL prevents simultaneous access to Python objects by multiple threads.

Refs.:

  • https://wiki.python.org/moin/GlobalInterpreterLock

  • https://realpython.com/python-gil/

Asyncio in Python

PyMOTW-3 - Concurrency with Processes, Threads, and Coroutines

subprocess — Spawning Additional Processes

multiprocessing — Threads

asyncio — Asynchronous I/O, event loop, and concurrency tools