wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

profile
Nihar Kotadia
Aug 13, 2024
0 Likes
0 Discussions
171 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

E-security systems | CCTV

Blog banner

Virtual Machine

Blog banner

Kernel in Operating System

Blog banner

STUDY OF SYSTEM HACKING TOOLS

Blog banner

Theads

Blog banner

Starvation

Blog banner

MODERN OPERATING SYSTEM

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

Different types of e-commerce platforms or advantages and disadvantages

Blog banner

OS Assignment 3 Deadlock

Blog banner

The Danger of Irregular Meals: Why Skipping Lunch or Eating Late Ruins Your Metabolism

Blog banner

Protect yourself from System Hacking with these Simple Steps

Blog banner

Memory Management in Operating System

Blog banner

Understanding Toddler Tantrums: What They Really Mean

Blog banner

Deadlock

Blog banner

PROCESS STATES OF OPERATING SYSTEM

Blog banner

Sleep Matters: The Science Behind Toddler Naps

Blog banner

A book review

Blog banner

Mental Health in a 24/7 World : Learning the Psychology of switching off

Blog banner

Understanding Suicidal Thoughts and Self-Harm: Recognising the Signs and Finding Hope

Blog banner

VIRTUAL MACHINE

Blog banner

Best password managers: Reviews of the top products

Blog banner

City2Surf & Spring Fitness Recovery Guide: How Sports Drinks Silently Damage Enamel

Blog banner

Constrained Management in IT

Blog banner

Monday. com App

Blog banner

indian premier league

Blog banner

CONCURRENCY

Blog banner

Raising mental health burden: A global and Indian perspective

Blog banner

Compromising Mobile Platforms

Blog banner

Spotify

Blog banner

Security issues

Blog banner

Cloud Computing

Blog banner

Practical Implementation of Client Server model using TCP/IP.

Blog banner

Cloud Security: Trends and Innovations

Blog banner

How to Add Super Seeds to Your Everyday Meals: Easy & Healthy Ideas

Blog banner

Virtual Machine

Blog banner

Information Technology In E- Commerce

Blog banner

BENIFITS OF YOGA

Blog banner

How HRMS, Task Management, and Team Chats Can Improve Workplace Productivity

Blog banner

Understanding Portion Control: How Much Food Do You Really Need?

Blog banner

38_Exploring The Honeynet Project

Blog banner

Modern Operating Systems.

Blog banner