19AIE203

Topological Sorting

Data Structures and Algorithms - 2

19AIE202

Deadlock Detection

Operating Systems

Deadlock Detection

Operating Systems

+

Topological Sorting

Data Structures and Algorithms - 2

Deadlock Detection

Topological Sorting

using

Aadharsh Aadhithya                  -         CB.EN.U4AIE20001
Anirudh Edpuganti                     -         CB.EN.U4AIE20005

Madhav Kishore                          -         CB.EN.U4AIE20033
Onteddu Chaitanya Reddy        -         CB.EN.U4AIE20045
Pillalamarri Akshaya                   -         CB.EN.U4AIE20049

Team-1

Deadlock Detection

Topological Sorting

using

Deadlock Detection

What is Deadlock ?

Son

What is Deadlock ?

Son

Hungry

What is Deadlock ?

Son

Hungry

Mother

Cook

What is Deadlock ?

Son

Hungry

Mother

Cook

Seller

Sell

Food

What is Deadlock ?

Son

Hungry

Mother

Cook

Seller

Sell

Food

Rice

What is Deadlock ?

Son

Hungry

Mother

Cook

Seller

Sell

Food

Rice

Come

What is Deadlock ?

Back to Subject 😅

What is Deadlock ?

Resource

What is Deadlock ?

Process

Resource

What is Deadlock ?

What is Deadlock ?

Mutual Exclusion

What is Deadlock ?

Mutual Exclusion

What is Deadlock ?

Mutual Exclusion

Give

Took

What is Deadlock ?

Give

Took

Hold and Wait

Mutual Exclusion

What is Deadlock ?

Mutual Exclusion

Give

Took

Hold and Wait

Greedy

What is Deadlock ?

Mutual Exclusion

Give

Took

Hold and Wait

Greedy

No Premption

What is Deadlock ?

Mutual Exclusion

Hold and Wait

No Premption

What is Deadlock ?

Mutual Exclusion

Hold and Wait

No Premption

Circular Wait

What is Deadlock ?

Mutual Exclusion

Hold and Wait

No Premption

Circular Wait

What is Deadlock ?

Mutual Exclusion

Hold and Wait

No Premption

Circular Wait

Hold Simulataneously

What is Deadlock ?

Resource Allocation Graph

What is Deadlock ?

Resource Allocation Graph

Deadlock🤔?

What is Deadlock ?

Resource Allocation Graph

Satisfy 4 conditions🤷‍♂️

What is Deadlock ?

Resource Allocation Graph

How? Which Algorithm?😒

What is Deadlock ?

Resource Allocation Graph

Topological Sorting... 🤔

What is Deadlock ?

Resource Allocation Graph

Let's Proceed then 🙌

Topological Sorting

Topological Sorting

DFS

Topological Sorting

DFS

Acyclic Directed Graph

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

Topological Sorting

DFS

A

B

C

D

E

F

B

Topological Sorting

DFS

A

B

C

D

E

F

B

D

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

A

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

A

F

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

A

F

Topological Sorting

DFS

A

B

C

D

E

F

B

D

C

A

F

E

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

DFS

B

D

C

A

F

E

Topological Sort Order

Topological Sorting

Deadlock Detection

using

Resource-Allocation Graph

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Resource-Allocation Graph

R_1
R_4
R_3
R_5
R_2
P_1
P_5
P_3
P_4
P_2
P_5
R_3

Cycle Detected !!!

There is a Deadlock !

Code

Thank you Sir!

DSA-2 Sem3 Project

By Incredeble us

DSA-2 Sem3 Project

  • 44