Array-initialization loops using lru replacement algorithm, Operating System

Assignment Help:

Q. Consider the two-dimensional array A:

int A[][] = new int[100][100];

Whereas A [0][0] is at location 200 in a paged memory system with pages of size 200. A little process is in page 0 (locations 0 to 199) for manipulating the matrix thus every instruction fetch will be from page 0.

For three page frames how various page faults are generated by the following array-initialization loops using LRU replacement and assuming page frame 1 has the process in it and the other two are initially empty?

a.

for (int j = 0; j < 100; j++)

for (int i = 0; i < 100; i++)

A[i][j] = 0;

b.

for (int i = 0; i < 100; i++)

for (int j = 0; j < 100; j++)

A[i][j] = 0;

Answer:

a. 50

b. 5,000


Related Discussions:- Array-initialization loops using lru replacement algorithm

Data races, Research the phenomenon of data races. Give an example of how...

Research the phenomenon of data races. Give an example of how an unprotected data race can give rise to data inconsistency. How do OpenMP and Cilk resolve this problem? Data

Define approaches that require knowledge of the system state, Define approa...

Define approaches that require knowledge of the system state?  Answer: Deadlock detection, Deadlock prevention, Deadlock Avoidance.

Difference between preemptive and nonpreemptive scheduling, Define the diff...

Define the difference between preemptive and nonpreemptive scheduling. State why strict nonpreemptive scheduling is unlikely to be used in a computer center. Preemptive schedul

What is linked allocation, What is linked allocation, as detailed in text? ...

What is linked allocation, as detailed in text? Directory has pointers to first and last blocks of file. Every block of file (except last) has pointer to the next block.

Windows admin need it, Windows admin need it Project Description: We ...

Windows admin need it Project Description: We want to protect an executable on operating system level , so the process could be visible among all users while the executable r

Explain file allocation using i nodes, File allocation using I nodes. T...

File allocation using I nodes. This method is used to decrease the size of the table in the above method. Every file will have an I-node list. Allow a file have 15 pointers a

Demand paging, Demand paging gives that pages could only be brought into ...

Demand paging gives that pages could only be brought into memory if the running process acts them. This is usually referred to as lazy evaluation as only those pages operated by

Operating System, my Operating System is windows trust but when the windows...

my Operating System is windows trust but when the windows start say its windows xp. help pleaes

What is a two state process model?, What is a two state process model? ...

What is a two state process model?   At any time a process is being implementing by a processor or not. Therefore a process may be in Running or not running state. When an Ope

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd