10 ms·
Indeed. Those two lines in the test-case are particularly excellent: /* 64 processes */ fork(); fork(); fork(); fork(); fork(); fork(); I can totally see
by kees99 7y ago
Indeed. Those two lines in the test-case are particularly excellent:
/* 64 processes */
fork(); fork(); fork(); fork(); fork(); fork();
I can totally see most people, myself included, writing a dozen of lines instead, with a for loop, checking for parent/child/error return code, etc. Which might be preferable for some code somewhere deep inside the app logic that will potentially run on a resource-constrained machine. But for the explanation code to be read by a human, this one-liner is such a good choice!