wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

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

Mumbai famous street food

Blog banner

Severe landslides continue to cause concern in Joshimath, Uttarakhand

Blog banner

Importance Of Yoga.

Blog banner

Blog name

Blog banner

Jira service Management

Blog banner

All you need to know about Website Traffic

Blog banner

The Rich Heritage Of Patola Sarees: Gujarat’s Timeless Weaving Art

Blog banner

Concurrency and memory

Blog banner

M commerce

Blog banner

The Chapped Lips and Dry Mouth Trap: The Sneaky Reason Cavities Spike in Winter

Blog banner

Deadlock

Blog banner

GIS REMOTE SENSING

Blog banner

Deadlock

Blog banner

Charcoal, Lemon, and DIY Kits: Which “Viral” Dental Trends Are Actually Dangerous?

Blog banner

Deadlock and Starvation

Blog banner

Virtualization

Blog banner

How to use GIT & GITHUB

Blog banner

MEMORY FORENSIC ACQUISITION AND ANALYSISOF MEMORY AND ITS TOOLS COMPARISON

Blog banner

Phishing Isn't Getting Smarter — You're Just Seeing More of It

Blog banner

Simple Ways of Avoiding Basic Mistakes in Smart Phone Security

Blog banner

The Role of cryptography in cyber security

Blog banner

Guidelines for a Low sodium Diet.

Blog banner

Sleep Matters: The Science Behind Toddler Naps

Blog banner

Why is it hard to design an Operating Systems ?

Blog banner

Memory Management in Operating System

Blog banner

Goa Trip With Friends

Blog banner

The Five Steps of Data Science

Blog banner

Uniprocessor Scheduling

Blog banner

Note Taker App

Blog banner

Old age lifestyle

Blog banner

An Overview of Virtual Machines

Blog banner

Everything You Need for a Perfect Stay in Arcadia, Florida, USA.

Blog banner

Lemon and Chilli Pickle (Limbu Mirchi Achar)

Blog banner

File Management In OS

Blog banner

Why Is Freshly Cooked Food Better Than Processed Food for Everyday Health?

Blog banner

Security issues in Sensor Networks and gathering admissible evidence in Network Forensics

Blog banner

Article on Team Work

Blog banner

Data Visualization – Importance and tools (Tableau, Power BI)

Blog banner

A-B-C of Networking: Part-1 (Basics)

Blog banner

The Laws of Karma

Blog banner

VPN

Blog banner

Types of E-Commerce

Blog banner