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

How to Encrypt and Decrypt Using GNU PGP

Blog banner

Data Science in Everyday Life (like a phone, shopping cart, or social media icons)

Blog banner

BEAUTY IS IN THE EYE OF THE BEHOLDER

Blog banner

The art of being alone

Blog banner

15 Interesting Facts about India

Blog banner

The application udemy

Blog banner

A-B-C of Networking: Part-3 (Topology [Ring, Tree, Mesh])

Blog banner

PERT Overview

Blog banner

The Future of Patola Weaving in a Sustainable Fashion World

Blog banner

Virtual Machine's

Blog banner

Memory management

Blog banner

12 Principles of Animation

Blog banner

Malware Detection Techniques for Mobile Devices

Blog banner

Deadlock

Blog banner

Understanding Univariate, Bivariate, and Multivariate Analysis in Data Science

Blog banner

Importance of education

Blog banner

THE INPACT OF SOCIAL MEDIA!

Blog banner

How to Build an Effective Digital Campaign

Blog banner

ONLINE NEWSROOMS

Blog banner

Dekkers Algorithm : Ensuring Safe Process Synchronization

Blog banner

INTERNET SECURITY

Blog banner

Types of Malware in Cyber Security

Blog banner

Exploring the Power of Encase Forensic Tools: Unraveling Digital Mysteries

Blog banner

Virtual Memory

Blog banner

Virtual Machine

Blog banner

memory cache

Blog banner

Virtual memory

Blog banner

What is Data, Information and Knowledge?

Blog banner

Drawing tips for a beginner

Blog banner

Virtual Machine

Blog banner

Smitten Kitchen Keepers

Blog banner

Senseless Teeths

Blog banner

The Rich Heritage Of Patola Sarees: Gujarat’s Timeless Weaving Art

Blog banner

Power of words

Blog banner

Hot Mango Pickle (Methiyu)

Blog banner

How to Find the Right Therapist For Me?

Blog banner

File Sharing

Blog banner

Memory

Blog banner

Memory Management

Blog banner

Multicore and multithreading 171

Blog banner

The Evolution of Operating Systems

Blog banner

Exploring Florida Beyond the Obvious Tourist Trails

Blog banner