Python Concurrency & Networking
Concurrency & Networking — Threading, asyncio, subprocess, URLs, FTP, email, HTTP servers. This group brings together the Threading Module, Concurrent Module, Asyncio Module, Subprocess Module, Urllib Module, Ftplib Module, Smtplib Module, Poplib Module, Imaplib Module, HTTP Server Module, SocketServer Module, XML-RPC Module, Webbrowser Module categories of the Python standard library. 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. Representative APIs from this group include threading.Thread(), thread.Thread.start(), thread.Thread.join(), threading.Lock(), threading.RLock(), threading.Semaphore(), threading.Event(), threading.local().