wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

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

Modern Operating System - Khush bagaria

Blog banner

The role of artificial intelligence in automating digital forensic analysis.

Blog banner

memory managment

Blog banner

Friendship

Blog banner

Multicore and Multithreading

Blog banner

Online Games

Blog banner

"Games and the future"

Blog banner

History of Money

Blog banner

Concurrency and memory

Blog banner

Title: Network Sniffing Techniques: Uncovering the Secrets of Data Transfer

Blog banner

10 Unknown facts about India's Independence

Blog banner

Open Source Project By Google

Blog banner

Deadlock and Starvation

Blog banner

Data Science & AI

Blog banner

Safe Learning Spaces: Why Preschool Environment Matters More Than Ever Today

Blog banner

10 Reasons Why Guy BestFriends are the Must in Every Girl's Life

Blog banner

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

Blog banner

MACHINE LEARNING

Blog banner

Why Skipping Afternoon Meals Affects More Than Just Your Hunger?

Blog banner

Student Grade Calculator in LISP

Blog banner

Memory Management in Operating System

Blog banner

Service Validation and Testing during the Design Phase

Blog banner

AI and cyber Security

Blog banner

Hash password! Is it really secured?

Blog banner

How Do I Get Rid of My People-Pleasing Behaviour?

Blog banner

Cache Memory

Blog banner

Linux

Blog banner

Virtual Machine

Blog banner

Dancing Classes In Mumbai

Blog banner

Shoulders

Blog banner

Virtual Memory

Blog banner

Deadlock and Starvation in an Operating System

Blog banner

INTERNET SECURITY

Blog banner

ITIL Version 3 and 4 differenciation?

Blog banner

Deadlock and Starvation

Blog banner

Music is life

Blog banner

Is Social Media Marketing The Next Wave Of Digital Marketing?

Blog banner

Different memory allocation strategies

Blog banner

“Shot on iPhone” : A campaign by Apple that turned into a prodigy

Blog banner

DATA WRANGLING

Blog banner

The New Classic: Indo Western Patola Outfits for Today’s Woman

Blog banner

CyberSecurity Color Wheel

Blog banner