wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

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

MySQL

Blog banner

Virtual memory

Blog banner

Process and Threading

Blog banner

10 Interesting Facts about Attack on Titan

Blog banner

5 Stages of Digital Marketing

Blog banner

What is Spyware? and examples of them.

Blog banner

What makes Nugget RC Racing Florida’s Most Exciting Racing Events?

Blog banner

Importance of business process documentation

Blog banner

My 1stNull Puliya session

Blog banner

Celebrate Diwali the Delicious Way with Meal Maharaj Catering

Blog banner

A-B-C of Networking: Part-3 (Topology [Ring, Tree, Mesh])

Blog banner

Virtual Memory

Blog banner

Multithreading in Operating System

Blog banner

INSTAGRAM

Blog banner

Data Warehouse Bus Matrix

Blog banner

FAMILY WHERE LIFE BEGINS....

Blog banner

Virtual Machine

Blog banner

Memory Management Techniques

Blog banner

Malware Detection Techniques for Mobile Devices

Blog banner

 " Healing of Yoga "

Blog banner

Hey Aryan here

Blog banner

Senseless Teeths

Blog banner

Privacy LAWs in IT

Blog banner

QUANTUM COMPUTING IN SECURITY:A GAME CHANGER IN DIGITAL WORLD

Blog banner

Product Discount Calculator

Blog banner

The Secure Software Development Life Cycle (SDLC)

Blog banner

Memory management

Blog banner

Fault tolerance

Blog banner

Social Network Analysis: Ek Naya Nazariya Data Science Mein

Blog banner

Service Design Model

Blog banner

Know your Processors!

Blog banner

Article on different management system

Blog banner

INTRODUCTION TO C#

Blog banner

Emotional Intelligence in Children: Why It Is as Important as Academics

Blog banner

Types of OS

Blog banner

The Future of Patola Weaving in a Sustainable Fashion World

Blog banner

Threads

Blog banner

Cache memory

Blog banner

Two major obstacle to India’s economic growth: Twin Balance Sheet and Lower Private Investments

Blog banner

" THE ANSWERS THAT LED INDIAN BEAUTIES TO THE MISS UNIVERSE HISTORIC WIN. "

Blog banner

E-commerce

Blog banner

Instagram Features in 2023 That Will Leave You Stunned!

Blog banner