Question

Operating Systems Questions (Please help if you can) 1. A computer has cache, main memory, and...

Operating Systems Questions (Please help if you can)

1. A computer has cache, main memory, and a disk used for virtual memory. If a

referenced word is in the cache, 20ns are required to access it. If it is in main memory but not

in the cache, 60ns are required to load it into the cache (this includes the time to originally

check the cache), and then, the reference is started again. If the word is not in main memory,

12ms are required to fetch the word from disk, followed by 60ns to copy it to the cache, and

then, the reference is started again. The cache hit ratio is 0.9 and the main memory hit ratio

is 0.6. What is the average time in ns required to access a referenced word on this system?

2. [6 pt] An i/o-bound process is one that, if run alone, would spend more time waiting for i/o

than using the cpu. A cpu-bound process is the opposite. Suppose a short-term scheduling

algorithm favors those processes that have used little cpu time in the recent past. Explain

why this algorithm favors i/o-bound processes yet does not permanently deny cpu time to

cpu-bound processes.

3. What is an instruction trace? What is an interleaved instruction trace?

4. You have executed the following C program:

#include <stdio.h>

#include <sys/types.h>

#include <unistd.h>

int main()

{

pid_t pid = fork();

printf ( "%d\n", pid );

return ( 0 );

}

What are the possible outputs, assuming the fork succeeded?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:------------------
1.
There are three cases to consider:---------------------

Location of referenced ------------------ word Probability ------------- Total time for access in ns
In cache ------------------------------------------- 0.9 ----------------------------------------- 20
Not in cache, but in main memory ------ (0.1)(0.6) = 0.06 -------------------------- 60 + 20 = 80
Not in cache or main memory ----------- (0.1)(0.4) = 0.04 ---------------------12ms + 60 + 20 = 12,000,080

So the average access time would be:
Avg = (0.9)(20) + (0.06)(80) + (0.04)(12000080) = 480026 ns

2.
I/O-bound programs use shorter processor time so the algorithm favors them. But if a processor-bound process is denied processor time for a longer time, the same algorithm will grant the processor to that process since it has not used the processor at all in the recent past. Therefore this algorithm favors I/O-bound programs and yet does not permanently deny processor time to processor-bound programs

3.
An instruction trace is a list of the sequence of instructions that are executed by an individual process.

Add a comment
Know the answer?
Add Answer to:
Operating Systems Questions (Please help if you can) 1. A computer has cache, main memory, and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Several forms of storage can be identified in typical computer systems: registers, main memory, cache memory,...

    Several forms of storage can be identified in typical computer systems: registers, main memory, cache memory, read-only memory, magnetic disk and tape storage. Briefly describe each of these with particular reference to its access time, the life time of the data it stores, its typical usage and frequency of access

  • 6. Memory Access Time [15 points] Consider a MIPS processor that includes a cache, a main...

    6. Memory Access Time [15 points] Consider a MIPS processor that includes a cache, a main memory, and a hard drive. Access times of cache memory, main memory, and hard drive are 5 ns, 200 ns, and 1000 ns, respectively. Assume that cache memory is divided into instruction cache and data cache. Assume that data cache has a 90% hit rate. Assume that main memory has a 98% hit rate and hard drive is perfect (it has a 100% hit...

  • A computer uses virtual memory implemented by paging. The TLB lookup takes 100 ns and the...

    A computer uses virtual memory implemented by paging. The TLB lookup takes 100 ns and the update takes 200 ns. The PT lookup takes 1 µs and the update takes 2 µs. Loading a word from main memory onto the CPU takes 10 µs and loading a page from the disk into main memory takes 10 ms. The TLB hit ratio is 0.4 and the main memory hit ratio is 0.3. Compute the average access time for a referenced word:...

  • 2. A computer uses virtual memory implemented by paging. The TLB lookup takes 150 ns and...

    2. A computer uses virtual memory implemented by paging. The TLB lookup takes 150 ns and the update takes 300 ns. The PT lookup takes 2 us and the update takes 4 us. Loading a word from main memory onto the CPU takes 25 us and loading a page from the disk into main memory takes 20 ms. The TLB hit ratio is 0.3 and the main memory hit ratio is 0.4. Compute the average access time for a referenced...

  • Consider a memory hierarchy using one of the three organization for main memory shown in a...

    Consider a memory hierarchy using one of the three organization for main memory shown in a figure below. Assume that the cache block size is 32 words, That the width of organization b is 4 words, and that the number of banks in organization c is 2. If the main memory latency for a new access is 10 cycles, sending address time is 1 cycle and the transfer time is 1 cycle, What are the miss penalties for each of...

  • Q4. CISC/RISC and Cache Memory (24pts) Q4-1. Assume that UltraSpark-like processor has an L1 cache with...

    Q4. CISC/RISC and Cache Memory (24pts) Q4-1. Assume that UltraSpark-like processor has an L1 cache with the following specifications: 40-bit wide address and 64-bit wide data busses On-chip instruction cache Cache is 16K bytes, organized as a 2-way set associative Cache line (block) size = 64 bytes 200 MHz clock frequency Average cache hit rate = 90% Instructions located in cache execute in 1 clock cycle Instructions that are not found in the on-chip cache will cause the processor to...

  • Exercise 8.16 You are building a computer with a hierarchical memory systenm that consists of separate...

    Exercise 8.16 You are building a computer with a hierarchical memory systenm that consists of separate instruction and data caches followed by main memory. You are using the ARM multicycle processor from Figure 7.30 running at 1 GHz (a) Suppose the instruction cache is perfect (i.e., always hits) but the data cache has a 5% miss rate. On a cache miss, the processor stalls for 60 ns to access main memory, then resumes normal operation. Taking cache misses into account,...

  • Operating System a. What is the meaning of the term busy waiting? What other kinds of...

    Operating System a. What is the meaning of the term busy waiting? What other kinds of waiting are there in an operating system? Can busy waiting be avoided altogether? Explain your answers. (5 pts) b. Explain why spinlocks are not appropriate for single-processor systems yet are often used in multiprocessor systems. (5 pts) c. Using the program shown below, explain what the output will be at lines X and Y. Assume that you have a pre-emptive priority system. (10 pts)...

  • 1 Overview The goal of this assignment is to help you understand caches better. You are...

    1 Overview The goal of this assignment is to help you understand caches better. You are required to write a cache simulator using the C programming language. The programs have to run on iLab machines. We are providing real program memory traces as input to your cache simulator. The format and structure of the memory traces are described below. We will not give you improperly formatted files. You can assume all your input files will be in proper format as...

  • Operating Systems Questions (Please help if you can) 5. Explain the difference between a semaphore and...

    Operating Systems Questions (Please help if you can) 5. Explain the difference between a semaphore and a condition. 6. Show how the bakery algorithm conforms to the tenet of the protocol for critical section problem. 1. What type of hardware support is required to implement cycle stealing? 2. Explain why does the use of dma result in the cpu memory accesses to slow down? 3. What is the difference between synchronous and asynchronous interrupts? Given an example of each of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT