I read that system being in safe state doesn't guarantee that deadlock is not possible.

Can someone give me an example where system is in safe state and deadlock is possible?

• Where did you read that? What specifically did they say? What definition of 'safe state' are you using? – D.W. Jul 30 '17 at 23:05
• I guess you got confuse for the safe state definition. Safe state means the safe sequence of process s.t. allocation of resources in this order will not result in deadlock. Although unsafe state doesn't always mean that the system will result into deadlock. – Pragya Jul 31 '17 at 9:16
• I read that even if the system is in safe state, then there can be some another execution sequence which can lead to deadlock. – Zephyr Jul 31 '17 at 12:53
• @Zephyr There are 2 units of resource A and 2 units of resource B. Job $j$ requires 2 As and 1 B. Job $k$ requires 1 A and 2Bs. System is in safe state since we can run $j$ to the end, after which we can run $k$ to the end. However, if 1 A and 1 B is assigned to $i$ while 1A and 1B is also assigned to $k$, here comes the deadlock. – Apass.Jack Mar 12 at 0:38