Homework 1 - Chapter 1 Questions 2, 6, 10

2. What is multiprogramming? Give 2 reasons for having it.

Having multiple programs resident at once and having them all active at the same time. Only one runs at any instant, but they may each run in turn. This increases CPU utilization, decreases response and turnaround time. While one program is waiting for I/O, another can be using the CPU.

 

6. Which of the following instructions should be allowed only in kernel mode?

  1. disable all interrupts
  2. read the time of day clock
  3. set the time of day clock
  4. change the memory map
  1. Kernel mode only. Obvious
  2. Doesn't need to be done only in kernel mode
  3. Needs to be done only in kernel mode otherwise, a job could set the clock back to increase its processor time slice (among other things)
  4. Kernel mode only. Obvious

 

10. Give an example of how the mechanism and policy can be separated with respect to scheduling. Suggest a mechanism that could allow a parent process to control the scheduling policy for its children.

Mechanism and policy can be separated by having a parameterized scheduling algorithm. This would allow a parent process to set different priorities for its children. In practice, Unix nice values allow this behavior.