wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock in operating system

profile
Khushi Balgi
Aug 14, 2024
0 Likes
0 Discussions
148 Reads

What is Deadlock?

Deadlock is a situation in computing where two or more processes are unable to proceed because each is waiting for the other to release resources. Key concepts include mutual exclusion, resource holding, circular wait, and no preemption.


Consider an example when two trains are coming toward each other on the same track and there is only one track, none of the trains can move once they are in front of each other. This is a practical example of deadlock.


How Does Deadlock occur in the Operating System?

Before going into detail about how deadlock occurs in the Operating System, let’s first discuss how the Operating System uses the resources present. A process in an operating system uses resources in the following way.


Requests a resource

Use the resource

Releases the resource


A situation occurs in operating systems when there are two or more processes that hold some resources and wait for resources held by others. For example,Process 1 is holding Resource 1 and waiting for resource 2 which is acquired by process 2, and process 2 is waiting for resource 1.


Necessary Conditions for Deadlock in OS

Deadlock can arise if the following four conditions hold simultaneously (Necessary Conditions)


1.Mutual Exclusion: Two or more resources are non-shareable (Only one process can use at a time).

2.Hold and Wait: A process is holding at least one resource and waiting for resources.

3.No Preemption: A resource cannot be taken from a process unless the process releases the resource.

4.Circular Wait: A set of processes waiting for each other in circular form.


What is Deadlock Detection?

Deadlock detection is a process in computing where the system checks if there are any sets of processes that are stuck waiting for each other indefinitely, preventing them from moving forward. In simple words, deadlock detection is the process of finding out whether any process are stuck in loop or not.



Comments ()


Sign in

Read Next

Can ChatGPT Answer All My Questions About Life?

Blog banner

OPERATING SYSTEM

Blog banner

10 Signs your Computer has Virus

Blog banner

SECURITY RISKS OF REMOTE WORKING

Blog banner

THE LEGAL ISSUES OF COMPUTER FORENSICS IN INDIA

Blog banner

Music

Blog banner

Supervised and Unsupervised Learning

Blog banner

operating system

Blog banner

Scala - a programming tool

Blog banner

Global versus Indian Mental Health Differences

Blog banner

Automating OSINT tasks for efficient Cyber Forensics Investigations

Blog banner

John Titor: The Time Traveler

Blog banner

Proton mail

Blog banner

Technical SEO : Total Guide

Blog banner

How To Invest In Indian Stock Market @ BSE & NSE ~ Tutorial 3

Blog banner

Secure Hypertext transfer protocol

Blog banner

Smitten Kitchen Keepers

Blog banner

Deadlock and Starvation

Blog banner

"Can Lisp do Machine Learning?"

Blog banner

Technical Challenges and Directions for Digital Forensics

Blog banner

Threads

Blog banner

Be you

Blog banner

15 Interesting Facts about India

Blog banner

Yoga in INDIA and ABROAD

Blog banner

BUSINESS MODELS OF E COMMERCE

Blog banner

Short note on expert system

Blog banner

I/O Buffering

Blog banner

What do you mean by online marketing and why do you need to know about it

Blog banner

About myself

Blog banner

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

CoWIN

Blog banner

Is Brushing After Eating Damaging Your Teeth? (Fact or Myth)

Blog banner

Data Mining

Blog banner

Dangers of Using Public WiFis

Blog banner

Process State

Blog banner

What is thread and alse multithreading

Blog banner

Social Media.

Blog banner

10 Unknown facts about India's Independence

Blog banner

Telegram and it's features

Blog banner

Festive Ethnic Wear Guide: Patola-Inspired Looks for Every Celebration

Blog banner

Why Time Management Is the Secret to College Success (and How to Master It)

Blog banner

Virtual memory

Blog banner