30 Points) (Name) (Section

Total Page:16

File Type:pdf, Size:1020Kb

30 Points) (Name) (Section

Homework #1 ______(30 points) (Name) (Section) #1 – Introduction #3 – Chapter 1 #2 – Chapter 2 #4 – Chapter 3 Questions: Answers: 1. (1.7) In virtually all systems that include DMA modules, DMA access to main memory is given higher priority than processor access to main memory. Why?

2. (1.10) Considering the following code:

for (i = 0; i < 20; i++) for (j = 0; j < 10; j++) a[i] = a[i] + j a. Give an example of the spatial locality. b. Give an example of the temporal locality.

3. (1.12) Consider a memory system with the following parameters:

Tc = 100 ns Cc = 0.01 cents/bit Tm = 1200 ns Cm = 0.001 cents/bit a. What is the cost of 1 MByte of main memory? b. What is the cost of 1 Mbyte of main memory using cache memory technology? c. If the effective access time is 10% greater than the cache access time, what is the hit ratio H?

4. (1.13) A computer has a cache, main memory, and a disk used for virtual memory. If a referenced word is in the cache, 20 ns are required to access it. If it is in main memory but not in the cache, 60 ns are needed 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, 12 ms are required to fetch the word from disk, followed by 60 ns 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?

BYU, CS 345, F2012 Homework #1 Page 1/3 5. (2.2) An I/O-bound program is one that, if run alone, would spend more time waiting for I/O than using the processor. A processor-bound program is the opposite. Suppose a short-term scheduling algorithm favors those programs that have used little processor time in the recent past. Explain why this algorithm favors I/O-bound programs and yet does not permanently deny processor time to processor-bound programs.

6. (2.3) Contrast the scheduling policies you might use when trying to optimize a time-sharing system with those you would use to optimize a multi-programmed batch system.

7. (2.4) What is the purpose of system calls, and how do system calls relate to the OS and to the concept of dual-mode (kernel mode and user mode) operation?

8. (3.4) In [PINK89], the following states are defined for processes: execute (running), active (ready), blocked, and suspend. A process is blocked if it is waiting for permission to use a resource, and it is suspended if it is waiting for an operation to be completed on a resource it has already acquired. In many operating systems, these two states are lumped together as the blocked state, and the suspended state has the definition used in Chapter 3. Compare the relative merits of the two sets of definitions.

9. (3.11) In a number of early computers, an interrupt caused the register values to be stored in fixed locations associated with the given interrupt signal. Under what circumstances is this a practical technique? Explain why it is inconvenient in general.

10. (3.12) It was stated, in Section 3.4, that UNIX is unsuitable for real-time applications because a process executing in kernel mode may not be preempted. Elaborate.

BYU, CS 345, F2012 Homework #1 Page 2/3 BYU, CS 345, F2012 Homework #1 Page 3/3

Recommended publications