wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Concurrency:Deadlock and Starvation

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

Python as a tool for Data science task & project

Blog banner

10 Things To Do On Valentine's Day If You're Single

Blog banner

Top Career Paths After a B.Com Degree in Mumbai: What’s Next for You?

Blog banner

Why Travellers from Miami & Orlando Are Visiting Arcadia for Weekend Getaways?

Blog banner

FILE SHARING

Blog banner

operating system

Blog banner

Hacking

Blog banner

Confidence Building Activities for the New School Year

Blog banner

Stories Woven in Silk: The Meaning Behind Patola Motifs

Blog banner

The Psychology of Diversity, Equity & Inclusion: How Inclusive Workplaces Boost Productivity

Blog banner

Best password managers: Reviews of the top products

Blog banner

Multicore CPUs

Blog banner

Social engineering in cyber security

Blog banner

Why Mumbai Professionals Are Switching Back to Home-Style Tiffin Meals

Blog banner

Understanding the 4 Types of Learning Methods in Early Childhood

Blog banner

Deadlock and Starvation

Blog banner

Indian Culture and Tradition

Blog banner

Multiprocessor and Multicore Organization

Blog banner

Virtual memory

Blog banner

Memory Management

Blog banner

Booting Process In Operating System

Blog banner

How Harshad Valia International School is nurturing India’s Young Minds?

Blog banner

EMAIL INVESTIGATION

Blog banner

How Does Preschool Help Children Become Better Decision Makers?

Blog banner

What is Email? Uses of Emails

Blog banner

Paddle Through Paradise: The Best Kayak Launch Points Near Arcadia

Blog banner

Affiliate Marketing V/S Influencer Marketing

Blog banner

Palliative and End — of — Life Care: A Psychological and Holistic Perspective

Blog banner

How Sleep Impacts Learning and Behaviour for Toddlers?

Blog banner

IT service level agreement

Blog banner

File system implementation

Blog banner

What is time ? The term which has astonished Scientists

Blog banner

Online Education

Blog banner

?Why Social and Emotional Skills Matter More Than ABCs in Early Years?

Blog banner

Understanding Loneliness: Why We Feel Disconnected in a Connected World (Part -1)

Blog banner

IOT- Internet Of Things

Blog banner

Buffering

Blog banner

Consumer to consumer business mode

Blog banner

Predictive Analytics: How Data Science Predicts Trends(Weather ,Stock Market,Sales Forecasting ).

Blog banner

MOBILE DEVICE FORENSIC

Blog banner

Virtual Memory

Blog banner

Reclaim Your Bite and Beauty: All About Dental Restorative Treatments

Blog banner