2
$\begingroup$

when a new process is created using a fork() function, there is a cold start penalty, what is this and why does it happen?

$\endgroup$
  • 1
    $\begingroup$ Nice one. Where did this question come up, what have been topics lately? $\endgroup$ – greybeard Feb 25 '20 at 18:12
  • $\begingroup$ I was reading up on multi threading and wondered about using processes instead, my professor just told me that new processes have a cold start penalty but dint go into detail. $\endgroup$ – Reddy Gaurav Feb 25 '20 at 19:02
  • $\begingroup$ I see. Given fork()'s shared state approach, caches all over the memory hierarchy come to mind, starting with address translation. A common combinations seems to be virtually addressed L1 caches with physically addressed L2 (&up), lest it gets too easily comprehensible. $\endgroup$ – greybeard Feb 25 '20 at 19:22
1
$\begingroup$

"Cold start penalty" is the penalty for starting a process that has never run. The operating system has to read the code from disk, page tables have to be set up, caches filled in as instructions are executed/data fetched, and so on. If the process has run before, some of the above will already have been set up (and perhaps not fully evicted).

$\endgroup$
  • $\begingroup$ penalty for starting a process that has never run even rephrased as a program that has no traces of execution left in the non-permanent machine state, that would apply to a (fork-) exec. I take a fork to create a clone of a process, identical from the inside but for the process id returned by fork. And it does have a start penalty, different from that of another thread. And I think it debatable to use cold in this context. $\endgroup$ – greybeard Mar 1 '20 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.