Skip to content

support SharedArrayBuffers #82

@vapier

Description

@vapier

is there any reason to disallow SharedArrayBuffers ? I'm trying to use the APIs in a threaded program, and that requires the WASM module be backed by a SharedArrayBuffer. whenever it wants to send data using its locally allocated buffers, the calls fail:

TypeError: Failed to execute 'write' on 'WritableStreamDefaultWriter': Failed to read the 'data' property from 'UDPMessage': The provided ArrayBufferView value must not be shared.
    at WebUdpSocket.sendto (sockets.js:1792:39)
    at async Background.onMessage_syscall (process.js:320:13)
    at async Background.onMessage (process.js:303:9)

this means i have to create a temporary buffer, copy the shared array buffer into it, and pass that to the write stream. this is a bit inefficient as one can imagine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions