Tuesday, 19 June 2012

||| VuHelp4U ||| cs604 1st Question ans...............................


 

Q#1

 

 

 

Process

Max Need

current Usage

P3

8

3

P4

5

1

P5

8

2

Available=4

 

 

 

 

 1st we determine the Need   for each process.

Max need = Need +Allocated

Need  = Max Need – Allocated

 

 

 

Process

Max Need

Current usage

Need = Max Need - current usage

p3

8

3

5

 

p4

5

1

4

 

p5

8

2

6

 

 

 

 

Now our table will become such as

 

 

Process

Current usage

             Need

Available

P3

3

5

 

P4

1

4

 

P5

2

6

 

 

 

 

 

Process

Current usage

Need

Available

P3

3

5

4

P4

1

4

 

P5

2

6

 

 

 

Safe sequence <P4>

 

 

 

And current table will come as

 

Process

Current usage

Need

Available

P3

3

5

4

P4

1

4

5

P5

2

6

 

 

 

Safe sequence <P4, P3>

 

 

 

And our table will become

 

 

 

 

Process

Current usage

Need

Available

P3

3

5

4

P4

1

4

5

P5

2

6

8

 

 

Safe sequence <P4, P3, P5>   Required Ans.

 

 

 



Q#2








Sample code for monitor class in standard C

 

monitor class Account {

private int balance = 0
invariant balance >= 0

public method boolean withdraw(int amount)
precondition amount >= 0
{
if balance < amount then return false
else { balance = balance – amount ; return true }
}

public method deposit(int amount)
precondition amount >= 0
{
balance = balance + amount
}
}

-- 


is main mujhy 2nd ka ans  confirm nahi hy




Hamesha apnay Rab say pur umeed rehna 

Q k " is poori kinaat main jitni jaldi Rab Raazi hota
hai " itni jaldi koi Raazi nahi hota .






 


 


--
To post to this group, send email to vuhelp_pk@googlegroups.com
To unsubscribe from this group, send email to vuhelp_pk+unsubscribe@googlegroups.com
 
 
Group Rules Vuhelp4u
Sharing of Video songs links, movies links, dramas links are not allowed in study group. Only Islamic and general information Video links allowed.
SPAM, Advertisement, and Adult messages are NOT allowed and that member will be behaved strictly.
http://groups.google.com/group/vuhelp_pk?hl=en_US

No comments:

Post a Comment