wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

OS Assignment-3

profile
Nikita Mitna
Aug 13, 2024
0 Likes
0 Discussions
30 Reads

Concurrency in operating systems involves multiple processes or threads executing simultaneously, which can lead to complex interactions. Two common problems that arise in this context are deadlock and starvation. Here’s an overview of both:

1. *Deadlock*
A deadlock occurs when a set of processes or threads become stuck in a situation where each one is waiting for a resource that the others in the set are holding. Since none of them can proceed, they remain in this waiting state indefinitely. Four conditions are necessary for a deadlock to occur:

- *Mutual Exclusion:* At least one resource must be held in a non-sharable mode; only one process can use the resource at any given time.
- *Hold and Wait:* A process holding at least one resource is waiting to acquire additional resources that are currently being held by other processes.
- *No Preemption:* Resources cannot be forcibly taken away from a process; they must be released voluntarily.
- *Circular Wait:* A closed chain of processes exists, where each process holds a resource that the next process in the chain is waiting for.

*Example:* Consider two processes, P1 and P2. P1 holds Resource A and is waiting for Resource B, while P2 holds Resource B and is waiting for Resource A. Neither process can proceed, leading to a deadlock.

 *Deadlock Prevention and Avoidance*
- *Deadlock Prevention:* Modify one of the necessary conditions to ensure that a deadlock cannot occur (e.g., imposing a strict order on resource allocation to prevent circular wait).
- *Deadlock Avoidance:* Use algorithms (e.g., Banker's algorithm) to allocate resources in a way that ensures the system remains in a safe state.

 2. *Starvation*
Starvation, also known as indefinite blocking, occurs when a process is perpetually denied necessary resources because other processes keep gaining access to them first. Unlike deadlock, where processes stop making progress due to being stuck in a cycle, starvation involves one or more processes making no progress because they are continually bypassed.

*Example:* Consider a scheduling system where high-priority processes keep getting resources, and a low-priority process is continually skipped over, leading to starvation.

 *Solutions to Starvation*
- *Aging:* Gradually increase the priority of a waiting process over time to ensure it eventually gets the resources it needs.
- *Fair Scheduling Algorithms:* Use algorithms like round-robin or fair share that ensure all processes eventually receive attention.

 

Nikita Mitna

53003230109

Div-A

 

 


Comments ()


Sign in

Read Next

Student Grade Calculator in LISP

Blog banner

Study of Sniffing Tools

Blog banner

Pilgrimage at LOC: A privilege and a paradox

Blog banner

Women’s Mental Health (After Marriage)

Blog banner

'Positivity in life'

Blog banner

Operating system evolution

Blog banner

Types of Threads

Blog banner

PPT methodology

Blog banner

Why Are So Many Adults Getting Diagnosed with ADHD?

Blog banner

Why Data Security Is Important

Blog banner

Process states

Blog banner

“Shot on iPhone” : A campaign by Apple that turned into a prodigy

Blog banner

The Memory Hierarchy

Blog banner

MYNTRA

Blog banner

The 60-Minute Window: What to Do (And What NOT to Do) When You Knock Out a Tooth

Blog banner

Modern Operating System

Blog banner

MQTT (MQ Telemetry Transport) in Data Science

Blog banner

Service Catalogue Management

Blog banner

Why You Should Not Use Free VPNs

Blog banner

Cyber Bullying - Neeta Vonkamuti

Blog banner

Starvation and Deadlock.

Blog banner

OS Assignment 3

Blog banner

Social Engineering Attacks

Blog banner

Tea, Coffee, Red Wine, and Teeth: A Stain Survival Guide

Blog banner

The launch of UniMap by HERE

Blog banner

The Importance of Data Quality Management in Data Science

Blog banner

Im Photographer

Blog banner

Threads

Blog banner

10 Problems you face if you are an Otaku

Blog banner

Session Hijacking Techniques

Blog banner

Lucidchart

Blog banner

evolution of operating system - Disha Parekh

Blog banner

Deadlock and Starvation

Blog banner

Virtual Machine

Blog banner

Understanding Endometriosis and Its Psychological Impact on Quality of Life

Blog banner

Celebrate Diwali the Delicious Way with Meal Maharaj Catering

Blog banner

The Bold Digital Marketing Moves That Made Durex India’s Second-Largest Condom Brand

Blog banner

Security Issues and Countermeasures

Blog banner

Spitting Pink in the Sink: Why Your Gums Randomly Bleed

Blog banner

Odoo

Blog banner

Workplace mental health: A Psychological Perspective on Employee Well-being and Organizational Growth

Blog banner

Efficiency of SQL Injection Method in Preventing E-Mail Hacking

Blog banner