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

Parent process: why not finishing and how to make finish, #include #inclu...

#include #include #include #include #include int main(void) { int pchan[2], pid, rval, cvar; char buf[20]; if (pipe(pchan) == -1){

Explain lru second chance algorithm, Second chance Algorithm When the p...

Second chance Algorithm When the page is chosen the reference bit is checked to see whether it has been referenced before. If that is the case after that it is given a second c

Define the properties of batch operating systems, Define the properties ope...

Define the properties operating systems: Batch :- Jobs with similar needs are batched together and  run through the computer as a group by an operator or automatic job sequenc

Explain memory management using buddy sustem, MEMORY MANAGEMENT USING BUDDY...

MEMORY MANAGEMENT USING BUDDY SUSTEM Here we are dividing the memory as powers of two as well as we are selecting the space which is smallest but large enough to hold a process

Explain the various file types, Explain the various file types A common...

Explain the various file types A common technique for executing file types is to contain the type as part of the file name. The name is split into two parts - a name and an ext

What is co-operating scheduling?, What is co-operating scheduling? CPU ...

What is co-operating scheduling? CPU scheduling decisions may possibly place under the following four circumstances: 1.      When process switches from the running state to

What is sector sparing, What is sector sparing? Low-level formatting al...

What is sector sparing? Low-level formatting also sets aside extra sectors not visible to the operating system. The controller can be told to change each bad sector logically w

In which page replacement policy balady’s anomaly occurs, In which page rep...

In which page replacement policy Balady’s anomaly occurs? FIFO (First in First Out)

Explain the demand paging system, Question : (a) In the demand paging ...

Question : (a) In the demand paging system, when a process tries to access a page that was not brought into memory, a page fault occurs that involves a series of actions. The

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