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

Paging: Basic, Hierarchical, Hashed, and Inverted
What is the difference between kernel stack and user stack?
Ridiculous Question, but can I have SAS return the computer's volume level?
Why is an operating system software loaded from hard disk than from a rom chip? [closed]
What sort of things can cause a whole system to appear to hang for 100s-1000s of milliseconds?
How to make an bootable iso(not cd or flash drive) for testing your own boot loader?
Application-level scheduling
stack overflow method
How does communication occur in java through TCP sockets on the same machine
What happens when you overwrite a memory-mapped executable?
Valid characters for environment variables across operating systems
Instructions per sec for Operating systems
How often do deadlocks occur(about to occur) in an operating system
Why LRU doesn't suffer Belady's Anomaly?
Why are mobile OS'es still tied to vendors? [closed]
What is the Maximum File size in each of these cases?

Categories

HOME
xpath
entity-framework
svn
blast
windows-8.1
softlayer
selenium-builder
subdomain
autocomplete
tcp
cryptography
flurry
position
phpmqtt
static-analysis
tfs2010
roku
wine
hystrix
cqrs
locationmanager
graphdb
max-msp-jitter
vmware-workstation
rpmbuild
cocos2d-android
boomi
xsl-fo
deepfreeze
jest
bsd
kaggle
candlestick-chart
cellular-network
tortoisehg
ccavenue
fusion
copy-protection
nic
source-insight
tightvnc
argv
rspec-rails
sca
gsp
db2-luw
transform
busboy
aurelia-cli
telephonymanager
hypothesis-test
docker-ucp
react-intl
audio-converter
spongycastle
qvtkwidget
swift2.3
ssi
return-type
roracle
simple-schema
gtk#
dtd
maatwebsite-excel
nitrousio
boost-compute
deviare
google-identity-toolkit
openquery
livereload
dcount
always-on-top
highlighting
vimperator
android-expansion-files
ioexception
ajax4jsf
decidable
fanotify
sqlbase
knife
supercomputers
postal-code
dynamics-ax-2012-r2
sequence-sql
flow-js
erlog
camus
mod-auth-openidc
uno
password-recovery
producer
lumia-imaging-sdk
bittorrent-sync
strdup
virtual-channel
bcdedit
dynamic-rdlc-generation
ckeditor.net
clrprofiler
prefuse
netstream
glx
net-use
firefly-mv
azure-acs
bll
mongrel2
eaccelerator
outlook-2007-addin
firephp
rtti
downcasting

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App