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

Understanding the 4 Types of Learning Methods in Early Childhood

Blog banner

Building a Simple Doctor Appointment System in Common Lisp

Blog banner

Eating Well With Meal Maharaj on Busy Workdays Without Cooking

Blog banner

THREADS (assignment 1)

Blog banner

Ghee vs. Coconut Oil vs. Mustard Oil: Which Cooking Fat Wins for Indian Food?

Blog banner

Deadlock and Starvation

Blog banner

Mental Health at Midlife: When Life Transitions Become Emotional Turning Points

Blog banner

The New Dr. Frankenstein who will perform first full head transplant

Blog banner

What is semaphore in operating system?

Blog banner

Modern Operating System - Suren Kotian

Blog banner

Women Empowerment

Blog banner

GIS Bharat Maps

Blog banner

Importance of business process documentation

Blog banner

CSI and Organizational Change

Blog banner

Cybersecurity Standards for Automotive

Blog banner

?How long does wisdom tooth pain last?

Blog banner

10 Survival Tips that might save your life

Blog banner

MySQL

Blog banner

How I use google in my daily life

Blog banner

The Evolution of Operating Systems

Blog banner

How Social Media Algorithms Will Work in 2026?

Blog banner

“CONSISTENCY” in Social Media Marketing

Blog banner

Modern Teaching Methods: Why Inquiry-based & Experiential Learning Works Best

Blog banner

Steganography

Blog banner

Earth with no trees

Blog banner

Big Data Architecture

Blog banner

15 Websites that will make your life easier ...!!!

Blog banner

The Art of Slow Fashion: Why Patola Defines Sustainable Luxury

Blog banner

Security in Cloud Computing Environment using cryptography - Rushabh Modi

Blog banner

Disk Scheduling

Blog banner

Understanding the 'Ambiverts'

Blog banner

Business Intelligence v/s Big Data

Blog banner

File sharing

Blog banner

Fitness

Blog banner

The Everyday Parenting Dilemma: Safety Vs Independence

Blog banner

An Overview of Virtual Machines

Blog banner

10 Interesting Facts about Attack on Titan

Blog banner

The Joy of Giving: How Festivals Teach Children Empathy and Gratitude

Blog banner

Why Oak Tree Hotel Is Arcadia’s Hidden Gem?

Blog banner

Denial-of-Service and Distributed Denial-of-Service Attack Techniques

Blog banner

Virtual memory

Blog banner

Web browser forensics:Tools,Evidence collection and analysis

Blog banner