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

What is a relocatable program, What is a Relocatable program? The Reloc...

What is a Relocatable program? The Relocatable programs can be loaded almost anywhere in memory.

The key challenges of distributed systems, Question 1 Explain the followin...

Question 1 Explain the following with respect to Resource Management in Distributed Systems- Task assignment Approach Load - Balancing Approach Load - Sharing Approach

Distinguish between long and short term scheduler, Question 1: a) Disti...

Question 1: a) Distinguish between "Long-Term Scheduler" and "Short-Term Scheduler". b) Describe the benefits of "Threads". c) Name three types of CPU Scheduling. Que

What is critical section?, What is critical section? Every process has ...

What is critical section? Every process has a segment code called the critical section, in which the process may be updating tables, changing variables, writing file and etc. W

What is the drawbacks of contiguous allocation of disk space, What are the ...

What are the drawbacks of contiguous allocation of disk space? The disadvantages are a. Suffers from internal fragmentation b. Suffers from external fragmentation c. F

What is an idle thread, idle thread The special thread a dispatcher wi...

idle thread The special thread a dispatcher will run when no ready thread is found. The primary purpose of the idle process and its threads is to remove what would otherwise b

Write a short note on pcb, Write a short note on PCB? Every process is ...

Write a short note on PCB? Every process is represented in the operating system by a process control block also called a task control block. It contains more information regard

Basic server model, Suppose we want to program a Web server; we could easil...

Suppose we want to program a Web server; we could easily do so without using concurrency, as follows: while(true) wait connection read from socket and parse url look up url cont

Choice of operating systems to boot from, Q. How could a system be designed...

Q. How could a system be designed to allow a choice of operating systems to boot from? What would the bootstrap program need to do? Answer: Delieve a system that would like to

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