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

In the world of Technology...

Blog banner

Sage business cloud accounting

Blog banner

The Role of Teachers in Building a Child’s Confidence

Blog banner

Way to make your meal healthier.

Blog banner

Financial Stress and Mental Health

Blog banner

Kernel in Operating System

Blog banner

Deadlock in operating system

Blog banner

File management -disha parekh

Blog banner

Big Data Architecture

Blog banner

BIRYANI ! The history you never knew about

Blog banner

LTE Technology

Blog banner

Distributed Denial of Service (DDoS) attack

Blog banner

Android Flashlight Application

Blog banner

10 Reasons to Date a South Indian Girl

Blog banner

BUFFER OVERFLOW_142

Blog banner

BrainGate Technology

Blog banner

Population

Blog banner

Smartphone Security: Vulnerabilities and Attacks

Blog banner

Multiprocessor and scheduling

Blog banner

A little bit of salt is all the hash needs!

Blog banner

“CONSISTENCY” in Social Media Marketing

Blog banner

Search Marketing In 2026: From Keywords To Credibility And User Intent

Blog banner

Privacy-Enhancing Computation Techniques

Blog banner

Deadlock

Blog banner

Deadlock

Blog banner

Threads

Blog banner

Revolutionary AI Tool: ChatGPT

Blog banner

Threads

Blog banner

Developments in Modern Operating Systems

Blog banner

LISP - Library Management System

Blog banner

Design Considerations for Disk Cache Management

Blog banner

Full Disk Encryption

Blog banner

21ST CENTURY PATRIARCHY

Blog banner

Cache Memory

Blog banner

Salt, Sand, and Smiles: Does the Maroubra Lifestyle Affect Your Enamel?

Blog banner

PHONE TECHNOLOGY

Blog banner

Kafka - A Framework

Blog banner

?What Your Dentist Notices The Moment You Sit In The Chair

Blog banner

Blog on health and fitness

Blog banner

SPAM

Blog banner

Evolution of Operating system.

Blog banner

Race Condition

Blog banner