operating-system


Could someone help me to figure an example of MRU and CLOCK?


As title.
There is a buffer pool with 3 pages that receives requests for the following page numbers:
2,4,4,2,5,2,1,1,3,1
The replacement policies are MRU and CLOCK.
I am confused about how they work. Could someone show me? Thanks a lot~
update:
There is my solution following the MRU policy:
2
2 4
2 4
2 4
2 4 5
2 4 5
1 4 5
3 4 5
1 4 5
Is that right?
And following the LRU policies:
hit/miss?
2 m
2 4 m
2 4 h
2 4 h
2 4 5 m
2 4 5 h
2 1 5 m
2 1 5 h
2 1 3 m
2 1 3 h
Is that right?
There is my solution following the MRU policy... Is that right?
As per the definition of MRU mentioned by you, your MRU page replacement policy appears correct.
The replacement policies are MRU and CLOCK. I am confused about how they work. In this case(for 2,4,4,2,5,2,1,1,3,1 page numbers) :
In Clock page replacement policy, the OS circulates through pages, clearing
reference bits and finding a page with reference bit set to 0.
Page number Reference bit
2 1
2,4 1,1
2,4 1,1
2,4 1,1
2,4,5 1,1,1
2,4,5 1,1,1
1,4,5 1,0,0
1,4,5 1,0,0
1,3,5 1,1,0
1,3,5 1,1,0
And following the LRU policies: hit/miss? Is that right?
YES, for the LRU page replacement, the page ordering as well as the number of hits and misses both are correct.
For MRU eviction policy, let's keep the MRU page at the front. With the given request list, following will be the state of buffers:
2 -> 2
4 -> 2 4
4 -> 2 4
2 -> 4 2
5 -> 4 2 5
2 -> 4 5 2
1 -> 4 5 1
1 -> 4 5 1
3 -> 4 5 3
1 -> 4 5 1
For the CLOCK eviction policy, the page list would be ( * represents the buffer location to be filled in when a page fault occurs):
2 -> 2 *
4 -> 2 4 *
4 -> 2 4 *
2 -> 2 4 *
5 -> 2* 4 5
2 -> 2* 4 5
1 -> 1 4* 5
1 -> 1 4* 5
3 -> 1 3 5*
1 -> 1 3 5*
Following LRU policy, let's keep LRU page at the back. State of buffers will be:
2 -> 2
4 -> 2 4
4 -> 2 4
2 -> 4 2
5 -> 4 2 5
2 -> 4 5 2
1 -> 5 2 1
1 -> 5 2 1
3 -> 2 1 3
1 -> 2 3 1

Related Links

Why not to double number of registers for fast syscalls?
can i use pen drive for booting os into beagle board xm instead of sd card
How to Calculate Effective Access Time
Had 16-bit DOS a memory access limitation of 1 MB? If yes, how?
Determine addresses and page table size
How to detect operating system with GIMP scheme?
Does ARM have any mechanism like the VESA/VGA text mode console on x86?
What is greater logical address or physical address?
index allocation maximum file size
Random access alternative to named pipes
How to determine how many entries there are in a page table
NTFS vs FAT32 Search Time
What does a valid idle thread implementation look like?
basic CPU scheduling “waiting to ready”
How can union directories remove the need for a PATH environment variable?
How to find disk block that contains a file in FAT

Categories

HOME
flask
mod-rewrite
cucumber
livecode
schema.org
postgresql-9.4
code-formatting
embedded-resource
biztalk
tcp
flurry
ontology
ipv6
stored-procedures
save
hspi
bellman-ford
azure-graph-api
xades4j
match
chromecast
stimulsoft
trace32
jpa-2.0
mailgun
xbox360
jqxgrid
scala-ide
psql
bazaar
adminlte
bsd
coreldraw
substring
software-packaging
msdeploy
history.js
python-imageio
tortoisehg
macromedia
code-climate
openbr
source-insight
tightvnc
premake
mongodb-3.4
winrm
amazon-kms
pdfminer
cordys-opentext
djcelery
uivisualeffectview
android-n
resampling
yoast
google-prediction
rm
photoswipe
knockout-2.0
md5-file
aurelia-fetch-client
winmerge
polymaps
word-2016
callouts
utf-16
preferenceactivity
msgpack
unhandled
postal-code
modern.ie
android-handler
org-babel
phpredis
com0com
abstract-factory
mgwt
maven-shade-plugin
mod-auth-openidc
string.format
cakephp-2.2
forceclose
neo4jphp
zend-search-lucene
jack
usb-flash-drive
code39
spring-security-acl
illuminate-container
apache-shindig
cgrectmake
pageheap
cakeyframeanimation
image-scanner
kolite
firefly-mv
winsxs
mediacontroller
pinax
asdoc
spring-modules
ntruencrypt
watchpoint
chronic
html-generation

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App