PidfdChildWatcher based on pidfd_open is the best child watcher implementation for Linux as it avoids race conditions and is most reliable of all of them. It requires Linux 5.3+ so this will be detected at runtime if it can be used and if so use this instead of ThreadedChildWatcher. asyncio will favor using PidfdChildWatcher over ThreadedChildWatcher in 3.12+ on systems which supports it.