New submission from Thomas Moreau <thomas.moreau.2...@gmail.com>:

The current implementation of the semaphore_tracker creates a new process for 
each children.

The easy fix would be to pass the _pid to the children but the current 
mechanism to check if the semaphore_tracker is alive relies on waitpid which 
cannot be used in child processes (the semaphore_tracker is only a sibling of 
these processes). The main issue is to have a reliable check that either:

    The pipe is open. This is what is done here by sending a message. I don't 
know if there is a more efficient way to check it.
    Check that a given pid is alive. As we cannot rely on waitpid, I don't see 
an efficient mechanism.

I propose to add a PROBE command in the semaphore tracker. When the pipe is 
closed, the send command will fail, meaning that the semaphore tracker is down.

----------
components: Library (Lib)
messages: 340543
nosy: tomMoral
priority: normal
severity: normal
status: open
title: semaphore_tracker is not reused by child processes
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36668>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to