Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Operating System for Programmers

Rating
-
Sold
-
Pages
23
Uploaded on
03-05-2024
Written in
2023/2024

Dive into the intricate world of Operating Systems with comprehensive notes! From dissecting the four conditions of deadlock to unraveling the mysteries of cloud services, this guide equips you with essential knowledge for exams and beyond. Learn how deadlock situations arise, the methods for deadlock prevention, and explore the fascinating realm of resource management. Whether you're a beginner or brushing up your skills, these notes are your key to mastering Operating Systems!

Show more Read less
Institution
Course

Content preview

Operating System Notes
(Contains all about Deadlock and Cloud Services)
- By BeginnerCoder21


4 conditions of deadlock
Deadlock
● situation where a set of processes are blocked because each process is holding a
resource and waiting for another resource acquired by some other process.
● Mutual Exclusion
○ There must exist at least one resource in the system which can be used by
only one process at a time.
○ If there exists no such resource, then deadlock will never occur.
○ Printer is an example of a resource that can be used by only one process at a
time.
● Hold and Wait
○ must exist a process which holds some resource and waits for another
resource held by some other process.
● No preemption
○ Once the resource has been allocated to the process, it can not be
preempted.
○ resource can not be snatched forcefully from one process and given to the
other process.
○ process must release the resource voluntarily by itself.
● Circular wait
○ All the processes must wait for the resource in a cyclic manner where the last
process waits for the resource held by the first process.




In exam, explain this

,Deadlock Prevention

● Provides a set of methods to ensure that one of the four necessary conditions is
violated that are required for the occurrence of deadlock.
● This ensures that the system remains free from the deadlock.
● Eliminate Mutual Exclusion-
○ To violate this condition, all the system resources must be such that they can
be used in a shareable mode.
○ In a system, there are always some resources which are mutually exclusive by
nature.
● Solve Hold & Wait-
○ Approach 1 (eliminating wait)
■ process specifies the resources it requires in advance so that it does
not have to wait for allocation after execution starts. (take restaurant
eg)
■ But this approach lead to Low device utilisation
● Eg: If a process requires a printer at a later time & we allocated
printer before start of its execution, printer will remain blocked
till it has completed its execution.
■ Eg: Process1 declares in advance that it requires both Resource1 and
Resource2
○ Approach 2 (eliminating hold)
■ The process has to release all resources it is currently holding before
making a new request. (eg: plate of food)
■ approach is efficient and implementable.
■ This may lead to starvation
● Allow Preemption-
○ condition can by violated by forceful preemption. Forcefully preempt the
resources possessed by some other process only if- (eg: get the table free if )
● It is a high priority process or a system process. (VIP)

, ● The victim process is in the waiting state. (customer waiting for long
tym)
○ Consider a process holding some resources and requesting other resources
that can not be immediately allocated to it.
○ Then, by forcefully preempting the currently held resources, the condition
can be violated.
● Eliminate Circular Wait-
○ Circular Wait condition can be violated by not allowing the processes to wait
for resources in a cyclic manner (ask customer not to walk around)
○ We assign a priority to each resource. A process can only request resources in
increasing order of priority. (give priority to good table, a customer can order
food in increasing order)
○ approach is the most practical approach and implementable.
○ Eg: A media player will give a lesser priority to a printer while a document
processor might give it a higher priority. The priority of resources is different
according to the situation and use case.

Deadlock Avoidance
● strategy involves maintaining a set of data using which a decision is made whether to
entertain the new request or not. (maintain data for table booking)
● If entertaining the new request causes the system to move in an unsafe state, then it
is discarded.
● strategy requires that every process declares its maximum requirement of each
resource type in the beginning. (requires customer to tell no of people in advance)
● The main challenge with this approach is predicting the requirements of the
processes before execution.
● Banker’s Algorithm is an example of a deadlock avoidance strategy.

Deadlock Detection and Recovery-
● This strategy involves waiting until a deadlock occurs.
● After a deadlock occurs, the system state is recovered.
● The main challenge with this approach is detecting the deadlock.

Deadlock Ignorance-
● This strategy involves ignoring the concept of deadlock and assuming as if it does not
exist.
● This strategy helps to avoid the extra overhead of handling deadlock.
● Windows and Linux use this strategy and it is the most widely used method.
● It is also called as Ostrich approach.

Written for

Institution
Course

Document information

Uploaded on
May 3, 2024
Number of pages
23
Written in
2023/2024
Type
Class notes
Professor(s)
Anushka
Contains
All classes

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
deucepeople

Also available in package deal

Get to know the seller

Seller avatar
deucepeople Bennett University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions