wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

OS Assignment-3

profile
Nikita Mitna
Aug 13, 2024
0 Likes
0 Discussions
33 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

Toothache Causes: Common Tooth Pain Reasons & When to See a Dentist

Blog banner

First-Order Logic (FOL): The Foundation of Modern Logic

Blog banner

THE LEGAL ISSUES OF COMPUTER FORENSICS IN INDIA

Blog banner

Optimization of operating system design

Blog banner

SWEET SHREDDED MANGO CHUNDA (MANGO CHUNDA)

Blog banner

Deadlock

Blog banner

Travelling blog

Blog banner

Spyware

Blog banner

1.1 basic elements

Blog banner

How to make Pancakes

Blog banner

Raid and levels of raid.

Blog banner

THE ACTORS LIFE

Blog banner

From Loom to Luxury: How Patola Elevates Modern Wardrobes

Blog banner

THE DESIRE OF MANY

Blog banner

City2Surf & Spring Fitness Recovery Guide: How Sports Drinks Silently Damage Enamel

Blog banner

All you need to know about Website Traffic

Blog banner

Know your Processors!

Blog banner

The Peephole

Blog banner

Emotional Suppression: The Hidden Costs Of Unfelt Feelings

Blog banner

Memory Hierarchy

Blog banner

Dove’s Real Beauty Campaign- Case Study

Blog banner

Coping with Diagnosis Shock

Blog banner

?What Children Learn Between Activities: The Hidden Learning Moments in a Preschool Day

Blog banner

Deadlock and Starvation

Blog banner

The seven-step improvement process

Blog banner

On-Page SEO

Blog banner

Python as a tool for data analysis

Blog banner

FOMO Fear of Missing Out: When Comparison Steals Your Peace of Mind

Blog banner

Eating Well With Meal Maharaj on Busy Workdays Without Cooking

Blog banner

How to Manage Employees and Tasks in One System (Without Excel)

Blog banner

A buffer overflow

Blog banner

Virtualisation

Blog banner

Music

Blog banner

The New Classic: Indo Western Patola Outfits for Today’s Woman

Blog banner

Why Soft Skills Matter as Much as Grades?

Blog banner

Session Hijacking

Blog banner

What if COVID does not exist!

Blog banner

Modern Operating System

Blog banner

Protein and Energy: Why Your Workday Diet Needs More of It

Blog banner

Malware

Blog banner

Understanding - Proof of Work!

Blog banner

Cyber-crime Investigation and Future Directions

Blog banner