Skip to content

chore(📚): document the threading contract once - #570

Merged
wcandillon merged 3 commits into
mainfrom
docs-threading-contract
Oct 17, 2026
Merged

wcandillon merged 3 commits into
mainfrom
docs-threading-contract

Conversation

@wcandillon

Copy link
Copy Markdown
Owner

Implicit device synchronization was explained three times (Native APIs, Worklets, Native Extensions), each with Dawn's feature doc, the per-device mutex and, on the Worklets page, Dawn's "heavy-handed / may deadlock" remark.

The reader-facing contract is short, so it now lives once in Worklets → Thread safety:

  • a device created on the JS thread can be used from worklets;
  • never share a command encoder across threads;
  • drive each canvas context from a single runtime;
  • the implicitDeviceSynchronization: false opt-out, linked to the API reference.

Native APIs → Threading model keeps the overview, the installWebGPU() snippet (which was orphaned after the synchronization section) and the device.lost callout, and links to the contract. The Native Extensions entry keeps the flag and the requiredFeatures note, without the mutex internals.

@wcandillon
wcandillon merged commit 8b80382 into main Oct 17, 2026
1 check failed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant