Hi Robyx,
The JavaScript runtime does not provide resources to implement parallel operations. Most native procedures available in PJSR are implemented as parallel processes. For example, when you run something like this:
let image = new Image;
...
image.convolve( Matrix.gaussianFilterBySize( 25 ) );
The Image.convolve method is executed using all logical processors available. There are hundreds of native methods implemented this way. However, there is no way to define a parallel process using pure JavaScript code.
For the types of tasks you are performing, you should use our C++ development platform instead of JavaScript. Take a look at our PixInsight Class Library:
https://gitlab.com/pixinsight/PCLhttps://pixinsight.com/developer/pcl/doc/html/