# Andrew S. Tanenbaum (OS) Edition 4 Exercise 3 Question 54 (Page No. 261)

51 views

Write a program that will demonstrate the difference between using a local page replacement policy and a global one for the simple case of two processes. You will need a routine that can generate a page reference string based on a statistical model. This model has $N$ states numbered from $0$ to $N − 1$ representing each of the possible page references and a probability $p_{i}$ associated with each state $i$ representing the chance that the next reference is to the same page. Otherwise, the next page reference will be one of the other pages with equal probability.

1. Demonstrate that the page reference string-generation routine behaves properly for some small $N.$
2. Compute the page fault rate for a small example in which there is one process and a fixed number of page frames. Explain why the behavior is correct.
3. Repeat part $(b)$ with two processes with independent page reference sequences and twice as many page frames as in part $(b).$
4. Repeat part $(c)$ but using a global policy instead of a local one. Also, contrast the per-process page fault rate with that of the local policy approach.

## Related questions

1
31 views
One of the first timesharing machines, the $DEC\: PDP-1,$ had a (core) memory of $4K\: 18-bit$ ... drum. The drum could start writing (or reading) at any word, rather than only at word $0.$ Why do you suppose this drum was chosen?
1 vote
Consider the following two-dimensional array: int X[64][64]; Suppose that a system has four page frames and each frame is $128$ words (an integer occupies one word). Programs that manipulate the $X$ array fit into exactly one page and always occupy page $0.$ The data are swapped in and out of the other three frames ... B for (int i = 0; i < 64; i++) for (int j = 0; j < 64; j++) X[i][j] = 0;
Suppose that two processes $A$ and $B$ share a page that is not in memory. If process $A$ faults on the shared page, the page table entry for process $A$ must be updated once the page is read into memory. Under what conditions should the page table update ... of process $A's$ page fault will bring the shared page into memory? Explain. What is the potential cost of delaying the page table update?
A computer has four page frames. The time of loading, time of last access, and the $R$ and $M$ bits for each page are as shown below (the times are in clock ticks): Which page will NRU replace? Which page will FIFO replace? Which page will LRU replace? Which page will second chance replace?