University Report: Deadlock, Deadlock Avoidance, and Handling in OS

Verified

Added on  2021/06/17

|9
|1608
|51
Report
AI Summary
This report delves into the critical topic of deadlocks within operating systems, explaining their nature as a situation where processes block each other from accessing necessary resources. It explores the core concepts, including mutual exclusion, no preemption, hold and wait, and circular wait, which contribute to deadlock conditions. The report details strategies for deadlock avoidance, such as resource numbering and process state recording, as well as handling methods like rollback, preemption, and process termination. It also differentiates between deadlock and livelock scenarios, and discusses the challenges in deadlock detection, along with practical examples. The conclusion emphasizes the importance of careful resource allocation to prevent deadlocks, providing a comprehensive overview of the subject.
Document Page
1PC HARDWARE AND OS ARCHITECTURE
PC HARDWARE AND OS ARCHITECTURE
Name of the Student
Name of the University
Author Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
2PC HARDWARE AND OS ARCHITECTURE
Table of Contents
What is operating system?.........................................................................................................3
Deadlock....................................................................................................................................3
Deadlock avoidance...................................................................................................................3
Deadlock handling.....................................................................................................................3
Livelock......................................................................................................................................4
Detection of Deadlock................................................................................................................4
Example of Deadlock.................................................................................................................4
Conclusion..................................................................................................................................5
References..................................................................................................................................6
Document Page
3PC HARDWARE AND OS ARCHITECTURE
What is operating system?
The operating system can be considered as a program which directly manages the
computer resources especially the concept of the allocation of the resources among different
other computers. Typically the concept of resources may include the computer memory,
central processing unit and the file storage.
The topic which is selected related to the operating system for the aspect of discussion
in the report is the Deadlock situation which is faced within the concept of the operating
system
Deadlock
A deadlock can be considered as a situation in which two programs of the computer
directly shares the same resources which are actively preventing each other from accessing
that particular resources which result in ceasing of the function. It can be stated here that
earlier the operating system used to run only on one program at a particular time. All the
resources were available to that particular program. Later on multiple program were executed
at one time interleaving them. In this concept the programs had to request for the resources
which they would be using in order to complete their execution. In that particular time if the
resources were not available or used by some other program it would lead to a situation
which is known as deadlock (Bloom et al.)
Definition: Deadlock are a set of processes which hold a particular resource and waiting to
acquire another resource at the same time. The resource which is requested are obtained
access by another program.
Document Page
4PC HARDWARE AND OS ARCHITECTURE
Deadlock avoidance
The concept of the deadlock can be avoided by the process of avoiding any of the four
conditions which are stated below:
Mutual exclusion: resources which are related to the aspect of shared resources
category do not eventually lead to the aspect of deadlock but resources such as tape
drives and printers need exclusive access by a single process which may lead to the
aspect of deadlock.
No preemption: the concept of the preemption of the resources can lead to avoidance
of the deadlock whenever it is possible.
Hold and wait: in this type of situation a process would not be allowed to hold more
than one resource at a particular time and request for another resource at that
particular time framework.
Circular wait: The concept of the circular wait can be avoided by means of numbering
all he resources and the allocation of the resources would be done according to
decreasing or increasing order.
Deadlock handling
The above aspects are related to the deadline avoidance. The main factor which plays
a role is what to do when a deadlock already occurred. The following three strategies can be
incorporated if a deadlock situation arises.
Rollback: when a situation occurs were the deadlock would be inevitable, the system
can make a record of the of the process states and when the situation of the deadlock
occurs roll everything back to the last checkpoint and restart, but the concept of the
allocation differently can also be used for the recovery of the deadlock.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
5PC HARDWARE AND OS ARCHITECTURE
Preemption: In the concept if the roll back the main factor which play a role is that
one resources from a process can be taken and given to another resource. This can be
very much beneficial for the aspect of removing deadlock but it can be stated that it
does involve some problem.
Kill one or more processes: this can be considered one of the simplest ways by which
the avoidance of the deadlock can be done. And it can be stated that the killing of one
or more resources works very well in the concept of the deadlock handling (Yao,
Xiaofeng, and Lei Wang).
Livelock
The concept of the livelock can be considered as one of the variant which is related to
the deadlock. The situation which arises in the concept of the livelock is that two or more
than that processes continuously change their state in response to the other processes without
any involvement of proper activity. The concept of the live lock is very much similar to the
deadlock which explains that there are no progress made but differ in the aspect of nether the
process get blocked nor the waiting aspect remains for the resources.
A human example can be stated here which can explain the process of livelock. If two
people who meet face to face in any area and each of them move aside to let the other person
move but they end up swaying from side to side without any sort of proper progress (Jing,
Zhang et al.). In this context it is stated that no progress is made due to the factor that the
move in the same way at a same time period.
Detection of Deadlock
In some of the situations it can be stated that the factor of the deadlock avoidance and
deadlock prevention may not be used. Instead of this the process of detection of the deadlock
and process restart are used in most of the cases which means that an algorithm tracks the
Document Page
6PC HARDWARE AND OS ARCHITECTURE
resources allocation and process states and roll back all the resources and directly restart all
the processes in order to remove the condition which can create the aspect of the deadlock.
The concept of the deadlock which has already occurred can be very much problematic due
to the factor that the resources at each of the process has been locked and or currently
requested are known to the resources scheduler or the operating system. The aspect which is
related to the detection of the deadlock can be considered very much difficult. It can be stated
as very much undecidable due to the aspect of the halting problem can be represented as the
scenario of the deadlock (Iqbal and Arshad)
Example of Deadlock
An example of the concept of the deadlock are as following. The application of the
client using the database may require exclusive access direct to the table and in order to gain
the access which is exclusive they ask for the concept of lock. If a client tries to hold a lock
on a particular table and attempts to lock another team second table may not be available due
to the factor that the lock on the second table is gained access by another client. And on the
other hand of the second client tries to obtain the lock on the table which is hold on by the
first client, this situation can lead to the aspect of deadlock (Silberschatz et al.).
Conclusion
It can be concluded at the end that the aspect of the deadlock can be neglected by
allocating the resources to the process very much wisely. It should be taken into
consideration that a process does not hold into the resources ones the use of the resources is
completed. This is mainly done due to the factor that at that same time another process may
be waiting for the same resources which is hold by that particular resource. In the report
different strategy are included which mainly focus on the aspect of the avoidance of the
deadline and how to prevent the aspect of the deadlock.
Document Page
7PC HARDWARE AND OS ARCHITECTURE
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
8PC HARDWARE AND OS ARCHITECTURE
References
Bloom, Gedare, Gabriel Parmer, and Rahul Simha. "LockDown: an operating system for
achieving service continuity by quarantining principals." Proceedings of the 9th European
Workshop on System Security. ACM, 2016.
Brucker, Achim D., et al. "Testing the IPC protocol for a real-time operating system."
Working Conference on Verified Software: Theories, Tools, and Experiments. Springer,
Cham, 2015.
Hambarde, Prasanna, Rachit Varma, and Shivani Jha. "The survey of real time operating
system: RTOS." Electronic Systems, Signal Processing and Computing Technologies
(ICESC), 2014 International Conference on. IEEE, 2014.
Iqbal, Arshad. "Operating Systems MCQs: Multiple Choice Questions and Answers (Quiz &
Tests with Answer Keys)." (2017).
Jing, Zhang, et al. "TQS-DP: A lightweight and active mechanism for fast scheduling based
on WSN operating system TinyOS." Control and Decision Conference (CCDC), 2015 27th
Chinese. IEEE, 2015.
Silberschatz, Abraham, Peter Baer Galvin, and Greg Gagne. Operating system concepts
essentials. John Wiley & Sons, Inc., 2014.
Xiao, Guanping, et al. "Experience report: Fault triggers in linux operating system: From
evolution perspective." Software Reliability Engineering (ISSRE), 2017 IEEE 28th
International Symposium on. IEEE, 2017.
Document Page
9PC HARDWARE AND OS ARCHITECTURE
Yao, Xiaofeng, and Lei Wang. "Design and implementation of IOT gateway based on
embedded μTenux operating system." International Journal of Grid and Utility Computing
8.1 (2017): 22-28.
chevron_up_icon
1 out of 9
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]