Comp111 - Quiz 1

Oct 6, 2009 - closed book



Please fill in the blanks. Each blank is worth 5 points. Blanks with the same number label have the same answer.

  1. A pipe is a(n) ____buffer____ that allows communication between separate ____processes____. The call pipe(p) requires p to be a(n) ____array____ of two ____integers/numbers/file descriptors____. To use printf on these, one must call ____fdopen____ to get a(n) ____file pointer/formatted i/o descriptor____ corresponding to the pipe's input.
  2. The fork() returns ____the child's process-id/pid____ for the parent process and ____0____ for the child. The child is an exact ____copy____ of the parent. By contrast, the ____exec/execl,etc____ call replaces the child's program with another, but preserves open ____files/file descriptors____. The ____dup____ call allows one to change the standard input from a child so that it points to a program rather than a terminal.
  3. A ____race condition____ refers to any situation in which the result of computation depends upon the ____order/sequence____ in which processes perform tasks. Simple examples of this include two processes trying to ____read____ from the same ____queue/file/stack/pipe...____
  4. When a process dies, its ____exit code/status____ is saved until its parent ____reaps/recovers/waits for____ it. If a parent does not do this, its children become ____zombies____ who cannot die.
  5. The ____/proc____ pseudo-filesystem gives all information known about each process.