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 serhiy.storchaka
Recipients YoSTEALTH, eric.snow, gregory.p.smith, josh.r, lisroach, ncoghlan, ned.deily, pablogsal, pitrou, pmpp, rhettinger, serhiy.storchaka, yselivanov
Date 2018-02-05.06:29:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517812142.38.0.467229070634.issue31356@psf.upfronthosting.co.za>
In-reply-to
Content
1. The used approach was broken in the presence of multiple threads too. It didn't guarantee even that GC will be disabled in the next line.

2. What is a sense of disabling GC in a single thread? Objects in Python are not thread local, they are accessible from all threads, and collecting garbage in one thread affects other threads.

For truly disabling GC globally you need to use a counted semaphore or other synchronization primitives, and this can be implemented at Python level. But what are use cases for this context manager? Isn't naive approach enough?
History
Date User Action Args
2018-02-05 06:29:02serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, gregory.p.smith, ncoghlan, pitrou, ned.deily, pmpp, eric.snow, yselivanov, josh.r, YoSTEALTH, lisroach, pablogsal
2018-02-05 06:29:02serhiy.storchakasetmessageid: <1517812142.38.0.467229070634.issue31356@psf.upfronthosting.co.za>
2018-02-05 06:29:02serhiy.storchakalinkissue31356 messages
2018-02-05 06:29:02serhiy.storchakacreate