wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock and Starvation

profile
Shubham Yadav
Aug 15, 2024
0 Likes
0 Discussions
50 Reads

1. Deadlock


Deadlock in an operating system occurs when a set of processes become stuck because each process is waiting for a resource that another process holds, and none of the processes can proceed. This situation usually arises in multi-process systems where processes share resources such as files, memory, or devices. The four necessary conditions for deadlock, often referred to as Coffman’s conditions, are mutual exclusion, hold and wait, no preemption, and circular wait. If all these conditions hold simultaneously, the system can enter a deadlock state. Deadlocks can be addressed through prevention, avoidance, or detection and recovery methods. Prevention involves designing the system to negate one or more of the Coffman conditions, while avoidance uses algorithms like Banker’s Algorithm to ensure the system never enters an unsafe state. Detection and recovery involve allowing the deadlock to occur but having mechanisms to identify and resolve it by terminating processes or rolling them back.


2.Starvation


Starvation occurs in an operating system when a process waits indefinitely to gain access to a resource it needs, even though the resource is available at times. This typically happens in scheduling algorithms that favor certain processes over others, like when a low-priority process is continually preempted by higher-priority processes. Starvation is a significant problem because it can lead to reduced system performance and inefficiency. Solutions to starvation include using aging, a technique where the priority of a waiting process is gradually increased, ensuring that every process eventually gets a chance to execute. By incorporating aging into scheduling algorithms, the operating system can prevent starvation by ensuring that processes waiting for resources for a long time are eventually given access, thus maintaining system fairness.


Comments ()


Sign in

Read Next

Ethical Hacking

Blog banner

How to make Pancakes

Blog banner

semaphores in os

Blog banner

CREATE A DAILY SERIES

Blog banner

Linux Memory Management

Blog banner

Threading

Blog banner

Operating Systems Overview

Blog banner

Education?

Blog banner

Top 3 Places To Stay In Vienna

Blog banner

IT service level agreement

Blog banner

Working with AES cryptographic algorithm using crypto++

Blog banner

Telegram and it's features

Blog banner

Scheduling in Operating Systems

Blog banner

INTERNET

Blog banner

MACHINE LEARNING

Blog banner

I/O Buffering

Blog banner

Raid

Blog banner

Working with Sniffers for monitoring network communication

Blog banner

Disk scheduling

Blog banner

Capacity management in ITSM

Blog banner

SMARTSHEET

Blog banner

Types of Threads

Blog banner

Firewall in Computer Network

Blog banner

The Role of Cyber Forensics in Criminology

Blog banner

Cyber Forensics on IOT Devices

Blog banner

MORDERN UNIX SYSTEM

Blog banner

Deadlock

Blog banner

DATA VAULT

Blog banner

Data Exfiltration

Blog banner

geographic information system (GIS)

Blog banner

Operating System

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

HUBSPOT

Blog banner

Modern Operating System

Blog banner

TECHNOLOGY : BOON OR CURSE ?

Blog banner

Topic: Sessions in Operating system

Blog banner

The Power of Teamwork: Learning Collaboration Through Everyday Activities

Blog banner

VIDEO INTERVIEWS : A NEW ECOSYSTEM TO GET DREAM JOBS

Blog banner

Sleep Matters: The Science Behind Toddler Naps

Blog banner

Teamwork

Blog banner

Processing Crime and Incident Scenes

Blog banner

Electronic Funds Transfer

Blog banner