wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

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

Street foods

Blog banner

Deadlock in operating system

Blog banner

Hacking

Blog banner

1 Dentist in Maroubra, Sydney and her 10 obsessions

Blog banner

Operating system

Blog banner

CSI and Organizational Change

Blog banner

Perfect Moments to Wear a Rich Patola Design Outfit

Blog banner

Different Types of Data

Blog banner

Operating system

Blog banner

Data Science in Predictive Analytics: Transforming Business Decision-Making

Blog banner

Kafka - A Framework

Blog banner

GIS Mapping

Blog banner

Deadlocks in operating system

Blog banner

Cyber Forensic in the Banking sector

Blog banner

KEAP MANAGEMENT SYSTEM

Blog banner

Security Issues and Countermeasures

Blog banner

What is Spyware?

Blog banner

MAHAKAL LOK UJJAIN

Blog banner

virtual machines and virtualization

Blog banner

Method of Evaluating Information Security Level in an Organization

Blog banner

Getting to Kashmir: Alternative to the Jammu-Srinagar highway

Blog banner

How India made the GIS its Own, and its Use in Infrastructural Developments

Blog banner

Why Inconel 625 and Monel 400 Remain Unbeatable in Refinery Applications?

Blog banner

Student Grade Calculator in LISP

Blog banner

Cloud Computing

Blog banner

GIS in Mapping and landslide alert in Bangladesh

Blog banner

PERSONALITY DEVELOPMENT

Blog banner

Security and E-mail

Blog banner

Kernel Memory Allocation In Linux.

Blog banner

India Digital Personal Data Protection Act, 2023

Blog banner

Digital Forensics Challenges and Tools

Blog banner

Volatile Memory & Non-Volatile Memory Explained

Blog banner

Toothache at night? What does this mean, and how to cope with it?

Blog banner

How to Plan a Week of Healthy Meals Without Stress

Blog banner

Interrupts in OS

Blog banner

File management

Blog banner

The Lunchbox That Came Back Untouched — How to Handle a Fussy Eater at Preschool Age

Blog banner

Amazon

Blog banner

INDIAN CHEAPEST COSMETICS BRAND

Blog banner

How to setup a professional looking business account on Instagram?

Blog banner

Regression Analysis

Blog banner

Paginng In OS

Blog banner