Awesome q2a theme
0 votes

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 (7 points) | 16 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 (3.7k 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 Dec 2019
  1. Pratyush Priyam Kuan

    164 Points

  2. Vimal Patel

    120 Points

  3. avistein

    65 Points

  4. srestha

    54 Points

  5. Mk Utkarsh

    49 Points

  6. arya_stark

    46 Points

  7. goxul

    39 Points

  8. Sathuri Bharath

    34 Points

  9. vishal burnwal

    32 Points

  10. Shaik Masthan

    28 Points

Monthly Top User and those within 60% of his/her points will get a share of monthly revenue of GO subject to a minimum payout of Rs. 500. Current monthly budget for Top Users is Rs. 75.
2,317 questions
1,295 answers
89,719 users