Nice. And I like "dumb" examples, they let you focus on the principle that's being communicated. Question, how does the OS (linux, Windows) determine what core to run the forked process in ? Is the forked process guaranteed to run in a different core (assuming a muli core CPU)?
@Cat_Stevens7 жыл бұрын
It differs a lot between operating systems, because of course task scheduling is the job of the kernel. For Linux, take a look at stackoverflow.com/q/23259881/4532996. On Windows, it's much harder to know, because of course it's closed source, but the most cache friendly decision is usually chosen in both cases. However, on Windows, Darwin (Mac OS X's BSD-like kernel), and Linux, the chance to be moved to a new CPU core is affected by the parent process's "nice" status (see en.wikipedia.org/wiki/Nice_(Unix) and en.wikipedia.org/wiki/Processor_affinity )
@mdesm20057 жыл бұрын
thank you :)
@redberries80396 жыл бұрын
It doesn't matter if you're the original or the clone ...what matters is who grabs the bank account first, the wife can wait ..she will follow the money