1,135 views

1 Answer

1 votes
1 votes

Safe state will never lead to deadlock. Unsafe state may lead to a deadlock. Deadlock is subset of unsafe state.

Ref: https://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/7_Deadlocks.html

There are states that are neither safe nor deadlocked, but which lead to deadlocked states. As an example, suppose we have four resources: tapes, plotters, scanners, and CD-ROMs, as in the text, and three processes competing for them. We could have the following situation:

       Has         Needs       Available

A: 2 0 0 0      1 0 2 0        0 1 2 1

B: 1 0 0 0      0 1 3 1

C: 0 1 2 1     1 0 1 0

This state is not deadlocked because many actions can still occur, for example, A can still get two printers. However, if each process asks for its remaining requirements, we have a deadlock.

Ref: Andrew Tanenbaum solution manual.

Also see: https://cs.stackexchange.com/questions/45145/why-unsafe-state-not-always-cause-deadlock

edited by

Related questions

2 votes
2 votes
0 answers
1
1 votes
1 votes
2 answers
2
admin asked Oct 30, 2019
2,138 views
A system has four processes and five allocatable resources. The current allocation and maximum needs are as follows:What is the smallest value of x for which this is a sa...
0 votes
0 votes
0 answers
4