-
Notifications
You must be signed in to change notification settings - Fork 5
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
Why does Node.js not provide something like SharedObjectBuffers out of the box? #131
Comments
Thanks for the warm words @hjerabek! Regarding your question, I can't speak for Node.js or browser vendors, but i will share my thoughts Node.js maintainers and contributes are open source people and enthusiastic like us. The second part is, while I think objectbuffer is cool and works when the user knows the domain, I even not sure how the final public API should look like 😅 That said, I'm still improving it, next phase is probably going to be a more minimal, inline-able allocator that i hope will allow me to also improve other things |
Just weighing in as somebody who did a lot of the Worker implementation in Node.js core – we’re really careful about bringing in features that can also be implemented in JS on top of the Node.js core APIs. Usually, packages published to npm have a bunch of advantages compared to built-in features:
That being said, I think for this kind of feature, one could aim for a long-term solution in which the language itself would specify how to share objects between threads, on-heap, with no serialization or deserialization at all (not even reading/writing strings from buffers or similar conversions). That would be a language-level concern, and not one for Node.js, though. |
Thank you for your replies. @Bnaya: @addaleax: |
Worth noting: |
First, I want to thank @Bnaya very much for creating and sharing this great library, and for putting in the effort to maintain it. Keep up the great work!
My main question is why projects like Node.js do not provide a solution like this out of the box. IMO, any application that requires sharing large objects between worker threads benefits from not having to permanently serialize and deserialize the objects. Yet, this
objectbuffer
is the only solution I could find that comes close to what I would consider a properSharedObjectBuffer
implementation. Can anybody give me a reason for this? A frequent "excuse" to not implementSharedObjectBuffers
are potential race conditions, but, as this project shows, this can be solved with locks...The text was updated successfully, but these errors were encountered: