Skip to main content

Module send_sync

Module send_sync 

Source
Expand description

Send and Sync bounds that relax on wasm with atomics.

The name follows wgpu_types::WasmNotSend, which exists for the same reason. A wgpu handle is Send + Sync on wasm only through fragile-send-sync-non-atomic-wasm, and that feature turns itself off once atomics are on. Anything holding a device or a queue stops being Send in the threaded web build.

Nothing is lost. One thread in a browser touches wgpu, and nothing is sent anywhere.

Traitsยง

WasmNotSendNot (WebAssembly and atomics)
Send, relaxed to nothing on wasm with atomics.
WasmNotSyncNot (WebAssembly and atomics)
Sync, relaxed to nothing on wasm with atomics.