Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue31596

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:expose pthread_getcpuclockid in time module
Type:enhancementStage:resolved
Components:Extension ModulesVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: benjamin.peterson, pdox, vstinner
Priority:normalKeywords:

Created on2017-09-26 18:33 bypdox, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 3756mergedpdox,2017-09-26 18:33
PR 3904mergedbenjamin.peterson,2017-10-06 05:09
Messages (6)
msg303059 -(view)Author: (pdox)*Date: 2017-09-26 18:33
time.clock_gettime() makes it possible to retrieve the thread-specific cpu-time clock for the current thread using time.CLOCK_THREAD_CPUTIME_ID. However, it is currently not possible in Python to retrieve the thread-specific clock for other threads. Exposing pthread_getcpuclockid() makes this possible.
msg303743 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2017-10-05 07:01
New changesete14679c78464d1e0e16786c2a0e9bcebe49e842b by Benjamin Peterson (pdox) in branch 'master':closesbpo-31596: Add an interface for pthread_getcpuclockid(3) (#3756)https://github.com/python/cpython/commit/e14679c78464d1e0e16786c2a0e9bcebe49e842b
msg303769 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2017-10-05 13:57
The test is too strict, it fails on many buildbots.Four examples:http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/1008/steps/test/logs/stdio======================================================================FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)----------------------------------------------------------------------Traceback (most recent call last):  File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_time.py", line 100, in test_pthread_getcpuclockid    self.assertLessEqual(t2, t3)AssertionError: 16.309616 not less than or equal to 16.309358http://buildbot.python.org/all/builders/s390x%20Debian%203.x/builds/1466/steps/test/logs/stdio======================================================================FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)----------------------------------------------------------------------Traceback (most recent call last):  File "/home/dje/cpython-buildarea/3.x.edelsohn-debian-z/build/Lib/test/test_time.py", line 99, in test_pthread_getcpuclockid    self.assertLessEqual(t1, t2)AssertionError: 0.938456056 not less than or equal to 0.8324859600000001http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Non-Debug%203.x/builds/999/steps/test/logs/stdio======================================================================FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)----------------------------------------------------------------------Traceback (most recent call last):  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current.nondebug/build/Lib/test/test_time.py", line 100, in test_pthread_getcpuclockid    self.assertLessEqual(t2, t3)AssertionError: 0.813547 not less than or equal to 0.81335http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.x/builds/996/steps/test/logs/stdio======================================================================FAIL: test_pthread_getcpuclockid (test.test_time.TimeTestCase)----------------------------------------------------------------------Traceback (most recent call last):  File "/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_time.py", line 100, in test_pthread_getcpuclockid    self.assertLessEqual(t2, t3)AssertionError: 1.121773 not less than or equal to 1.121547
msg303781 -(view)Author: (pdox)*Date: 2017-10-05 19:01
This looks specific to FreeBSD and s390x. Those platforms might not provide the same cpu-time clock consistency guarantees as Linux+glibc+x86. Would it be ok to just disable the ordering check for those systems?
msg303800 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2017-10-06 05:50
New changeset86566702f311f8e90600e85350f6b6769a384ea5 by Benjamin Peterson in branch 'master':weaken pthread_getcpuclockid test (morebpo-31596) (#3904)https://github.com/python/cpython/commit/86566702f311f8e90600e85350f6b6769a384ea5
msg303809 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2017-10-06 09:03
Thank you Benjamin, buildots are back to green :-)I prefer the new unit test which only tests pthread_getcpuclockid() clock and not make any assumption on the link between this clock and CLOCK_THREAD_CPUTIME_ID.
History
DateUserActionArgs
2022-04-11 14:58:52adminsetgithub: 75777
2017-10-06 09:03:39vstinnersetmessages: +msg303809
2017-10-06 05:50:44benjamin.petersonsetmessages: +msg303800
2017-10-06 05:09:37benjamin.petersonsetpull_requests: +pull_request3875
2017-10-05 19:01:44pdoxsetmessages: +msg303781
2017-10-05 13:57:02vstinnersetnosy: +vstinner
messages: +msg303769
2017-10-05 07:01:58benjamin.petersonsetstatus: open -> closed

nosy: +benjamin.peterson
messages: +msg303743

resolution: fixed
stage: resolved
2017-09-26 18:33:14pdoxcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp