Question: 1 . a ) Define single programming and mul programming . b ) Describe a scenario where mul programming might be be er than single
a Define single programming and mulprogramming
b Describe a scenario where mulprogramming might be beer than single programming. Note: You may use the internet to research any applicaons or describe an example from your personal experience.
Suppose P P P and P are ready to run in this order P executes for me units, P executes for me units, P executes for me units, and P executes for me units. Neither process invokes IO Assuming that a mer interrupt occurs every me unit, fill in the table:
Time in units
Running
Queue of Processes Ready to Run
e
P
P P P
e
e
e
e
e
e
e
e
e
e
e
e
Suppose P P P P are in this order in the Ready Queue, and that the following sequence of events occurs:
Time : P invokes write
Time : P invokes write
Time : P invokes read
Time : Interrupt Ps write complete Time : Interrupt Ps read complete Time : P terminates
Time : P terminates
There is no noon of a me slice and a process yields to another process only when it invokes an IO operaon readwrite or terminates.
Time
Running
Ready
Blocked
e
e
e
e
e
e
e
e
e
A Explain the fork funcon and the return values for the fork funcon B What is the output of the following code:
intx;
int main
pidt ret;
ret fork; ifret
prinparent: x d
x ;
else
princhild: x d
x ;
Note: Explaining your thought process will get you paral credit in case the answer is incorrect.
Draw a process tree for the following code: void parentchildfork
prinL
; fork; prinL
; fork; prinL
; fork; prinBye
;
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
