Ok, I did this example on JSfiddle to emulate (really bad work), my dilemma: https://jsfiddle.net/Dillybob/7zkL097q/2/
In the cluster module for nodejs, I want to use my child workers (processing power) as much as possible to help run my setInterval MonsterLoop faster and faster. In my example above, if I ran this code inside my cluster's isWorker , it would run 6 times per second.
Does this seem inconsistent and looks like it will use more processing power? And since I manipulate this object during the loop, I'm sure that someday another process will hold it, will there be data that becomes undefined? It seems that 6 times per second is simply not the right way, but only once.
So I try differently. Instead, I inserted this loop inside the isMaster block. Thus, it receives only once every second, but uses only 1 core. Is it possible that this cycle was run once, but to seize power from subsidiary processes to make it work faster?
Nick newman
source share