Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clock_gettime() in pytime.c #66483

Closed
vstinner opened this issue Aug 27, 2014 · 2 comments
Closed

Use clock_gettime() in pytime.c #66483

vstinner opened this issue Aug 27, 2014 · 2 comments

Comments

@vstinner
Copy link
Member

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']

    @vstinner
    Copy link
    Member Author

    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).

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 29, 2014

    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

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant