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

@u4/opencv4nodejs cannot be used in worker threads #140

Open
mf-mitchelrydzynski opened this issue May 7, 2024 · 0 comments
Open

@u4/opencv4nodejs cannot be used in worker threads #140

mf-mitchelrydzynski opened this issue May 7, 2024 · 0 comments

Comments

@mf-mitchelrydzynski
Copy link

Environment

  • opencv4nodejs: 6.5.2
  • openvc: 4.9.0
  • nodejs: 18.16.1
  • macos: sonoma 14.4.1

Description of Issue

I'm attempting to offload image processing to workers using the native worker_threads library. The first time my application starts up a worker, runs the computation, and cleans up the worker, things work great. However, the second attempt to do so causes my whole app to crash silently. I noticed that commenting out any imports of @u4/opencv4nodejs in the worker files allows them to start and terminate as often as I like without issue. Upon investigating, I found the below resources related to context aware c++ addons.

Additional Resources

Given the computationally intensive nature of image processing, supporting workers in order to not block the main thread seems like it should be a requirement for this library. Creating a long running subprocess is not an option for me due to memory constraints. Happy to provide any more info/help land on a solution. Thanks!

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

1 participant