classification
Title: Solaris thread_time doesn't work with current implementation
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, kulikjak
Priority: normal Keywords: patch

Created on 2018-12-10 14:32 by kulikjak, last changed 2020-04-08 18:38 by kulikjak.

Files
File name Uploaded Description Edit
thread_time.diff kulikjak, 2018-12-10 14:32 Possible patch
Pull Requests
URL Status Linked Edit
PR 11118 closed kulikjak, 2018-12-11 12:48
Messages (5)
msg331509 - (view) Author: Jakub Kulik (kulikjak) * Date: 2018-12-10 14:32
Implementation of time.thread_time() doesn't work on Solaris because clock_id CLOCK_THREAD_CPUTIME_ID is not known (it is defined, but clock_gettime returns EINVAL error). Solaris, however, has function gethrvtime() which can substitute this functionality.

I attached a possible patch which does work during tests and I further tested it with some basic scripts.
msg346027 - (view) Author: Jakub Kulik (kulikjak) * Date: 2019-06-19 08:16
Since I created this pull request, clock_gettime(CLOCK_THREAD_CPUTIME_ID, ..) was implemented into the Solaris kernel, so I guess that this is no longer relevant.
msg365635 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python triager) Date: 2020-04-02 22:06
This issue is still valid under other solaris/sunos versions. @kulikjak are you still interested in resolving this issue?
msg366000 - (view) Author: Jakub Kulik (kulikjak) * Date: 2020-04-08 18:33
I was speaking for Oracle Solaris 11.4, where CLOCK_THREAD_CPUTIME_ID is now implemented (and we don't need it in older releases). But you are right that other Solaris/SunOS versions might not have this and hence would find this useful.

I can rebase and reopen the original PR, but I cannot test it that well now that our Solaris doesn't use that part of the code (I can change the #define for testing, that should be sufficient).
msg366001 - (view) Author: Jakub Kulik (kulikjak) * Date: 2020-04-08 18:38
Correction: looking at the PR, I made it so that it checks for SunOS, so even with CLOCK_THREAD_CPUTIME_ID available, new code would be executed. 

So if you believe that this should be implemented for other SunOSes, I can do it ;).
History
Date User Action Args
2020-04-08 18:38:35kulikjaksetmessages: + msg366001
2020-04-08 18:33:07kulikjaksetmessages: + msg366000
2020-04-02 22:06:18BTaskayasetstatus: closed -> open
versions: + Python 3.9
nosy: + BTaskaya

messages: + msg365635

resolution: not a bug ->
2019-06-19 08:16:11kulikjaksetstatus: open -> closed
resolution: not a bug
messages: + msg346027

stage: patch review -> resolved
2018-12-11 15:40:15kulikjaksetversions: + Python 3.8
2018-12-11 12:48:31kulikjaksetstage: patch review
pull_requests: + pull_request10347
2018-12-11 10:22:59kulikjaksettype: crash
2018-12-10 14:32:21kulikjakcreate