Skip to content

[wasm] Use monotonic clock in wasm, emscripten has it now #85660

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

Merged
merged 3 commits into from
May 3, 2023

Conversation

kg
Copy link
Member

@kg kg commented May 2, 2023

emscripten added monotonic clock support (albeit not coarse support, despite the symbol existing) at least a year ago, possibly longer. So we can use our common monotonic clock/gettime path on wasm as well, which might fix #85473 (I can't reproduce it locally).

@kg kg added the arch-wasm WebAssembly architecture label May 2, 2023
@kg kg requested review from vargaz and lambdageek as code owners May 2, 2023 17:12
@ghost ghost added the area-VM-meta-mono label May 2, 2023
@ghost ghost assigned kg May 2, 2023
@ghost
Copy link

ghost commented May 2, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

emscripten added monotonic clock support (albeit not coarse support, despite the symbol existing) at least a year ago, possibly longer. So we can use our common monotonic clock/gettime path on wasm as well, which might fix #85473 (I can't reproduce it locally).

Author: kg
Assignees: -
Labels:

arch-wasm

Milestone: -

Copy link
Member

@lambdageek lambdageek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also change

#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASM)
#define BROKEN_CLOCK_SOURCE
#endif

@kg
Copy link
Member Author

kg commented May 3, 2023

Please also change

#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASM)
#define BROKEN_CLOCK_SOURCE
#endif

any idea why this caused /__w/1/s/artifacts/bin/mono/wasi.wasm.Release/libmonosgen-2.0.a(os-event-unix.c.obj): undefined symbol: pthread_condattr_init?

@kg kg merged commit bc9dad2 into dotnet:main May 3, 2023
ilonatommy added a commit that referenced this pull request May 5, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scheduled tasks stop working after 2023.04.14 1:41:36 UTC
3 participants