Skip to content

Does NodeJS have any plans for shared memory? #560

Closed
@hitsthings

Description

@hitsthings

So this API is being added to JS that allows different execution contexts to share a chunk of memory safely with interleaved access.
Meanwhile the Web Worker spec already exists for creating these separate execution contexts.

I know there are pre-existing user space modules for web-worker implementations. But they either 1) use separate processes for each thread (and thus can't really share memory well), or 2) they literally expose all memory to all threads and thus accept all the chaos that other multithreaded languages often have.

Combined, the Web Worker and Shared Memory APIs seem like a solid infrastructure to build multithreading on. There would be no bad interaction with old code since the old code would have to opt in to using the shared buffer (or a bad dev would have to pass a shared buffer to the old code and then write to it). Is there any plan for making use of shared memory and web workers in Node?

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