wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

Deadlock and Starvation

profile
Supriya Nagraj
Aug 14, 2024
0 Likes
0 Discussions
68 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

I/O buffer and its techniques

Blog banner

Trends that began during the pandemic

Blog banner

Mouth Ulcers: Why Do They Keep Popping Up and How Can You Actually Get Rid of Them?

Blog banner

Memory Management

Blog banner

No Compromise on Health: How Meal Maharaj Brings “Freshly cooked meals” to Your Office Desk

Blog banner

Understanding Toddler Tantrums: What They Really Mean

Blog banner

Dos (Denial of service) Attack

Blog banner

Virtual Machine

Blog banner

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

Blog banner

E-BUSINESS RISK MANAGEMENT

Blog banner

10 Signs That Prove YOU are his FIRST priority.

Blog banner

CONCURRENCY: MUTUAL EXCLUSION AND SYNCHRONIZATION-het karia

Blog banner

Buffer Overflow

Blog banner

Incident management in ITSM

Blog banner

Service Transition Process in ITSM

Blog banner

Why Data Privacy Is Changing Online Advertising

Blog banner

Student Grade Calculator in LISP

Blog banner

Getting to Kashmir: Alternative to the Jammu-Srinagar highway

Blog banner

ACHIEVEMENTS IN OPERATING SYSTEMS

Blog banner

Exploring Human Factors in Cyber Forensics Investigations.

Blog banner

RAID and It's Levels

Blog banner

What is HTML?

Blog banner

Deadlock

Blog banner

Zomato's Secret Digital Marketing Techniques!

Blog banner

K-means use cases

Blog banner

Decoding Modern Assessment: Why We Look Beyond the Grade Sheet

Blog banner

Yoga in INDIA and ABROAD

Blog banner

Maharashtrian culture: Tradition, Art, Food

Blog banner

Education?

Blog banner

Koinex is shutting down and here is how you can withdraw...

Blog banner

Have You Explored India Yet?

Blog banner

Business-to-Business

Blog banner

Modern Operating Systems

Blog banner

SQL Injection practice on DVWA

Blog banner

Why Progressive Web Apps (PWAs) Are Replacing Traditional Websites

Blog banner

Device driver

Blog banner

Inventory management software system

Blog banner

Segmentation and paging concept

Blog banner

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

Blog banner

Earth with no trees

Blog banner

Fault tolerance

Blog banner

undefined

Blog banner