Message311348
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. |
|
Date |
User |
Action |
Args |
2018-01-31 18:00:16 | yselivanov | set | recipients:
+ yselivanov, rhettinger, gregory.p.smith, ncoghlan, pitrou, ned.deily, eric.snow, serhiy.storchaka, josh.r, lisroach, pablogsal |
2018-01-31 18:00:16 | yselivanov | set | messageid: <1517421616.01.0.467229070634.issue31356@psf.upfronthosting.co.za> |
2018-01-31 18:00:15 | yselivanov | link | issue31356 messages |
2018-01-31 18:00:15 | yselivanov | create | |
|