Skip to content

[FEATURE] Add workers and main thread shared memory data structure with set/get ops on key/value #771

@jerome-benoit

Description

@jerome-benoit

Message channel becomes a performance bottleneck under heavy messages rate. See #767.

Shared array buffer can act as a shared memory for worker-threads but is not friendly to manipulate.
Cluster worker does not offer a similar feature.

To implement it right, an encapsulation needs to be done exposing the same high-level API at the pool level:

class Shm {
    get(key)
    set(key, value)
    delete(key)
}

The set/get ops can be thread-safe or not (use atomics or mutex or semaphore), depending on the use case requirements
Pool expose a public property to access it
Task functions can import and use it to share structured-cloneable writable data?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions