It seems you are using `process.env.cmd` to detect the condition when at least `2*SIZE` forks happened. Am I guessing correctly that `process.env.cmd = 'EXIT'` is also telling the child process what it should do?

To make the code easier to understand, it would be better to have two variables - one for telling the child process what to do, and another for tracking the state of the system.