-
Notifications
You must be signed in to change notification settings - Fork 73
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
Not working with Worker thread. #97
Comments
You have a code snippet demonstrating the issue? |
main:
worker.js:
errormsg:
Today on first run it gave that msg. Before and after it was throwing segmentation fault. |
Seems one would need to litter the cpp code with multithreading protection to support workers. Could you share why you want to use a worker? The whole node idea is to eleminate multithreading complexity by offering an event driven infrastructure and non-blocking async io. The thread pools node uses for that are hidden under the hood. |
Nothing specific. I wanted to put can logic in separate worker, no good reason, just force of habit I guess. Btw great job with this(node-can), its quite useful. Ty ! |
These flowers go straight to @sebi2k1 💐. I have a direct comparison implementing stuff with node in one instance and C# and its TPL in another. I really appreciate the simplicity that the event driven approach provides for IO heavy use cases. Your feedback regarding workers is definitely a limitation to keep in mind. If someone is interested in making himself familiar with thread safety mechanisms of V8, it could be a nice little project to implement support. But I have used node-can quite extensively in a busy embedded system and I never felt lonely without the thread safety 😃. |
If "onMessage" listener is called inside worker thread "Segmentation fault (core dumped) " occurs upon received can msg.
The text was updated successfully, but these errors were encountered: