Awesome q2a theme
0 votes
21 views

But As clearly mentioned in the Galvin Book:

A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally! a system is in a safe state only if there exists a safe sequence. A sequence of processes < PI! P2! ...! PI/> is a safe sequence for the current allocation state it for each Pi! the resource requests that Pi can still make can be satisfied by the currently available resources plus the resources heldby all Pi, withj < i. 

From this definition i can solve like this:

Let us take 11 processes i.e. P1, P2, ……...P11. now we allocate 2 resources to each process. Now total 22 resources are allocated to these process and we left with 8 resources now With these 8 resources we can easily get a safe sequence satisfy the need of all the process as :

Safe sequence : P1,P2……...P11.

Hence system is still in safe state. So I think answer should be 11. Please correct me if i am wrong?

in Operating System by (9 points) | 21 views

1 Answer

+1 vote

(Max need -1 ) * N +1 <= R

$3*N +1 <= 30$

$3N <= 29$

$N <= 9$


$8$ resources and each process wants $2$ resource more to complete.

What if now each process is alloted $1$ resource and $1$ is still left to allot

i.e. P1 to P8 have $3$ resources each and P9 to P11 have $2$ resource each.

deadlock occured since now resources are over and all processes are still waiting for getting the resource.


In question when they ask safe state it means that there should not be any possibility of deadlock in any manner.

by (4.1k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Jul 2020
  1. Shaik Masthan

    39 Points

  2. hiteshpujari

    9 Points

  3. fazin

    7 Points

  4. srestha

    7 Points

  5. gaurav2697

    6 Points

  6. Venkatesh Akhouri

    6 Points

  7. Meghana518

    6 Points

  8. beastincarnate

    6 Points

  9. athenahermes

    6 Points

  10. bittujash

    6 Points

7,561 questions
1,783 answers
10,869 comments
90,494 users