Tuesday 19 June 2012

::::|| VU ||:::: 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 .






 


 


--
For study materials, past papers and assignments,
Join VU School at www.vuscool.com
 
Facebook Group link
http://www.facebook.com/groups/vuCoooL
 
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
 
home page
http://groups.google.com/group/coool_vu_students?hl=en

No comments:

Post a Comment