100% found this document useful (1 vote)
2K views

Osy 22516 Microproject

The document outlines a micro project proposal and report on the Banker's algorithm and safety algorithm for deadlock detection and avoidance. The proposal includes the aims of studying these algorithms, the proposed methodology of gathering information and solving examples, and an action plan. The report provides background on deadlocks and describes how the team implemented the project by researching the algorithms, solving examples, and preparing a report. It explains how the Banker's algorithm is used to safely allocate resources to processes and avoid deadlocks.

Uploaded by

2008 Avadhut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

Osy 22516 Microproject

The document outlines a micro project proposal and report on the Banker's algorithm and safety algorithm for deadlock detection and avoidance. The proposal includes the aims of studying these algorithms, the proposed methodology of gathering information and solving examples, and an action plan. The report provides background on deadlocks and describes how the team implemented the project by researching the algorithms, solving examples, and preparing a report. It explains how the Banker's algorithm is used to safely allocate resources to processes and avoid deadlocks.

Uploaded by

2008 Avadhut
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Index

Sr. No. Contents Page No.

Annexure I– Micro Project Proposal 1-2

1.Aims/Benefits of the Micro-Project 1

2. Course Outcome Addressed 1

1 3.Proposed Methodology 1

4. Action Plan 2

5. Resources Required 2

6. Name of Team Members with Roll No.’s 2

Annexure II – Micro Project Report 3-8

1.Rationale 3

2.Aims/Benefits of the Micro-Project 3

3.Course Outcome Achieved 3

4. Literature Review 3

2 5.Actual Methodology Followed 4

5.1 Flow chart 5

5.2 Source code 4-6

6.Actual Resources Used 7

7.Outputs of Micro-Projects 8

8. Skill developed / Learning out of this Micro-Project 8

9. Applications of this Micro-Project 8

i
Annexure I

Micro Project Proposal

Banker’s & Safety algorithm for deadlock detection and


avoidance

1. Aims/Benefits of the Micro-Project:

An Operating System is basically a system program that controls the execution of


application programs and acts as an interface between applications and the computer
hardware. It manages the computer system resources to be used in an efficient manner.
This course enables one to learn the internal functioning of operating systems and will
help in identifying appropriate Operating Systems for given applications/tasks. This
course is also a prerequisite for the group of courses included in the 'Cloud
Infrastructure Maintenance' Elective group.

2. Course Outcome Addressed:

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:

Sr. Planned Planned Name of Responsible


Details of Activity
No. Start date Finish date Team Members
1 Search the information of 18-09-2021 21-09-2021
different database 4:30 – 5:30 PM 4:30 – 5:30 PM
2 Collect the information of 28-09-2021 30-09-2021
Deshmukh Avadhut
different database 4:30 – 5:30 PM 4:30 – 5:30 PM
Prakash
3 Analysis of different 05-10-2021 09-10-2021
information 4:30 – 5:30 PM 4:30 – 5:30 PM
4 Analysis of information 12-10-2021 16-10-2021
4:30 – 5:30 PM 4:30 – 5:30 PM
5 Compression of Database 26-10-2021 30-10-2021
4:30 – 5:30 PM 4:30 – 5:30 PM
Avadhut Prakash
6 Features of Database 09-11-2021 19-11-2021
deshmukh
4:30 – 5:30 PM 4:30 – 5:30 PM
7 Advantages and drawback 23-11-2021 04-12-2021
Avadhut Prakash
of database 4:30 – 5:30 PM 4:30 – 5:30 PM
deshmukh
8 Final report of project 07-12-2021 11-12-2021
4:30 – 5:30 PM 4:30 – 5:30 PM

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

Mr. Chavan A.Y

Name and Signature of the Teacher

3
Annexure – II

Micro-Project Report

Banker’s & Safety algorithm for deadlock detection and


avoidance

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.

2. Aims/Benefits of the Micro-Project:

An Operating System is basically a system program that controls the execution of


application programs and acts as an interface between applications and the computer
hardware. It manages the computer system resources to be used in an efficient manner.
This course enables one to learn the internal functioning of operating systems and will
help in identifying appropriate Operating Systems for given applications/tasks. This
course is also a prerequisite for the group of courses included in the 'Cloud
Infrastructure Maintenance' Elective group.

3. Course Outcomes Achieved:

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

5. Actual Methodology Followed

• 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.

• Solved examples to better understand Algorithms and their methods.

• Cross-checked outputs and answers.

• Prepared a report.

• Checked for any further changes to be done in the project.

• Created the final report of the project.

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

Algorithm which is used for single instance of a resource type is:


–Resource-allocation graph
Algorithm which is used for Multiple instances of a resource type is given as:
– Banker’s algorithm
Resource Allocation Graph Algorithm
The algorithm which is used in dead avoidance in case when there is only instance of
each resource class is known as RAG algorithm.

A new type of Edge is presented which is called Claim Edge.Claim edge Pi → Rj


specified that process Pj can request resource Rj in the future; is denoted by a dashed
line.Claim edge transforms to request edge when a process requests a resource.
Request edge converted to an assignment edge when the resource is allocated to
the process Whenever a resource is set free by a process then assignment edge
re-converts to a claim edge, resources should be claimed a priori in the system
Before a process P starts executing, all of its claim edges must already appear in the
resource-allocation graph. Safe Vs Unsafe State Suppose the resource-allocation graph
of Given bellow, that P1 requests R2. While R1 is currently available free and cannot
allocate it to p1, then this action will generate a cycle in the graph. On the other side A
cycle shows that the system is in an unsafe state. In case if P1 requests R2 and P2
requests R1, at that time a deadlock will occur. Suppose that process Pi requests for a
resource Rj. The request may be granted only if modifying the request edge to an
assignment edge does not result in the creation of a cycle in the resource allocation
graph.
Banker’s Algorithm
The RAG algorithm is un-applicable to a resource allocation system which has
multiple instances of every resource type. Banker’s Algorithm is normally less
efficient than the RAG scheme. The name of this algorithm was chosen because
the algorithm could be used in a banking system to make sure that the bank never
allotted its available cash in such a way that it could no longer satisfy need of all
its customers.

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:

Max Instances of Resource Type A = 3 (2 allocated + 1 Available)

Max Instances of Resource Type B = 17 (12 allocated + 5 Available)

Max Instances of Resource Type C = 16 (14 allocated + 2 Available)

Max Instances of Resource Type D = 12 (12 allocated + 0 Available)

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)

P0 will be executed because need(P0) <= Work P0 will be true


Finish Matrix
P0 – 1 True
P1 False
P2 False
P3 False
P4 False

P0 will release the allocated resources(0,1,1,0) Work = Work (1,5,2,0)+Allocated(P )


0 (0,1,1,0) = 1,6,3,0

Work Factor
1630

Need (0,4,2, 1 1 0 ) work(1,6,3, <= ) Condition Is False P will Not be executed 1

Need2 (1,0,0,1) work(1,6,3, <= 0) Condition Is False P will Not be executed

Need3 (0,0,2,0 work(1,6,3,0) P will be executed

8
9
10
11
12
6 . Actual Resources Used:

Sr. Name of resource /


Specification Quantity Remarks
No. material

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

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.

Deadlock Avoidance Algorithm

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

9. Applications of this Micro-Project:

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy