classification
Title: Use clock_gettime() in pytime.c
Type: Stage:
Components: Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: loewis, neologix, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2014-08-27 10:51 by vstinner, last changed 2014-08-29 13:43 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
clock_gettime.patch vstinner, 2014-08-27 10:51 review
Messages (2)
msg225967 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-08-27 10:51
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 #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).
msg226062 - (view) Author: Roundup Robot (python-dev) Date: 2014-08-29 13:42
New changeset 8e13ad4e5ae6 by Victor Stinner in branch 'default':
Issue #22287: On UNIX, _PyTime_gettimeofday() now uses
http://hg.python.org/cpython/rev/8e13ad4e5ae6
History
Date User Action Args
2014-08-29 13:43:07vstinnersetstatus: open -> closed
resolution: fixed
2014-08-29 13:42:45python-devsetnosy: + python-dev
messages: + msg226062
2014-08-27 10:51:55vstinnercreate