Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share JS Object in memory amongst different threads #110

Open
jfoclpf opened this issue Nov 23, 2022 · 1 comment
Open

Share JS Object in memory amongst different threads #110

jfoclpf opened this issue Nov 23, 2022 · 1 comment

Comments

@jfoclpf
Copy link

jfoclpf commented Nov 23, 2022

Any hint on how to share a big JS Object in memory amongst different threads/workers?

I have a huge JS Object and each worker is reading from said Object to later perform CPU intensive task.

I can't find any solution in NodeJS, because any multi-thread NPM solution around seems to clone the worker function parameters.

@lakshmanpasala
Copy link

SharedArrayBuffer should allow you to read and write to the same object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants