Safe State in operating systems

What is a state?

State of the system informs that if resources are allocated to different processes then system undergoes deadlock or not.

What is a safe state?

If the system can allocate resources to the process in such a way that it can avoid deadlock. Then the system is in a safe state.

What is the unsafe state?

If the system can’t allocate resources to the process in such a way that it can avoid deadlock. Then the system is in the safe state.

Example:

Free resources : 3

PROCESSAllocated RNeeded resources
P1410
P224
P327

 

Free resources: 1

PROCESSAllocated RNeeded resources
P1410
P244
P327

[quads id=1]

Free resources: 5

PROCESSAllocated RNeeded resources
P1410
P200
P327

 

Free resources : 0

PROCESSAllocated RNeeded resources
P1410
P200
P377

 

Free resources: 7

PROCESSAllocated RNeeded resources
P1410
P200
P300

 

Free resources: 1

PROCESSAllocated RNeeded resources
P11010
P200
P300

 

Free resources: 11

PROCESSAllocated RNeeded resources
P100
P200
P300

Result: All processes execute successfully, so there is no deadlock and the system is in the safe state.

Fazal Rehman Shamil Click Here to Know More
Instructor, Researcher, Blogger, SEO Expert, Poet and Publisher of International Journal Of Software, Technology & Science ISSN : 2616 - 5325
Dear Professors and Resarchers!You are welome to Cite these tutorials in your research or slides etc. Please don't forget to mention the reference of website. Copy Paste of text is strcitly forbidden. Images can be reuse because images are protected with watermark.

Leave a Reply

Your email address will not be published. Required fields are marked *