-
Notifications
You must be signed in to change notification settings - Fork 12
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Attempting to use roaring from worker_thread throws "Module did not self register" #47
Comments
Thank you for reporting this, yes, I never tried this in a worker thread nor wrote test for it. I am going to write some test code and can work on a fix somewhere in the next 1, 2 weeks |
Ok yes is a bit more complicated than just setting the module to be context aware, I will need to fix some code that would not work in multiple isolates but is doable |
Released v1.5.2 that fixes the module initialization to be compatible with worker threads and make the code work with multiple isolates - worker threads are going to work only if node is >= 13 (node 14 is the LTS version) Please give it a go and let me know. |
Early results: seems to be working well for me in multiple worker_threads - thank you so much! 💯 |
I'm trying to spin up worker threads (https://nodejs.org/api/worker_threads.html) to take advantage of multiple cpu cores in a project that makes heavy use of roaring, but I get this error:
Apparently this is to do with native add-ons having to be aware that they might be used from worker threads, and for many modules the fix is relatively simple: nodejs/node#21783 (comment)
Documentation for context-aware addons and some worker_thread specific stuff about cleaning up resources here:
https://github.com/nodejs/node/blob/main/doc/api/addons.md#context-aware-addons
I will try to fork and PR but I have not done any native before, so I'm not massively confident of success ...
The text was updated successfully, but these errors were encountered: