Most round-robin schedulers use a fixed size quantum give


A] What happens when you run the following piece of code:

main(int argc, char ** argv)
{
for(;;)
fork();
}

[B] Given the following piece of code:

main(int argc, char ** argv)
{
int child = fork();
int c = 5;

if(child == 0)
{
c += 5;
}
else
{
child = fork();
c += 10;
if(child)
c += 5;
}
}

How many different copies of the variable c are there? What are their values?

[C] Given the following piece of code

main(int argc, char ** argv)
{
forkthem(5)
}

void forkthem(int n)
{
if(n > 0)
{
fork();
forkthem(n-1);
}
}

How many processes are created if the above piece of code is run?

[D] Most round-robin schedulers use a fixed size quantum. Give an argument in favor of and against a small quantum.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Most round-robin schedulers use a fixed size quantum give
Reference No:- TGS01248806

Now Priced at $40 (50% Discount)

Recommended (94%)

Rated (4.6/5)