int request_page(PageID pid)
{
bufID = findInPool(pid)
if (bufId == NOT_FOUND) {
if (no free frames in Pool) {
bufID = findFrameToReplace()
if (directory[bufID].dirty)
old = directory[bufID].page
put_page(old, frames[bufID])
}
bufID = index of freed frame
directory[bufID].page = pid
directory[bufID].pin_count = 0
directory[bufID].dirty = 0
get_page(pid, frames[bufID])
}
directory[bufID].pin_count++
return bufID
}
|