On this page
threading.setprofile_all_threads
Prev: threading.setprofile | Up: threading | Next: threading.settrace
Rel: threading.active_count, threading.Barrier, threading.BoundedSemaphore, threading.BrokenBarrierError
Ref: docs.python.org — threading.setprofile_all_threads
Tags: #public #python3 #stdlib #threading
Import
import threading
from threading import setprofile_all_threads
Signature & Overview
threading.setprofile_all_threads(func)
Set a profile function for all threads started from the threading module and all Python threads that are currently executing.
Usage
import threading
# Python 3.12+: attaches a profile function to both running and future threads
threading.setprofile_all_threads(None)
Gotchas
- Requires Python 3.12+: Always reset with
threading.setprofile_all_threads(None)when done.
REPL Inspect
from threading import setprofile_all_threads
help(setprofile_all_threads)
Linked from
Related notes
- tuts/python3/stdlib_module/threading/setprofile Linked here; links to this page; shared tags: #stdlib, #threading
- tuts/python3/stdlib_module/threading/settrace 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