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

Worker Threads: segmentation fault #1297

Closed
TheRadioGuy opened this issue Jul 16, 2018 · 3 comments
Closed

Worker Threads: segmentation fault #1297

TheRadioGuy opened this issue Jul 16, 2018 · 3 comments
Labels

Comments

@TheRadioGuy
Copy link

TheRadioGuy commented Jul 16, 2018

Hello.

My Code

I run this code in Worker Threads.

Arch linux, node 10.5.0, latest sharp

@lovell
Copy link
Owner

lovell commented Jul 16, 2018

https://nodejs.org/api/worker_threads.html#worker_threads_class_worker says:

"Native addons are not supported yet."

Worker threads are designed for CPU-intensive JavaScript so would be unlikely to help sharp/libvips, which is compiled C/C++, makes effective use of CPUs and is typically I/O bound.

http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency provides details of the concurrency and parallelism options available.

@lovell lovell changed the title Segmentation fault Worker Threads: segmentation fault Jul 16, 2018
@TheRadioGuy
Copy link
Author

So, sharp dont block event loop?

@lovell
Copy link
Owner

lovell commented Jul 17, 2018

That's correct, all image processing already occurs on threads from the the libuv pool (plus threads spawned by libvips) - see http://sharp.pixelplumbing.com/en/stable/#fast

"Everything remains non-blocking thanks to libuv, no child processes are spawned and Promises/async/await are supported."

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

No branches or pull requests

2 participants