Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Increase page size Install larger hard drive Install multiple hard drive and use

ID: 3769628 • Letter: I

Question

Increase page size Install larger hard drive Install multiple hard drive and use all of them use better page replacement algorithm Lost Update p1, p2, are processes. X, y, z are common variables. Consider two processes: p1, p2. The processes access one and only one common variable x and several local variables. A, b are local variables. Will the following problem has lost update? P1 will ; Repeat 1000 time; c1 = 1; c1 = c1 + 1; x = c1; and repeat, P2 will; Repeat 1000 time; c2 = x; c2 = c2 - 1; x = c2; and repeat. P1 will; Repeat 1000 time; c2 = a; c1 = c1 + 1; a = c1; and repeat. P2 will; Repeat 1000 time; c2 = b; c2 = c2 - 1; b = c2; and repeat.

Explanation / Answer

page fault is denoted by p and no page fault by n
number of frames = physical memory size / page size

the page size = frame size

Method: - if the requested page is in memory already, change its used bit as 1, otherwise, execute the following algorithm
Algorithm:

repeat until page has been stored

     if scan pointer is at frame whose used bit is 0

              then select it

     put new page here

     set used bit to 1    

     move scan pointer to the next frame

     else    

     set used bit to 0  

     move scan pointer to the next frame (wrap around to first frame

                  if at the last frame)