Python Threading Module
Thread-based parallelism — Thread, Lock, Semaphore, Event, Timer. This category documents 12 Python threading module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: threading.Thread(), thread.Thread.start(), thread.Thread.join(), threading.Lock(), threading.RLock(), threading.Semaphore(), threading.Event(), threading.local(), threading.current_thread(), threading.enumerate(), threading.active_count(), threading.Timer(). threading.Thread() creates a new thread object that runs the target function with args. thread.Thread.start() starts the thread activity. Must be called at most once per thread. thread.Thread.join() waits for the thread to terminate. Blocks until timeout or completion. threading.Lock() creates a new primitive lock (mutex). Only one thread can acquire the lock at a time. threading.RLock() creates a reentrant lock that can be acquired multiple times by the same thread. Threading Module belongs to the Concurrency & Networking group alongside Concurrent Module, Asyncio Module, Subprocess Module, Urllib Module.