Python Threads and Concurrency

From NovaOrdis Knowledge Base
Revision as of 23:13, 14 May 2024 by Ovidiu (talk | contribs) (→‎TODO)
Jump to navigation Jump to search

Internal

TODO

  • PROCESS PyOOP "Concurrency" + "Threads" + "The many problems with threads" + "Shared memory" + "The global interpreter lock" + "Thread overhead" + "Multiprocessing" + "Multiprocessing pools" + "Queues" + "The problems with multiprocessing" + "Futures" + "AsyncIO" + "AsyncIO in action" + "Reading an AsyncIO Future" + "AsyncIO for networking" + "Using executors to wrap blocking code" + "Streams" + "Executors" + "AsyncIO clients" + "Case Study"
  • Develop Python Global Interpreter Lock (GIL)

Overview

Python is not the best choice for building highly concurrent, multi-threaded applications, particularly applications with many CPU-bound threads. The main reason for this is Python's Global Interpreter Lock (GIL), a mechanisms that prevents the interpreter from executing more than one instruction at a time, even in the presence of multiple cores.