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 pdgoins-work
Recipients eryksun, neologix, paul.moore, pdgoins-work, pitrou, steve.dower, tim.golden, tim.peters, tupl, vstinner, zach.ware
Date 2018-05-01.21:50:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1525211441.41.0.682650639539.issue21822@psf.upfronthosting.co.za>
In-reply-to
Content
Okay, I think I need to abandon my research into this.  This does seem to have quite an amount of complexity to it and is probably more than I should be taking on at this point in time.

Anyone else who wants to look at this, consider it fair game.

Parting thoughts based on my limited expertise in the area, take them or ignore them:

* Semaphore-based AllocNonRecursiveMutex (!_PY_USE_CV_LOCKS): Using WaitForSingleObjectEx with alertable set to TRUE may be one path forward, however it seems like that would involve tracking all threads performing a ctrl-c-interruptible wait and calling QueueUserAPC with a no-op callback for each such thread to cause the wait to terminate early.  I don't particularly like the need to roll-our-own tracking, but at least off-hand and based on my somewhat limited experience in this area, I don't know of a better way.  Hopefully someone else does.

* CriticalSection/Semaphore-based AllocNonRecursiveMutex (_PY_USE_CV_LOCKS with _PY_EMULATED_WIN_CV): I don't know of a way of interrupting the CriticalSection lock, but the WaitForSingleObjectEx strategy may be usable on the semaphore-based condition variable.

* SRWLock/ConditionVariable-based AllocNonRecursiveMutex (_PY_USE_CV_LOCKS with !_PY_EMULATED_WIN_CV): Similarly, I don't know of a way to interrupt the SRWLock.  However, similar to WaitForSingleObjectEx, it may be possible to wake the condition variables via a Ctrl-C if we add our own tracking for such.  I'm not sure if this gets us quite to where we need to be or not.

Hopefully the above notes are of some value.
History
Date User Action Args
2018-05-01 21:50:41pdgoins-worksetrecipients: + pdgoins-work, tim.peters, paul.moore, pitrou, vstinner, tim.golden, neologix, zach.ware, eryksun, steve.dower, tupl
2018-05-01 21:50:41pdgoins-worksetmessageid: <1525211441.41.0.682650639539.issue21822@psf.upfronthosting.co.za>
2018-05-01 21:50:41pdgoins-worklinkissue21822 messages
2018-05-01 21:50:41pdgoins-workcreate