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 eryksun
Recipients eryksun, paul.moore, saschanaz, steve.dower, tim.golden, zach.ware
Date 2021-09-03.07:53:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630655588.26.0.975262726386.issue45077@roundup.psfhosted.org>
In-reply-to
Content
See bpo-26903 for a similar problem in concurrent.futures.ProcessPoolExecutor. It was resolved by adding a limit constant, _MAX_WINDOWS_WORKERS == 61. 

WaitForMultipleObjects() can wait on up to 64 object handles, but in this case 3 slots are already taken. The pool wait includes two events for its output and change-notifier queues (named pipes), plus the _winapi module always reserves a slot for the SIGINT event, even though this event is only used by waits on the main thread.

To avoid the need to limit the pool size, connection._exhaustive_wait() could be modified to combine simultaneous waits on up to 63 threads, for which each thread exhaustively populates a list of up to 64 signaled objects. I wouldn't want to modify _winapi.WaitForMultipleObjects, but the exhaustive wait should still be implemented in C, probably in the _multiprocessing extension module. A benefit of implementing _exhaustive_wait() in C is lightweight thread creation, directly with CreateThread() and a relatively small stack commit size.
History
Date User Action Args
2021-09-03 07:53:08eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, saschanaz
2021-09-03 07:53:08eryksunsetmessageid: <1630655588.26.0.975262726386.issue45077@roundup.psfhosted.org>
2021-09-03 07:53:08eryksunlinkissue45077 messages
2021-09-03 07:53:08eryksuncreate