Skip to content

[Linux, macOS, BSD] speedup Process.wait() #2705

@giampaolo

Description

@giampaolo

Summary

  • OS: Linux, macOS, BSD
  • Type: core

Description

See #2703 (comment).

Process.wait() implementation uses a busy loop with small sleeps, see: https://github.com/giampaolo/psutil/blob/77cfb0c6/psutil/_psposix.py#L61-L154

On Linux, this can be made more efficient by using pidfd_open() and passing the FD to a multiplexor like select(), poll() or epoll().

On BSD and macOS we can use kqueue().

EDIT: this change has been proposed for inclusion into cPython: python/cpython#144047.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions