[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

STINNER Victor report at bugs.python.org
Fri Dec 14 06:48:02 EST 2018


STINNER Victor <vstinner at redhat.com> added the comment:

> How do you use SIGCHLD on Windows?

I'm only proposing to use a signal when it's available, on UNIX. So have multiple implementations of the function, depending on the ability to get notified on completion without polling.

On Windows, maybe we could use a dedicated thread to set an event once WaitForSingleObject/WaitForMultipleObjects completes?

The design of my bpo-35479 change is to replace polling with one or multiple events. Maybe we can use an event to wakeup _worker_handler() when something happens, but have different wants to signal this event.

I have to investigate how Process.sentinel can be used here.

I might be interesting to use asyncio internally, but I'm not sure if it's possible ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35493>
_______________________________________


More information about the Python-bugs-list mailing list