Skip to content

Use clock_gettime() in pytime.c #66483

Closed
Closed

Description

@vstinner
BPO 22287
Nosy @loewis, @vstinner
Files
  • clock_gettime.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2014-08-29.13:43:07.139>
    created_at = <Date 2014-08-27.10:51:55.235>
    labels = []
    title = 'Use clock_gettime() in pytime.c'
    updated_at = <Date 2014-08-29.13:43:07.138>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2014-08-29.13:43:07.138>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-08-29.13:43:07.139>
    closer = 'vstinner'
    components = []
    creation = <Date 2014-08-27.10:51:55.235>
    creator = 'vstinner'
    dependencies = []
    files = ['36485']
    hgrepos = []
    issue_num = 22287
    keywords = ['patch']
    message_count = 2.0
    messages = ['225967', '226062']
    nosy_count = 4.0
    nosy_names = ['loewis', 'vstinner', 'neologix', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue22287'
    versions = ['Python 3.5']

    Activity

    1. vstinner commented on Aug 27, 2014

      @vstinner
      MemberAuthor

      On UNIX, time.time() currently uses clock_gettime(), but _PyTime_gettimeofday() doesn't becauce pytime.c lacks a dependency on the librt module (needed on some platforms).

      Attached patch adds the dependency if needed and modify _PyTime_gettimeofday() to use clock_gettime() if available.

      The patch alone is not very useful. I wrote it to prepare the work for the issue bpo-22043 (use a monotonic clock in Python modules written in C).

      With the patch, Python depends on the librt on Solaris and on Linux with glibc older than 2.17 (clock_gettime is now available directly in the libc since glibc 2.17).

    2. python-dev commented on Aug 29, 2014

      python-devmannequin
      Mannequin

      New changeset 8e13ad4e5ae6 by Victor Stinner in branch 'default':
      Issue bpo-22287: On UNIX, _PyTime_gettimeofday() now uses
      http://hg.python.org/cpython/rev/8e13ad4e5ae6

    3. transferred this issue fromon Apr 10, 2022
    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

      No labels
      No labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions