On this page
sys.getswitchinterval
Prev: sys.getsizeof | Up: sys | Next: sys.gettrace
Rel: sys.activate_stack_trampoline, sys.addaudithook, sys.audit, sys.breakpointhook
Ref: docs.python.org — sys.getswitchinterval
Tags: #public #python3 #stdlib #sys
Import
import sys
from sys import getswitchinterval
Signature & Overview
sys.getswitchinterval()
Return the current thread switch interval; see sys.setswitchinterval().
Usage
import sys
interval = sys.getswitchinterval()
assert interval > 0 # default is 0.005 seconds (5 ms)
Gotchas
- Controls GIL thread-switching interval: Tune with
sys.setswitchinterval()only after profiling thread contention.
REPL Inspect
from sys import getswitchinterval
help(getswitchinterval)
Linked from
Related notes
- tuts/python3/stdlib_module/sys/getsizeof Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/gettrace Linked here; links to this page; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/sys/activate_stack_trampoline Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/addaudithook Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/audit Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/breakpointhook Linked here; shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/call_tracing shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/deactivate_stack_trampoline shared tags: #stdlib, #sys
- tuts/python3/stdlib_module/sys/displayhook shared tags: #stdlib, #sys