MST Solution
Solution Q1. (a): -
2 marks for process state diagram
1 mark for transition arrows for short-, medium-, and long-term schedulers
Solution Q1. (b) :-
A “deadlock” occurs in a system when two or more processes are unable to proceed because each
is waiting for the other to release a resource. As a result, the processes are stuck in a permanent
waiting state, and no progress is made.
Deadlock Characteristics
For a deadlock to occur, four conditions must hold simultaneously. These are often called the
Coffman conditions, named after the computer scientist Edward G. Coffman, who identified them:
1. Mutual Exclusion:
At least one resource must be held in a non-shareable mode. This means that only one
process can use the resource at any given time. If another process requests that resource, it
must wait until the resource is released.
2. Hold and Wait:
A process is holding at least one resource and is waiting to acquire additional resources
that are currently being held by other processes.
3. No Preemption:
Resources cannot be forcibly taken away from the processes holding them. A process
must voluntarily release the resource once it has completed its task.
4. Circular Wait:
A set of processes are waiting on each other in a circular chain, where each process holds
a resource that the next process in the chain requires. For example, process A is waiting for
a resource held by process B, process B is waiting for a resource held by process C, and
process C is waiting for a resource held by process A.
When all four of these conditions are present, a deadlock situation arises.
0.5 mark for each necessary condition
Solution Q2 (a):-
Marking Scheme: Inter-process communication models (Message passing (0.5 (theory) +0.5
(Diagram), Shared memory (0.5 (theory) +0.5 (Diagram))
Direct and Indirect message passing (0.5+0.5 mark)
Solution Q2 (b):-
Marking Scheme: Process management (0.5+0.5) File management (0.5+0.5)
Solution Q3:-
Process Arrival Time Burst Time
P1 2 10/8/7/4/2/0
P2 3 8/6/5/3/2/0
P3 7 12/10/9/7/3/0
P4 12 9/7/5/3/1
P5 8 8/6/5/3/0
Wait Time Table:
T 4 6 7 9 11 12 14 17 18 20 21 23 25 27 28 28 30 34 37 39 40 41 43 46 49
P1 0 2 2 4 6 7 9 0 1 3 4 6 8 10 11 0 2 6 9 11 0 0 2
P2 1 0 1 3 5 5 7 10 11 0 1 3 5 7 7 7
P3 0 2 3 5 8 8 10 11 0 2 4 5 5 7 0 3 5 6 7 9 1
P4 0 3 4 6 7 9 11 0 1 1 3 7 10 10 11 1 0
P5 1 0 1 3 6 7 9 9 11 0 2 3 3 5 9
RR: 2MS
P1 P2 P3 P5 P4 P2 P3 P5 P4 P1 P4
18 21 23 25 39 40 RR: 4MS
P1 P2 P1 P3 P5 P2 P4 P3 P2 P5 P3 P5 P4 P1 P4 P1 P4 P3
28 45 SRTF
P1 P3
Gantt Chart:
2 marks 2 marks
Wait time of a process = Exit Time – Arrival Time – Burst Time
Waiting Time of P1: 45-2-10 = 33
Waiting Time of P2: 30-3-8 = 19
Waiting Time of P3: 49-7-12 = 30
Waiting Time of P4: 46-12-9 = 25
Waiting Time of P5: 37-8-8 = 21
A.W.T = (33+19+30+25+21)/5 = 25.6ms 1 mark
Solution Q4 (a) :-
Solution Q4 (b) :-
Solution Q5:-
Marking Scheme:
5(a) (“OS Mid Semester count” 1.5 mark+ “2024 count” 1.5 mark) with diagram else zero marks
5(b) (“OS Mid Semester count” 1 mark+ “2024 count” 1 mark) with diagram else zero marks
Solution Q6 (a):
Solution Q6 b:-