wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock and Starvation

profile
Suren Kotian
Aug 13, 2024
0 Likes
0 Discussions
158 Reads

Deadlock

Definition
A deadlock is a situation in which the operating system has a set of processes that are permanently blocked. Each process in the set is waiting for a resource that is held by another process in the set.
This circular wait completes a cycle, making each process unable to proceed.


Conditions for Deadlock
Deadlock can occur only if all the following four conditions hold simultaneously:

Mutual Exclusion: At least one resource has to be held in a non-shareable mode.

Hold and Wait: There has to be a process holding at least one resource, waiting to get additional resources from other processes.
No Preemption: Resources cannot be taken forcefully from the processes having those resources; these have to be released voluntarily.

Circular wait: That is, a set of processes must exist such that every process is waiting for a resource that the next process in the set possesses. In effect, they are all waiting for each other, forming a circle.


Prevention and Avoidance
Prevention: Design resource allocation policy of the system such that at least one of the above necessary conditions cannot occur.
For example, require that all resources a process will need be requested at once.
Avoidance: Run-time resource-allocation state is dynamically analyzed to ensure that a circular wait condition can never occur. Banker algorithm is an example of a dead lock avoidance algorithm.

 

Starvation

Definition
Starvation, also known as indefinite blocking, is a situation where a process is indefinitely deprived of the resources necessary for its execution to proceed. This usually happens due to improper resource allocation policies.

Causes
Priority Scheduling: In priority scheduling-based systems, the low priority processes starve if high-priority processes are continuously given the system's resource.

Resource Allocation: If the resources are always granted to certain processes, other processes never get the resources they require to execute.

 
Prevention
Aging: Gradually increase the priority of the waiting process in the queue for the resource. This ensures that even the low priority processes eventually do get the required resources.

Fair Share Scheduling: Resources must be allocated fairly between the processes. It can be implemented using a round-robin scheduling mechanism or other algorithms that ensure that each process gets a fair slice of resource time.

 
Conclusion
Thus, deadlock and starvation are the two major issues of operating systems that bring inefficiency into them and might eventually lead to the collapse of a system.
While it is related in some respect, deadlock implies that execution of the processes has completely come to a halt because of contention for resources; on the other hand, starvation means the processes are indefinitely delayed. Resource management policies and algorithms turn out to be essential in preventing this problem in order to enable the smooth running and efficiency of a system.


Comments ()


Sign in

Read Next

A BLOG ON MYSQL

Blog banner

Short note on expert system

Blog banner

What are Tenders its various types

Blog banner

Can a Water Flosser Replace Manual Flossing? Here’s What Dentists Say

Blog banner

RSA (Rivest-Shamir-Adelman) Algorithm

Blog banner

Solving Problems with AI: The Power of Search Algorithms

Blog banner

Denial-of-Service and Distributed Denial-of-Service Attack Techniques

Blog banner

Volatile Memory & Non-Volatile Memory Explained

Blog banner

VIRTUAL MACHINE

Blog banner

How covid-19 impacted Social media ad spend forecast globally

Blog banner

My First Dream Bike

Blog banner

Blockchain in IoT Applications

Blog banner

Biometric Authentication Vulnerabilities

Blog banner

Geographic Information Systems(By aditi Unnikrishnan)

Blog banner

Mumbai Metro 3

Blog banner

The seven-step improvement process

Blog banner

Top Career Paths After a B.Com Degree in Mumbai: What’s Next for You?

Blog banner

Interrupts - Types, Working & Importance

Blog banner

Financial Fraud Detection

Blog banner

Apple

Blog banner

HACKING MOBILE PLATFORM

Blog banner

Virtual Memory

Blog banner

Tea, Coffee, Red Wine, and Teeth: A Stain Survival Guide

Blog banner

Sniffing: A Cyber Security Threat

Blog banner

?Why Social and Emotional Skills Matter More Than ABCs in Early Years?

Blog banner

Fault Tolerance in an Operating System

Blog banner

Virtual Machine

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

Process in OS

Blog banner

MySQL

Blog banner

Trello ( management software)

Blog banner

Navigation With Indian Constellation(NavIC) by ISRO in Geographic Information Systems

Blog banner

Kernel Modes: User Mode vs. Kernel Mode - 80

Blog banner

What are the different types of E-mail crime and process of email forensic?

Blog banner

Rules and Regulations of Networking: "Standards and Protocols" - Part 2

Blog banner

Four Stalls Every Vegetarian Needs To Eat At Outside Vile Parle Station

Blog banner

Memory Management

Blog banner

City of Mumbai (Bombay):

Blog banner

Building a Better You: Fitness Tips and Inspiration.

Blog banner

Types of Threads

Blog banner

Affiliate Marketing V/S Influencer Marketing

Blog banner

Retiring ISS

Blog banner