问题
I want to compute the size of folder (i used readdirp module). For large folder the operation blocks my main thread so my electron application hangs.
So i moved size computation process to forked child.
since i have array of folders, i looping and forking new child process, on every iteration.
These child Nodes are still whole new instances of V8. Assume at least 30ms startup and 10mb memory for each new Node. That is, you cannot create many thousands of them. I have studied somewhere.
- so how to manage this forking process ?
NOTE : After completion of computation in child, i sended the result details to parent using IPC (process.send)
Can i able to make use of cluster module for this operation, if that how ?.
来源:https://stackoverflow.com/questions/56946574/child-process-maximum-limit