-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
Solaris: thread_time doesn't work with current implementation #79636
Comments
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. |
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. |
This issue is still valid under other solaris/sunos versions. @kulikjak are you still interested in resolving this issue? |
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). |
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 ;). |
Comment from https://bugs.python.org/issue42173#msg380205 confirmed that this issue is still relevant to Illumos based systems. Because of that, I am happy to resolve it. |
Perhaps we should also use gethrtime() and gethrvtime() on HP-UX, but this is a different issue. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: