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

Uniprocessor Scheduling

Blog banner

Building a Simple Doctor Appointment System in Common Lisp

Blog banner

Remote Work in 2026

Blog banner

Raid

Blog banner

Memory management

Blog banner

Memory Management

Blog banner

About myself

Blog banner

Subnet Masking

Blog banner

Data Lake

Blog banner

KAHAWA TEA

Blog banner

Heart Fulness Meditation

Blog banner

HTML vs HTML5

Blog banner

TEAMWORK

Blog banner

Security issues

Blog banner

Os Virtual Memory

Blog banner

Deadlock

Blog banner

A-B-C of Networking: Part-1 (Basics)

Blog banner

VIRTUAL MACHINE

Blog banner

5 People who claimed to have Time Traveled

Blog banner

STUDY OF SYSTEM HACKING TOOLS

Blog banner

objectives and functions of operating system

Blog banner

Hosting basics

Blog banner

Why Inconel 625 and Monel 400 Remain Unbeatable in Refinery Applications?

Blog banner

security requirements for safe e-payment

Blog banner

Decoding Confusion Matrix

Blog banner

What is Data, Information and Knowledge?

Blog banner

How I use google in my daily life

Blog banner

Old age lifestyle

Blog banner

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

Blog banner

Nature’s Brush on Silk: The Secret Behind Patola Colours

Blog banner

Memory Management

Blog banner

COMFORT IS ALL ABOUT FASHION

Blog banner

Classification Algorithms (Decision trees, SVM, Logistic regreession)

Blog banner

Zomato (Income Sources)

Blog banner

Study of Backdoor and Trojan tools

Blog banner

1 Dentist in Maroubra, Sydney and her 10 obsessions

Blog banner

Why You Should Not Use Free VPNs

Blog banner

Culture Of Ladakh

Blog banner

Data-Driven Prediction of Virtual Item Prices in Online Games

Blog banner

10 Reasons Why Guy BestFriends are the Must in Every Girl's Life

Blog banner

POSITIVE ATTITUDE IN LIFE

Blog banner

Direct memory access (DMA)

Blog banner