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

gh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI #115757

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

encukou
Copy link
Member

@encukou encukou commented Feb 21, 2024

Either the results of these functions are too large, or sysconf(_SC_CLK_TCK) (_Py_GetTicksPerSecond) is too small.

wasi-libc is considering removing process time locks entirely: WebAssembly/wasi-libc#266

This removes them from Python's time early. time.process_time() falls back to clock():

>>> import time
>>> time.time(); time.process_time()
1708512528.3618634
14.538878902
>>> time.time(); time.process_time()
1708512529.045383
15.222434329
>>> time.get_clock_info('process_time')
namespace(implementation='clock()', monotonic=True, adjustable=False, resolution=1e-09)

@encukou encukou merged commit 8aa372e into python:main Feb 22, 2024
35 checks passed
@encukou encukou deleted the wasi-no-process-time branch February 22, 2024 11:39
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…SI (pythonGH-115757)

* pythongh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI

* Add blurb
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…SI (pythonGH-115757)

* pythongh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI

* Add blurb
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

Successfully merging this pull request may close these issues.

2 participants