Question: Question 2 - Context Switch ( 2 2 points ) ( This question is related to ILO 2 - explain the principles behind the core
Question Context Switch points
This question is related to ILO "explain the principles behind the core function: Process Management",
and ILO "demonstrate knowledge in applying system software and tools".
Consider a singlecore computer with only user processes P and P The OS employs a
prioritybased scheduling policy and selects the process of the highest priority to run whenever it
has a chance to schedule. P has a higher priority than P Assume P is currently running and P
is in the ready queue. Further assume the machine doesn't have a timer device for timer interrupts
and all the system calls are successful. Answer the following questions.
Consider that P makes a system call to read a file from the disk. Describe the major OS
behaviors from when the system call is made to the time when the call completes and returns.
Write down the key events eg mode switches, context switches, etc as bullet points.
Assume P is a process with the following pseudo code. When P is scheduled to run, what
would be the possible resulting values of x upon the completion of P Please explain your
answer.
int x ;
void funcvoid
for int k ; k ; k
x;
int main
x;
int pid fork;
func;
return ;
Following and given the above settings, do you think P would run to completion without
being descheduled once it starts executing on the CPU ie the first time it is scheduled
Why or why not?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
