PyDocs

Concurrent Execution

threading

not WASI

Thread module emulating a subset of Java's threading model.
Symbols in threading

_

__excepthook__
Handle uncaught Thread.run() exception.

a

active_count
Return the number of Thread objects currently alive.

b

Barrier
Implements a Barrier.
BoundedSemaphore
Implements a bounded semaphore.
BrokenBarrierError
This exception, a subclass of RuntimeError, is raised when the Barrier object is reset or broken.

c

concurrent_tee
Variant of itertools.tee() but with guaranteed threading semantics.
Condition
Class that implements a condition variable.
current_thread
Return the current Thread object, corresponding to the caller's thread of control.

e

enumerate
Return a list of all Thread objects currently alive.
Event
Class implementing event objects.
excepthook
Handle uncaught Thread.run() exception.

g

get_ident
Return a non-zero integer that uniquely identifies the current thread amongst other threads that exist simultaneously.
get_native_id
Return a non-negative integer identifying the thread as reported by the OS (kernel).
getprofile
Get the profiler function as set by threading.setprofile().
gettrace
Get the trace function as set by threading.settrace().

l

local
Thread-local data
Lock
A lock object is a synchronization primitive.

m

main_thread
Return the main thread object.

r

RLock
Factory function that returns a new reentrant lock.

s

Semaphore
This class implements semaphore objects.
serialize_iterator
Wrap a non-concurrent iterator with a lock to enforce sequential access.
setprofile
Set a profile function for all threads started from the threading module.
setprofile_all_threads
Set a profile function for all threads started from the threading module and all Python threads that are currently executing.
settrace
Set a trace function for all threads started from the threading module.
settrace_all_threads
Set a trace function for all threads started from the threading module and all Python threads that are currently executing.
stack_size
Return the thread stack size used when creating new threads.
synchronized_iterator
Wrap an iterator-returning callable to make its iterators thread-safe.

t

Thread
A class that represents a thread of control.
TIMEOUT_MAX
The maximum value allowed for the timeout parameter of blocking functions (Lock.acquire(), RLock.acquire(), Condition.wait(), etc.).
Timer
Call a function after a specified number of seconds: