8 2 short paper deadlock avoidance docx
8-2 Short Paper: Deadlock Avoidance
IT 600 Operating Systems
Timothy Kaliszewski
Southern New Hampshire University
In the old days operating systems only were able to handle one program at a time, this means
that the program in use utilized all the resources available. As time passed, operating systems evolved
and they were able to execute programs simultaneously; the programs or applications would only use
the resources needed to avoid conflict or obstruct other programs. Nowadays, modern operating
systems are able to petition for additional allocation while being executed (dynamic allocation) leading
to a problem called DEADLOCK.
DEADLOCK arises when two or more programs are using the same resources and this stops
each other from accessing the resources needed to operate, therefore the programs cannot function.
Deadlocks happen on both software and hardware. In general terms, deadlocks are related with nonpreemptable resources because this type of resources can be resolved easily by reallocating resources
among the involved processes (Tanenanbum,2015).
To prevent a deadlock, one must comprehend under what conditions a deadlock can occur.
Below are the conditions required for a deadlock to happen, if one of the following conditions is not
present, no deadlock occurs. The conditions are:
1. Mutual Exclusion Condition: The involved resources cannot be shared.
2. Hold and Wait Condition: If a process requested resources and this resource was granted
to them, this resource can request new resources.
3. No-Preemptive Condition: If a process got resources allocated to them, this process cannot
be preempted.
4. Circular Wait Condition: There are two or more processes in a circular list, and these
processes are waiting for a resource that is currently allocated to the next member.
There are four strategies that can be utilized to deal with deadlocks, these are:
1.
Ignoring the problem or Ostrich Algorithm
2.
Detection and Recovery
3.
Deadlock Prevention (Deadlock Avoidance)
4.
Prevention by structurally negating one of the four conditions
I am going to discuss Deadlock Avoidance as a strategy for TSI back-office new operating
system implementation.
We need certain types of information in advance to make resource allocation easier in order to
avoid deadlock; this way, the algorithms utilized to avoid deadlocks are established under safe states
objectives. We can use this approach to decide if a process must wait for a resource or not. If a system
is not in a deadlock state, it is said to be safe, therefore it has the ability to assign resources at the
maximum limit. The algorithms used by deadlock avoidance assure us that the resources will not be
assigned to a process if this puts the system in danger.
The resource allocation graph is not an algorithm, it is more of an approach which is used to
track the resources held by processes and which process is waiting for which resource. A deadlock will
happen if there is a cycle in the resource distribution graph and each resource in the process supplies
just one instance (Vankatesh, 2016).
The Banker’s Algorithm for single resource and The Banker’s algorithm for multiple
resource
The Banker’s Algorithm revises if a resource requested by a process will lead to an unsafe state
it the resources are granted, if it poses a threat the request will be denied otherwise the request is
granted (Tannenbaum, 2015). From my point of view, the Banker’s Algorithm is the best approach to
avoid deadlock at TSI because of the following reasons:
●
MAX: What is the max resource a process can request.
●
ALLOCATED: How much of each resource a process is using presently.
●
AVAILABLE: How much of each resource the system has available.
Although, in theory, this appears to be the most suitable algorithm it is very hard to know how
much of a resource a process will need. Another reason is that processes are not fixed, as users log in
and log out processes change. There are other algorithms such as, throttling of a network traffic, which
imitate the Banker’s Algorithm, and it is useful to reduce the saturation of the buffer.
Deadlock avoidance is crucial to usage of the web server by clients and employees. Deadlocks
might happen on servers if a program solicits the same thread or when it handles several programs.
When threads enter and leave a mutex (mutual exclusion object) they are locked and unlocked, if
a program has more than one mutex, the chances of a deadlock are high, to avoid this we must impose
an ordering on the mutexes acquisition.
References
Tanenbaum, A. S., & Bos, H. (2015). Modern operating systems (4th ed.). Boston: Pearson
Education.
…