Skip to content

Can audio worklets pre-emptively interact with the main thread? #24213

Open
@sbc100

Description

@sbc100

We now have at least one test that assumes that the main thread can be interacted with via SAB with spinlocks: test/webaudio/audioworklet_emscripten_locks.c.

However there seem to be issues with it. See #24212 for example.

The larger question is: Is this kind of main-thread-interaction valid.

It practice that audio worklet is likely running on its own thread, but the spec says that might not always be the case: See https://html.spec.whatwg.org/multipage/worklets.html#worklets-motivations and note "Are thread-agnostic. That is, they are not designed to run on a dedicated separate thread, like each worker is. Implementations can run worklets wherever they choose (including on the main thread)."

Should we remove this test (and the ability to using these spin locks within worklets)?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions