logo

Deadlock Detection and Prevention

   

Added on  2022-08-14

10 Pages1836 Words11 Views
Running head: DEADLOCK DETECTION AND PREVENTION
Deadlock Detection and Prevention
Name of the Student
Name of the University
Author Note

DEADLOCK DETECTION AND PREVENTION1
Table of Contents
Question 1 2
Question 2 2
Question 3 2
Question 4 6
Timeline diagram for FCFS: 6
Timeline diagram for Round Robin: 6
Timeline diagram for SRT: 6
Timeline diagram for HRRN: 6
Question 5 7
References 9

DEADLOCK DETECTION AND PREVENTION2
Question 1
In the operating system starvation is a mechanism used to carry out from a deadlock situation.
Starvation occurred when a process waited for a resource to get executed, but due to the
unavailability of the resource, the priority of the process states reducing and the process is never
getting the resource and the process never executed. The operating system can detect the above
problem of starvation by checking the number of process priority depletion and waiting time. If a
low priority process is waiting for a process which is already held by a higher priority process,
then the lower priority process has to wait for infinite time to get executed because the priority of
the process is started decreasing, and this causes starvation. It is challenging to detect starvation
in the system because all the process of the system is processed without any problem only the
victim process. Detection of the starvation process can only be done by checking the waiting time
and the priority of the process if the process has a very low priority depends on the other
processes then the chances of starvation is increased in the system, and it is possible to detect any
process are starving or not.
Question 2
a. The above system is never getting in any deadlock situation because one account only
requests for their resource from the system and if the system is rigid about all the processes of
the system like locking, updating, and unlocking. The deadlock probability is avoided if the
resource of the system works perfectly while the accounts are locked.
b. Suppose all the accounts of the system are locked at the same time, then the deadlock can be
prevented by the sequence of the rigid process of locking, updating, and unlocking regardless
of the order of the accounts being processed.
Question 3
Waiting time is a time which is spent by a process for the CPU in the ready queue. Waiting
time is calculated based on the arrival time and the completion time of the previous process. Suppose
p1 and p2 both arrive at 0ms time and the system follows FCFS. The system p0 is first allocated in
the CPU for the process execution, and p1 has to wait until p0 is not completed. So here, the waiting
time for the process p1 is the completion time of p0.
Turnaround time is the time that is taken by a process to complete the process execution to
provide the desired output. It is also used to consider the addition of total time taken from a process
to get memory allocation and total time taken to for execution. Turnaround time is used to evaluate

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Deadlock - System Design | Assignment
|14
|2893
|29

Assignment on Analysis of an Operating System Scenario
|25
|3830
|14

CPU Scheduling Algorithms and Deadlock Situations in Computer Organization and Architecture
|12
|2773
|238

Computer Organization and Architecture
|14
|2395
|292

Computer Organization and Architecture Tutorial
|16
|2994
|19