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 njs
Recipients gregory.p.smith, ncoghlan, njs, pitrou, yselivanov
Date 2017-09-08.17:27:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504891678.62.0.721549222518.issue31388@psf.upfronthosting.co.za>
In-reply-to
Content
... it's true I did write such an example. And a few lines up in the same message I wrote an example where I was protecting an event loop from interrupts. In both cases the tricky question is how to manage the transitions between protected and unprotected without race conditions. Context-local state is a great solution for part of this problem.

I did realize this morning that technically it is *possible* to make a plain thread local work: you have to move all the state management into task context. So each time you start a task, wrap it in a helper that enables interrupts, and in early lowest level function that yields, reenable interrupts. This seems a bit pointless if we have context local state available though, because using context local state adds zero overhead to yields, and we yield approximately 10,000,000x more frequently than we receive SIGINT.
History
Date User Action Args
2017-09-08 17:27:58njssetrecipients: + njs, gregory.p.smith, ncoghlan, pitrou, yselivanov
2017-09-08 17:27:58njssetmessageid: <1504891678.62.0.721549222518.issue31388@psf.upfronthosting.co.za>
2017-09-08 17:27:58njslinkissue31388 messages
2017-09-08 17:27:58njscreate