Osy 22516 Microproject
Osy 22516 Microproject
1 3.Proposed Methodology 1
4. Action Plan 2
5. Resources Required 2
1.Rationale 3
4. Literature Review 3
7.Outputs of Micro-Projects 8
i
Annexure I
Apply deadlock avoidance and safety algorithms to detect and avoid deadlocks.
3. Proposed Methodology:
We will concentrate on the materials we require, as well as the instructions, and sort it
out in a manner that will expedite the various duties of the team members.
• Get details about the algorithms and how they are used to detect and avoid deadlock.
• Solve the problems (examples) based on algorithms to detect and avoid deadlock.
• Cross-check all the conclusions and answers.
• Prepare a report on the topic.
1
4. Action Plan:
5. Resources Required:
Sr.
No Name of resource / material Specification Quantity Remarks
.
1 Computer WINDOWS 7,2GB RAM, 1
160GB HDD
2 Operating System WINDOWS 7 1
3 Software JDK 8 1
4 Browser Google Chrome 1
2
Names of Team Members with Roll No.’s:
Sr.
Enrollment No. Name of Team Member Roll No.
No.
1 2010950130 Deshmukh Avadhut Prakash 46
3
Annexure – II
Micro-Project Report
1. Rationale:
In an operating system, the CPU plays a more important role in executing processes and
controlling the flow of the computing smoothly. Deadlocks are the main problems for
the operating system to tackle, whenever a deadlock occurs execution of processes
stops completely. To overcome (Solve) this deadlock situation there are two algorithms
one for avoidance and one for detection. In the further report, we are going to see take
look at how they are implemented with the help of examples.
Apply deadlock avoidance and safety algorithms to detect and avoid deadlocks.
4
4. Literature Review:
Deadlock is not the main hazard to the operating system. o Deadlocks don’t arise more
often, the frequency of deadlock occurrence is too less but whenever a deadlock occurs
system’s execution stops completely. Most systems don’t involve default codes for
deadlock avoidance and detection in the system because of deadlock’s rare occurrence
and putting complex codes for deadlock avoidance and detection does not significantly
impact the speed of computing. To overcome this situation we can use banker’s &
Safety algorithms
• We focused on the materials we needed, as well as the instructions, and sorted it out in
a manner that will expedite different responsibilities of the team members.
• The gathered information about the algorithms and how they are used to detect and
avoid deadlock.
• Prepared a report.
It is a banker algorithm used to avoid deadlock and allocate resources safely to each
process in the computer system. The 'S-State' examines all possible tests or activities
before deciding whether the allocation should be allowed to each process. It also helps
the operating system to successfully share the resources between all the processes. The
banker's algorithm is named because it checks whether a person should be sanctioned a
loan amount or not to help the bank system safely simulate allocation resources. In this
section, we will learn the Banker's Algorithm in detail. Also, we will solve problems
based on the Banker's Algorithm. To understand the Banker's Algorithm first we will
see a real word example of it.
5
Deadlock Avoidance Algorithms
There are two types of deadlock avoidance algorithms on the basis of their resources
6
Banker’s Algorithm Example Solutions
Example 1
Assume that there are 5 processes, P through P, and 4 types of res 0 4 sources. At T we have the
0 following system state:
7
2. Use the safety algorithm to test if the system is in a safe state or not? a. We will first
define work and finish: Initially work = available = (1, 5, 2, 0) Finish = False for all
processes
Finish matrix
P0 False
P1 False
P2 False
P3 False
P4 False
Work Factor
1520
b. Check the needs of each process [ needs(pi) <= Max(pi)], if this condition is true: •
Execute the process , Change Finish[i] =True • Release the allocated Resources by this
process • Change The Work Variable = Allocated (pi) + Work need0 (0,1,0,0) work
(1,5,2,0)
Work Factor
1630
8
9
10
11
12
6 . Actual Resources Used:
3 Software JDK 8 1
6. Outputs of Micro-Projects:
We got detailed information about CPU scheduling & algorithms, also the deadlock
situation which has four necessary conditions 1. Mutual Exclusion 2. Hold & W ( at 3.
No-Preemption 4. Circular Wait if that all conditions hold simultaneously ) in the
system then a deadlock situation can occur in the system. There are four ways we can
face the deadlock out of four we saw two methods one is deadlock avoidance and the
second one is deadlock detection. We also focused on other techniques of handling
deadlocks.
13
8. Skill developed / Learning out of this Micro-Project:
Increase knowledge about Banker’s & Safety algorithm for deadlock detection
and avoidance
Experience teamwork
Increase communication skill
Know about Banker’s & Safety algorithm for deadlock detection and avoidance
The banker's algorithm is a resource allocation and deadlock avoidance algorithm that
tests for safety by simulating the allocation for predetermined maximum possible
amounts of all resources, then makes an “s-state” check to test for possible activities,
before deciding whether allocation should be allowed to continue
14