Comp111 - Quiz 1

Oct 4, 2017 - closed book



Please fill in the blanks. Each blank is worth 5 points. There are several reasonable answers for some of the blanks; choose one. Blanks with the same number have the same answer.

  1. The operating system sends ________signals________ to processes to inform them of state changes. To send one of these, a process can use the ________kill________ system call.
  2. When measuring the time for a process, ________user________ time is the time spent inside the process, while ________system________ time is time spent inside the operating system on behalf of the process.
  3. When creating a child process, the only difference between the parent and the child is the return value of ________fork________. When a child exits, it returns a ________status code________ to the parent. If the parent does not read this, the child becomes a ________zombie________.
  4. Signal handlers can be called at any time, so that they utilize a different ________stack________ to avoid confusion. This allows signals to interrupt ________other handlers________ as well as the regular program. This is called "signal stacking".
  5. Calling dup on a file descriptor makes a copy of it using the ________lowest________ descriptor that is not open.
  6. A pipe is a(n) ________(kernel) buffer________ represented by an array of two file ________descriptors________, one for the write side and one for the read side.
  7. The point of write buffering is to minimize ________system calls_________ according to one of three buffering strategies. For example, ________line________ buffering calls a system call only when the user types ________the return character________. One can force a system call by ________flushing________ the buffer. If one exec's another program before doing this, pending output is ________lost________.
  8. The reason we pass so many pointers to an operating system as type _______void *________ is that the operating system has no reason to know the real type.
  9. To glue the output of process one to the input of process two, one opens a pipe and dups its write side to the file descriptor with number ________1________ on process one, and dups its read side to the file descriptor with number ________0________ on process two.
  10. (Extra credit) The only difference between the memory maps for a thread and a process is that a thread has its own ________stack________.