作者tedmax100 (tedmax)
看板Grad-ProbAsk
标题[理工] [OS]-关於矩阵的page fault
时间Sat Jan 30 18:30:58 2010
Consider the two dimensional array A:
int A[][] = new int [50] [50];
where A[0][0] is at location 100, A[0][1] at 102, and A[0][2] at 104, etc.,
in a paged system with pages of size 100 bytes. A small process is in page 0
(locations 0 to 99) for manipulating the matrix; thus, every instruction
fetch will be from page 0.
Assume that there are five pages frames; page frame 1 has the process in it
and the other four are initially empty. Consider two different page
replacement algorithms: FIFO and LRU, and the following loop.
for (int j = 0; j < 50; j++)
for (int i = 0; i < 50; i++)
A[i][i] = 0;
1) List the page reference string for the execution of the loop. (5%)
2) For each replacement algorithm, how many page faults are generated by the
loop? (8%)
请问一下 这两小题怎解@@ , 麻烦了
第2小题答案是25次PF?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.117.206.69
1F:推 trovadores:请问题目确定是A[i][i],还是A[j][i]? 01/30 23:14
2F:→ tedmax100:考卷上是Aii 不过我也在想应该是Aji 01/30 23:23
3F:→ guts:有高手可以帮解一下吗?!!!!小弟也对这题有疑惑 ...... 01/31 14:11