Question: int exam _ grade ( int m 1 , int m 2 , int m 3 ) { int exam _ sum; exam _ sum
int examgrade int m int m int m
int examsum;
examsum mmm;
return examsum;
Event: user runs the program, the process is in state Q
main
Event: when scheduler chooses this program to run, the process is in state Q and in mode Q
for i; i; i
scanf d d d &t &t &t;
Event: IO statement, the process is in state Q
Before state transition, switch to mode Qto handle scanf.
Q in the multiprogramming environment, will the OS switch to execute another process? Yes No
Event: IO is done, IO device sends an interrupt. Interrupt makes the current running process stops temporarily. CPU switches to interrupt handler and this process is put to stateQ CPU continues to execute the original running process we are assuming nonpreemptive scheduling is used
Event: scheduled to run This process runs. There is a context switch
scanf d d d &P &P &P;
scanf d d d &m &m &m;
scanf d d d d &h &h &h &h;
Event: IO statement, the process is in state Q
Event: IO completion, the process is in state Q
Event: scheduled to run running context switch
Projecttotal PPP;
Homeworktotal hhhh;
Examtotal examgradem m m;
Event: procedure call, the process is in state Q and
the program is in mode Q
totaltttProjecttotal Homeworktotal Examtotal;
Event: interrupted due to time quantum expiration, the state of the process will be changed from state Q to state Q before the transition, the CPU will handle the timeout and switch to execute another process context switch
Event: scheduled to run, the state of process will be changed from state Q to state Qcontext switch
total scalethegradeProjecttotal, Homeworktotal, m m m;
if total total total total;
else total total;
Event: IO device interrupts to signal the completion of an IO of a different process
Switch to mode Q to run interrupt handler context switch the current process is in state Q
Switch back to run this process in modeQ
if extra final total;
else final float Bonustotal extra;
printf f final;
scanf c &ch; printf
;
fork ;
Event: system call
Kernel trap, switch to kernel mode to handle fork context switch
OS creates the child process, put it in queue Q
Fill the answers into the following table. Please utilize the following options for process states: 'ready, 'running, and 'waiting. When referring to mode, choose between 'user mode' and 'kernel mode. For events, consider using terms such as "interrupt," 'CPU scheduled,IO request,IO completion, 'system call, etc.
Q Q Q Q Q Q Q Q Q Q
Q Q Q Q Q Q Q Q Q
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
