VIT
teflore tnstitute of fechnolo)
School of Information Technology and Engineering
Winter Semester 2022-2023
Continuous Assessment Test - II
Programme Name & Branch : [Link] (SE)
Course Name & code: Operating Systems - SWE3001
Class Number (s): VL202223050 1916 Slot: F1+TFI
Tripathy
Faculty Name (s): Prof. ArivuSelvan.K, Prof. Asis Kumar
Maximum Marks: 50
Exam Duration: 90 Min.
five processes (P1, P2, P3, P4, P5) and
KConsider the following snapshot of a system with
four resources type (R1, R2, R3, R4).
Available
Process Allocation Max
R4|RI R2 R3 R4
R1 R2 R3 R4 R1 R2 R3
P1 0 3
P2
0 3 4 6 6 6
2 3 3 5
P4
PS 0 3 3 6 5 2
a process Pl arrives for (0, 0, 1, 0), can
Is the system in a safe state? Why? If a request from
yes, show a Safe sequence order.
the request be imnmediately granted? Why or why not? If
processor, with the jobs arriving in
h. Assume you have the following jobs to execute with one
the order listed here:
Process Arrival Burst
Id Time Time
Pl
P2 1
P3 2 3
P4 3
PS 4
P6
Supposeasystem uses Shortest Remaining Time First (SRTF) scheduling algorithm. Create
a Gantt chart illustrating the exCcution of these processes. What is thc averape wait time &
average turnaround time for the processes?
3. What are the Conditions for Dcadlock to occur? Briefly explain. In a system, the following
P3
state of processes and resources are given: RI’ P, PI’ R2, P2- R3, R2- P2, R3-
P3 R4, P4’ R3, R4’ P4, P4 RI, RI’ P5. Draw Resource Allocation Graph for the
system and chcck for deadlock condition. Explain your answcr.
4. What is a monitor? Explain how itcan be used to solve bounded-buffer synchronization
problem.
has been given an
5. (a) The following pair of processes share the variable counter, which
initial value of 10 before execution of either process begins: [7 M]
Process A Process B
Al: LOAD counter, RO B1: LOAD counter, RO
ADD RO, 1 ADD RO_2
A2: STORE R0, counter B2: STORE RO. counter
which
timesharing system, there are six possible orders in
If Processes A and B are run on a
executed. For each of the orderings, please give
the LOAD and STORE instructions might be
variable.
the final value of the counter
Al A2 BI B2: counter
Al BI B2 A2: counter
A1 B1 A2 B2: counter
BI A1 A2 B2: counter
B1 B2 Al A2: counter
BI Al B2 A2: counter=
appropriate definition
the terms in column A with the most
(b). Concurrency control: Match [3M]
from column B.
Column B
Column A
1. Synchronization a. Piece of code that only one
thread can execute at once
thread
2. Mutual exclusion b. Ensuring that only one
does a particular thing at a time
an
3. Critical section c. Isolating program faults to
address space
d. Using atomic operations to
ensure cooperation between
threads
**** ***k**