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

What is Data, Information and Knowledge?

Blog banner

My First Trek - Sondai, Karjat - Shoaib Malik

Blog banner

Street foods

Blog banner

Reclaim Your Bite and Beauty: All About Dental Restorative Treatments

Blog banner

The functions of operating system

Blog banner

Operating Systems

Blog banner

Threads

Blog banner

What your Favorite colour says about You?

Blog banner

Risk management in IT

Blog banner

Design Considerations for Disk Cache Management

Blog banner

What is Vishing?

Blog banner

Friendship

Blog banner

Mendeley (management software)

Blog banner

What is Spyware? and examples of them.

Blog banner

File management -disha parekh

Blog banner

UniProcessor Scheduling

Blog banner

Rain bow

Blog banner

Modern Operating System - Suren Kotian

Blog banner

Jamming Attacks in Network Security: Disrupting Communication Signals

Blog banner

38_Network Sniffing Techniques_SBC

Blog banner

Retiring ISS

Blog banner

Data Structures

Blog banner

american greatines

Blog banner

What is Packet Filtering?

Blog banner

ahh wait a min

Blog banner

Blockchain

Blog banner

Sensory Play for Toddlers: Boosting Curiosity Through Touch, Sound, and Colour

Blog banner

clock

Blog banner

Solitary Play Activities for Preschoolers: Types and Benefits

Blog banner

K-means use cases

Blog banner

Internet of Things and cyber security

Blog banner

INTERNET SECURITY

Blog banner

Types of threads

Blog banner

Throttle engine ’Sneak peek into the future’

Blog banner

MAJOR ACHIEVEMENTS OF OS

Blog banner

OS DESIGN CONSIDERATIONS FOR MULTIPROCESSOR

Blog banner

JIRA SOFTWARE

Blog banner

Product Discount Calculator

Blog banner

Modern Operating System

Blog banner

Cyber Security Control

Blog banner

Evolution of Operating Sytems

Blog banner

Shoulders

Blog banner