CS 3733 Operating Systems, Spring 2008 Exam 2 Comments
Grade distribution:
- 90-99: 1
- 80-89: 3
- 70-79: 3
- 60-69: 6
- 50-59: 2
- below 50: 4
- Average: 63
- Problem 1: Part b: Both processes are on the same machine so the
child can write a raw double value (sizeof(double) bytes) to the pipe and
the parent can read that number of bytes. You need to make sure the
correct number of bytes have been read.
Part c is already handled in Part b. When a process reads
from a pipe, the process blocks while the pipe is empty.
- Problem 2: The problem does not say anything about B making a request
to A for the value. The two processes need to decide on a protocol for
sending the value since if sent raw, the byte ordering may be different
as well as the floating point format or even the number of bytes.
- Problem 3b: You cannot use a mutex lock to wait until the value is ready
unless the created thread locks the mutex during the entire calculation
process. Even so, you would need to make sure the created thread
locked the mutex before the original thread tried to get at x.
You need to use a semaphore (or condition variable) here.
You cannot send a signal to a thread, you send it to a process.
You do not know how to make sure that a particular thread will receive
the value (although it can be done).
- Problem 4b: Read the problems carefully and answer the questions
that are asked. This is about the process signal mask, not about
any data structures the program has defined.
- Problem 5c: Semaphores can be used to do things other than protecting
critical sections. See part d) for an example. This question does not
ask about how semaphores are used.
- Problems 6a and 6b: These are general questions, not related to a
particular implementation such as paging or partitions.
- Problem 6c: This is specifically about partitions.