![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Posts: 2
Rep Power: 0
![]() |
Can anyone help me on this
Consider the following two dimensional array in a paged virtual memory:
var A : array [1..50] of array [1..100] of integer; It is assumed that the page size of the paged virtual memory is 100 words and an integer occupies exactly one word. The virtual address of A[1][1] is 100. Thus array A occupies the range in virtual memory from the beginning of page 1 to the end of page 50. In page 0 (location 0..99) there is a small program for manipulating the array. We assume that page 0 is preloaded and stored in a frame that is locked (i.e., page 0 will never be replaced). How many page faults are generated by the following array initialization loops, using LRU replacement, with two extra free frames allocated to the process for storing data in array A. In each case, show the page reference string corresponding to the order of access to the elements in the array. Explain your answers. Redo the question when OPTIMUM replacement is use. (i) for i := 1 to 50 do for j :=1 to 100 do A[i][j] := 0; (ii) for i := 1 to 100 do for j :=1 to 50 do A[j][i] := 0; |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
Damn. This is a shame, the second homework question you posted... so let me repeat...
Try to do your homework assignments yourself, you will learn better that way. If you are still stuck, ask specific questions.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Doing your homework for you would ultimately be a disservice to you. But we promise not to page-swap out your post!
![]()
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
7
and 7
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|