OS - 2mark and 16 Marks (Unit-II)
OS - 2mark and 16 Marks (Unit-II)
request is the entry section. The critical section is followed by an exit section. The remaining code is the
remainder section.
26. What are conditions under which a deadlock situation may arise?
A deadlock situation can arise if the following four conditions hold Simultaneously in a system:
a. Mutual exclusion
b. Hold and wait
c. No pre-emption
d. Circular wait
27. What is a resource-allocation graph?
Deadlocks can be described more precisely in terms of a directed graph called a system resource
allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is
partitioned into two different types of nodes; P the set consisting of all active processes in the system and
R the set consisting of all resource types in the system.
PART-B
1. What is the important feature of critical section? State the dining philosopher’s problem and show
how to allocate the several resources among several processes in a deadlock and starvation free
manner.
2. How can deadlock be detected? Explain.
3. Write about the various CPU scheduling algorithms.
4. Write notes about multiple-processor scheduling and real-time scheduling.
5. Write about critical regions and monitors.
6. Consider the following five processes, with the length of the CPU burst time given in
milliseconds.
Process Burst time
P1 10
P2 29
P3 3
P4 7
P5 12
Consider the First come First serve (FCFS), Non Preemptive Shortest Job First(SJF), Round
Robin(RR) (quantum=10ms) scheduling algorithms. Illustrate the scheduling using Gantt chart. Which
algorithm will give the minimum average waiting time? Discuss.
7. Consider the following page reference string
7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1
How many page faults would occur for the following replacement algorithms, assuming three
frames that all frames are initially empty?
8. i) Construct a Resource Allocation Graph for the following scenario. At time ’t’ Process P1
request for a resource X, process P2 requests for a resource Y. Both the resources are Available
and they are allocated to the requesting process. At time t1 where t1>t2 both the processes are
still holding the resources, however process P1 request for Y which is held by P2, process P2
request for X held by P1. Will there be a deadlock? f there is a deadlock discuss the four
necessary conditions for deadlock, else justify there is no deadlock .
ii) With relevant example show that the implementation of a semaphore with a waiting queue
may result in deadlock
9. Discuss about the issues to be considered with multithreaded programs.
10. Write about the three common types of threading implementation.
11. Explain the two solutions of recovery from deadlock.