Skip to content

select.poll.poll should use ppoll when it's available #142434

Closed

Description

@SpecLad

Feature or enhancement

Proposal:

ppoll is an extended version of poll that lets you set the timeout with nanosecond precision (it also supports setting a signal mask, but that's not important right now). It's available on Linux, FreeBSD, OpenBSD, NetBSD, and probably other Unix-likes.

It would be useful if the Python poll function would transparently use ppoll on systems where it is available to provide timeouts with nanosecond precision (as opposed to the default millisecond precision).

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. serhiy-storchaka commented on Dec 9, 2025

    @serhiy-storchaka
    Member

    Looks reasonable. Do you want to provide a PR, @SpecLad?

  2. vstinner commented on Dec 9, 2025

    @vstinner
    Member

    I'm interested to work on this issue if @SpecLad doesn't want to write a pull request.

  3. SpecLad commented on Dec 9, 2025

    @SpecLad
    ContributorAuthor

    I'd give it a try, but I don't know yet when I'll get around to it, so feel free to preempt me. 🙂

  4. added a commit that references this issue on Jan 7, 2026
  5. vstinner commented on Jan 7, 2026

    @vstinner
    Member

    I created #143529 to use ppoll() is available.

  6. added a commit that references this issue on Jan 15, 2026
  7. vstinner commented on Jan 15, 2026

    @vstinner
    Member

    Feature implemented in #143529.

  8. added a commit that references this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions