Most programs are executed line by line, only running a single process at a time. Threads allow multiple processes to flow independent of each other. Threading with multiple processors permits programs to run multiple processes simultaneously. This topic documents the implementation and usage of threads in Python.

Global Interpreter Lock

Running in Multiple Threads

Running in Multiple Processes

Sharing State Between Threads

Sharing State Between Processes