New submission from Raymond Hettinger:
Used like this:
with gc_disabled():
run_some_timing()
with gc_disabled():
# do_something_that_has_real_time_guarantees
# such as a pair trade, robotic braking, etc
This would be implemented in C for atomicity and speed. It would be roughly
equivalent to:
@contextmanager
def gc_disabled():
if gc.isenabled():
gc.disable()
yield
gc.enable()
else:
yield
----------
assignee: ncoghlan
components: Interpreter Core
messages: 301407
nosy: eric.snow, gregory.p.smith, ncoghlan, rhettinger
priority: normal
severity: normal
status: open
title: Add context manager to temporarily disable GC
type: enhancement
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue31356>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com