This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gregory.p.smith
Recipients eric.snow, gregory.p.smith, ncoghlan, pitrou, rhettinger, serhiy.storchaka
Date 2017-09-07.22:43:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504824203.8.0.918332311195.issue31356@psf.upfronthosting.co.za>
In-reply-to
Content
I believe Raymond is aware of the thread issue.  We discussed it.

If gc.disable() would return the previous state of the gc instead of None and an API to enable based on a passed in bool, both of which are written in C and executed with the GIL (or merely another lock protecting changing the gc state rather than the GIL) held and this Python would works with multiple threads all fighting to control the gc state:

@contextmanager
def gc_disabled():
  previous_enable_state = gc.disable()
  yield
  gc.set_enable(previous_enable_state)

But we don't need to modify gc.disable's return value or add a set_enable() if gc_disabled() itself is not implemented in Python.  That's up to the implementer.
History
Date User Action Args
2017-09-07 22:43:23gregory.p.smithsetrecipients: + gregory.p.smith, rhettinger, ncoghlan, pitrou, eric.snow, serhiy.storchaka
2017-09-07 22:43:23gregory.p.smithsetmessageid: <1504824203.8.0.918332311195.issue31356@psf.upfronthosting.co.za>
2017-09-07 22:43:23gregory.p.smithlinkissue31356 messages
2017-09-07 22:43:23gregory.p.smithcreate