Skip to content

Add option to wasi-libc to use busy-wait instead of memory.atomic.wait32 #5598

Open
@kateinoigakukun

Description

@kateinoigakukun

wasi-libc uses memory.atomic.wait32 in __wasilibc_futex_wait, which is called by several functions in wasi-libc including malloc, fwrite, and etc.

However, the use of memory.atomic.wait32 on the Web browser main thread (and also Audio Worklet) is prohibited. We need to do something Emscripten is doing in wasi-libc side.
https://github.com/emscripten-core/emscripten/blob/058a9fff/system/lib/pthread/emscripten_futex_wait.c#L111-L150

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions