CS307
Midterm
Ondich
Due in class on Monday, May 10, 2004

This exam is open-book, open-notes, open-computer, open-Internet, and closed-other-people.

  1. (12 points) Suppose we have a collection of processes, each of which does ten iterations of the following sequence: wait 1 second for file input, and then do 2 seconds of computation. Furthermore, suppose context switches take 10 milliseconds. Assuming a round-robin scheduling algorithm, answer each of the following questions for 1 process, 2 processes, and 10 processes, and for quantum sizes of 100 milliseconds and 500 milliseconds (yes, that's six cases). Assume that all processes are ready to run at time zero.

  2. (12 points) Scheduling in Linux. You're going to need to dig through some code, but you might also consider using the web to get some help.

  3. (8 points) Questions about fork(). Don't just answer the questions; provide some evidence for your answers.

  4. (8 points) Suppose we are using a 2-level page table system in which logical addresses are 32 bits long, each second-level page table entry takes up exactly 32 bits, and each second-level page table takes up exactly one page. Suppose further that the page size is 8KB, and the paging system supports LRU page replacement.

  5. (2 points) I've got some extra professional development money I need to spend in the next month, and I want to spend it on computer books. What's your favorite computer-related book? (It's okay if I already own it--I'm also curious about what books you like.)

  6. (12 points) Take a look at the program badpingpong.c. This program is trying to use signals to cause the child and the parent to print alternating messages to stdout. The parent prints a message and then signals the child, then the child catches the signal, prints a message, and signals the parent, etc. Unfortunately, when I compile and run this program, it doesn't work.