wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

profile
Nihar Kotadia
Aug 13, 2024
0 Likes
0 Discussions
162 Reads

In Operating Systems, concurrency refers to the ability of multiple processes to execute simultaneously, sharing common resources such as CPU time, memory, and I/O devices. However, this concurrency can lead to two major problems: Deadlock and Starvation.

Deadlock:

A deadlock is a situation where two or more processes are blocked indefinitely, each waiting for the other to release a resource. This occurs when the following four conditions are met:

  1. Mutual Exclusion: Two or more processes require exclusive access to a common resource.
  2. Hold and Wait: A process holds a resource and waits for another resource, which is held by another process.
  3. No Preemption: The operating system cannot preempt a process holding a resource.
  4. Circular Wait: A circular chain of processes exists, where each process waits for a resource held by the next process in the chain.

Starvation:

Starvation is a situation where a process is unable to gain access to a shared resource and is indefinitely postponed. This occurs when a process is waiting for a resource that is being held by another process, and the waiting process is not given a chance to execute.

Causes of Starvation:

  1. Priority Scheduling: A process with a lower priority may be starved of CPU time if a higher-priority process is always running.
  2. Resource Constraints: A process may be starved of a resource if another process is holding onto it for an extended period.
  3. Scheduling Algorithms: Certain scheduling algorithms, such as First-Come-First-Served (FCFS), can lead to starvation.

Prevention of Deadlock and Starvation:

To prevent deadlock and starvation, operating systems use various techniques, including:

  1. Resource Ordering: Ordering resources to prevent circular waits.
  2. Banker's Algorithm: A resource allocation algorithm that prevents deadlock.
  3. Priority Ceiling Protocol: A protocol that prevents starvation by assigning a priority ceiling to each resource.
  4. Scheduling Algorithms: Using scheduling algorithms that prevent starvation, such as Round Robin (RR) and Multilevel Feedback Queue (MFQ).

Comments ()


Sign in

Read Next

SQL Injection Techniques

Blog banner

Decision Tree: A Diagram Model

Blog banner

Service stratergy principles

Blog banner

AI & Data Science in Healthcare – Predicting diseases, medical imaging analysis

Blog banner

Concurrency and Deadlocks

Blog banner

Senseless Teeths

Blog banner

Understanding Endometriosis and Its Psychological Impact on Quality of Life

Blog banner

KAHAWA TEA

Blog banner

Online Games

Blog banner

Sleep Matters: The Science Behind Toddler Naps

Blog banner

TOGETHER WE CAN CONQUER #team

Blog banner

Top 5 Post-Wedding Skin Care Tips

Blog banner

Smartphone Security: Vulnerabilities and Attacks

Blog banner

Expert System In AI

Blog banner

LiquidPlanner

Blog banner

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

Blog banner

MOVEMBER

Blog banner

Health and fitness

Blog banner

Salt, Sand, and Smiles: Does the Maroubra Lifestyle Affect Your Enamel?

Blog banner

Lucidchart

Blog banner

What is OS and its overview

Blog banner

SMARTSHEET MANAGEMENT SYSTEM

Blog banner

Data Visualization

Blog banner

Memory Management Techniques

Blog banner

Consumer to consumer Business model

Blog banner

Deadlock and Starvation

Blog banner

The Bold Digital Marketing Moves That Made Durex India’s Second-Largest Condom Brand

Blog banner

?How long does wisdom tooth pain last?

Blog banner

Digital Balance: Keeping Children Mindful in the Screen Age

Blog banner

Install Ubuntu in Vmware

Blog banner

How Laughing Gas Makes Your Dental Visit So Much Easier

Blog banner

Social Media Sentiment Analysis

Blog banner

Big Data Architecture

Blog banner

Types of email

Blog banner

BrainGate Technology

Blog banner

A Heartfelt Act of Kindness

Blog banner

SAVE TREES

Blog banner

Earth with no trees

Blog banner

Volatile Memory & Non-Volatile Memory Explained

Blog banner

"Mahakali cave"

Blog banner

History of ITIL

Blog banner

SECURITY TOOLS

Blog banner