wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock and Starvation

profile
Supriya Nagraj
Aug 14, 2024
0 Likes
0 Discussions
56 Reads

-Deadlock


Deadlock is a situation in computing where two or more processes are unable to proceed because each one is waiting for a resource that the other has locked. 


In technical terms, deadlock occurs when the following four conditions are met simultaneously:


1. Mutual Exclusion: At least one resource must be held in a non-shareable mode. Only one process can use the resource at a time.

2. Hold and Wait : A process is holding at least one resource and is waiting to acquire additional resources that are currently being held by other processes.

3. No Preemption : A resource cannot be forcibly taken away from a process. The process must release the resource voluntarily.

4. Circular Wait: There exists a set of processes where each process is waiting for a resource that is held by the next process in the chain, forming a circular chain of dependencies.


In a deadlock, none of the processes can proceed, and they remain stuck indefinitely unless an external action is taken to break the deadlock, such as terminating a process or forcibly taking resources.


-Starvation


Starvation is a condition where a process is perpetually denied the resources it needs to proceed because other processes are continuously being prioritized over it.


Starvation can occur in situations where:


  1. Resource Allocation Policies: If the system's resource allocation policy unfairly favors some processes over others, a low-priority process may be consistently delayed or ignored.

2. Priority Scheduling: In systems that use priority scheduling, a high-priority process may keep interrupting a lower-priority one, causing the latter to wait indefinitely.

3. Resource Contention: If a resource is constantly being used by other processes, the starved process might never get access to it.


Starvation is different from deadlock because, in a deadlock, the processes involved are permanently stuck, whereas in starvation, a process may eventually get the resources it needs if the circumstances change. However, in extreme cases, starvation can lead to a situation where a process never gets the resources it needs, effectively being "starved" indefinitely.


Comments ()


Sign in

Read Next

OS PROCESS DESCRIPTION AND CONTROL-SARVAGYA JALAN

Blog banner

Women’s Mental Health (After Marriage)

Blog banner

The Future of Web Development in 2026: Trends Every Business Must Know

Blog banner

Linux Virtual Machine Process Scheduling

Blog banner

How to use GIT & GITHUB

Blog banner

Why do you need a personalised bag tag for your kids' school bags?

Blog banner

What is M-commerce and how it's work

Blog banner

10 Types of Friends in every friend group

Blog banner

Street foods

Blog banner

Virtual memory

Blog banner

MODERN OPERATING SYSTEM

Blog banner

Why Users Leave Your Website in 5 Seconds (And How UI/UX Fixes It)

Blog banner

Data Exfiltration

Blog banner

Child labour

Blog banner

Evolution of Operating system.

Blog banner

Daycare Centres Help Children Transition into Structured Learning

Blog banner

Internet of Things and cyber security

Blog banner

SECURITY VULNERABILITIES COUNTERMEASURES IN A SMART SHIP SYSTEM

Blog banner

EVOLUTION OF THE MIRCOPROCESSOR

Blog banner

Hubspot

Blog banner

INTRODUCTION TO C#

Blog banner

Types of Hackers.

Blog banner

A Happier Workplace Starts with Healthy Lunches by Meal Maharaj

Blog banner

What is Amazon?

Blog banner

Sleep Disorder: The Silent Link Between Sleep and Mental Health

Blog banner

MAHAKAL LOK UJJAIN

Blog banner

Virtual Machine's

Blog banner

Scheduling

Blog banner

virtual memory

Blog banner

File management In Operating System

Blog banner

objectives and function of operating system

Blog banner

Risk factors in service transistion

Blog banner

Mail merge

Blog banner

Financial Fraud Detection

Blog banner

Pipedrive

Blog banner

Sessions In OS.

Blog banner

The Power of Cyber Forensic in Solving Crimes

Blog banner

Decision Tree: A Diagram Model

Blog banner

Save Environment

Blog banner

Threads

Blog banner

A Deep Dive

Blog banner

How return on investment is defined in IT services

Blog banner