Sharp: Worker Threads: segmentation fault

Created on 16 Jul 2018  路  3Comments  路  Source: lovell/sharp

Hello.

My Code

I run this code in Worker Threads.

Arch linux, node 10.5.0, latest sharp

question

Most helpful comment

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."

All 3 comments

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.

So, sharp dont block event loop?

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."

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhump picture zhump  路  3Comments

kachurovskiy picture kachurovskiy  路  3Comments

emmtte picture emmtte  路  3Comments

AVVS picture AVVS  路  3Comments

vermin1337 picture vermin1337  路  3Comments