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 yselivanov
Recipients eric.snow, gregory.p.smith, josh.r, lisroach, ncoghlan, ned.deily, pablogsal, pitrou, rhettinger, serhiy.storchaka, yselivanov
Date 2018-01-31.18:00:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517421616.01.0.467229070634.issue31356@psf.upfronthosting.co.za>
In-reply-to
Content
A few thoughts:

1. The merged PR releases GIL for any Python code run in `with gc.ensure_disabled()`.  This is just plain wrong.

2. The merged PR crashes on debug build of CPython.

3. I don't actually understand this feature.  Our GC is not per OS thread, which means that inside `with gc.ensure_disabled()` the GC can become suddenly **enabled**, if another thread enables it.  This API is just misleading (maybe the name of the new context manager is bad—it cannot ensure anything).  There's even a unittest that tests this!

4. This new API can be trivially implemented in pure Python:

   @contextmanager
   def disable_gc():
       gc.disable()
       try:
           yield
       finally:
           gc.enable()

5. While such pure Python version shares the problem discussed in (3), the currently committed C implementation doesn't fix them either.

IMO this entire issue needs to be properly debated on python-ideas first and the PR should be reverted from beta-1.  If the latter is not possible, OK, let's revert it for beta-2 and for 3.8.
History
Date User Action Args
2018-01-31 18:00:16yselivanovsetrecipients: + yselivanov, rhettinger, gregory.p.smith, ncoghlan, pitrou, ned.deily, eric.snow, serhiy.storchaka, josh.r, lisroach, pablogsal
2018-01-31 18:00:16yselivanovsetmessageid: <1517421616.01.0.467229070634.issue31356@psf.upfronthosting.co.za>
2018-01-31 18:00:15yselivanovlinkissue31356 messages
2018-01-31 18:00:15yselivanovcreate