On this page
threading.setprofile
Prev: threading.Semaphore | Up: threading | Next: threading.setprofile_all_threads
Rel: threading.active_count, threading.Barrier, threading.BoundedSemaphore, threading.BrokenBarrierError
Ref: docs.python.org — threading.setprofile
Tags: #public #python3 #stdlib #threading
Import
import threading
from threading import setprofile
Signature & Overview
threading.setprofile(func)
Set a profile function for all threads started from the threading module.
Usage
import threading
# Registers a profiler function for all *future* Thread objects started via threading
threading.setprofile(None)
Gotchas
- Does not affect already-running threads: Use
setprofile_all_threads()(Python 3.12+) if you also need to attach to active threads.
REPL Inspect
from threading import setprofile
help(setprofile)
Linked from
Related notes
- tuts/python3/stdlib_module/threading/Semaphore Linked here; links to this page; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/setprofile_all_threads Linked here; links to this page; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/threading/active_count Linked here; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/Barrier Linked here; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/BoundedSemaphore Linked here; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/BrokenBarrierError Linked here; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/Condition shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/current_thread shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/enumerate shared tags: #stdlib, #threading