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

Define the executor (worker thread), Define the Executor (Worker Thread)  ...

Define the Executor (Worker Thread)  The responsibility of the Executor (or Worker Threads) is to execute instructions on behalf of a client-server connection. The Executor mus

Problem, whats the problem in two state model ?

whats the problem in two state model ?

Computer organisation, basic advantage of using interrupt initiated data tr...

basic advantage of using interrupt initiated data transfer over transfer under program control without an interrupt

Evaluate the physical address, Compare between the one and two-dimensional ...

Compare between the one and two-dimensional memory organizations in terms of the  memory structure,  advantages, and disadvantages.  Which approach would better support the needs o

What is internal fragmentation?, What is internal fragmentation? Consid...

What is internal fragmentation? Consider holes of 20k assume the process requests 18 bites. If we allocate accurately the request block, we are left with a hole of 2k. The over

Linux OS, Ask questioDevelop a utility in C language which will run in Linu...

Ask questioDevelop a utility in C language which will run in Linux operating systems to display following properties of the system: ? Processor speed ? Ram size ? Computer name ? S

Comparison of disk scheduling algorithms, COMPARISON OF DISK SCHEDULING ALG...

COMPARISON OF DISK SCHEDULING ALGORITHMS Name      Description                  Remarks      (Selection according to requestor)   RSS        Random scheduling     fo

Define the conditions of deadlock prevention, What are the four necessary c...

What are the four necessary conditions of deadlock prevention?       Ans:  Four essential conditions for deadlock prevention: a. The meaning of removing the mutual exclusio

What is critical section problem, What is critical section problem? Con...

What is critical section problem? Consider a system consists of 'n' processes. Every process has segment of code called a critical section, in which the process might be changi

Os, why we say" OS is a resource allocator" and “OS is a control program"?

why we say" OS is a resource allocator" and “OS is a control program"?

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