blems I'm st

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I've been having a hard time with these questions will you be able to help me

I have been told that this is the answer to the problems I'm stuck on but I don't know what they mean

3e) O(32*256)

3d) O(256*32)

3. Virtual memory
Study the two functions given below. Both use the same array declared as: static int data[256*256*8];
void function1()
{
int i;
int j;
for (i = 0; i< 32; i++)
for (j = 0; j< 256; j++)
data] = i;
}
void function2)
{
int i;
int j;
for (i = 0; i< 32; i++)
for (j = 0; j< 256; j++)
dataj*2048] = i;
}
Assume the following behaviors in a virtual memory system. Reading or writing physical memory requires
50 nanoseconds. Reading or writing disk writing 10 milliseconds. Page size is 8 kilobytes. Presume that
the program has 1 megabyte of physical memory available. You may consider everything except the array
access itself to take no time. You should also assume that the first 1 megabyte of the array is in physical
memory initially. You may ignore any memory used by the program or stack to execute these functions.
Using this information, answer the following questions. In each case, show the work you use to calculate
the answer. Give your answer in a reasonable unit.
3d) Just considering virtual memory access time, how long will it take for function1() to execute?
3e) Just considering virtual memory access time, how long will it take for function2() to execute?
Remember to account for both read and write activity.
Transcribed Image Text:3. Virtual memory Study the two functions given below. Both use the same array declared as: static int data[256*256*8]; void function1() { int i; int j; for (i = 0; i< 32; i++) for (j = 0; j< 256; j++) data] = i; } void function2) { int i; int j; for (i = 0; i< 32; i++) for (j = 0; j< 256; j++) dataj*2048] = i; } Assume the following behaviors in a virtual memory system. Reading or writing physical memory requires 50 nanoseconds. Reading or writing disk writing 10 milliseconds. Page size is 8 kilobytes. Presume that the program has 1 megabyte of physical memory available. You may consider everything except the array access itself to take no time. You should also assume that the first 1 megabyte of the array is in physical memory initially. You may ignore any memory used by the program or stack to execute these functions. Using this information, answer the following questions. In each case, show the work you use to calculate the answer. Give your answer in a reasonable unit. 3d) Just considering virtual memory access time, how long will it take for function1() to execute? 3e) Just considering virtual memory access time, how long will it take for function2() to execute? Remember to account for both read and write activity.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Keywords
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education