CS 3733 Operating Systems, Spring 2010 Exam 2 Comments
Grade Distribution:
85-90: 5
80-84: 3
70-79: 12
60-69: 7
below 60: 6
Average: 69
- The first two problems were identical to ones on the first exam.
- Problem 3a: Do not say that the output will be interleaved. Most likely it
will not. The output may be interleaved.
- Problems 3b and 3c: Do not just say "use a pipe". You must explain
which processes write to the pipe, which reads, and which prints.
- Problems 3b and 3c: Use a critical section is not a good answer.
This is a general method and you need to be specific about which method
use to protect the critical section.
- Problems 3b and 3c: Peterson's solution is not a good method to use
because it requires us to share variables between children and because
it uses busy waiting.
- Problems 3b and 3c: Using a pipe and a named pipe are not really two
different methods.
- Problem 4b: mutexes still need to be initialized, even though they do
not have a value. If you tried to initialize the mutex to a numeric value,
one point was taken off.
- Problem 5: Also acceptable was an answer that indicated that only one
byte was changed by the assignment. This is not the same as saying you are
assigning a small value since the initial value might have been large.
- Problem 6: Do not say:
the pipe is empty and no process has written to the pipe.
- Problem 7a: Some students said they disagreed, but the explanation was
about why they agree.
- Problem 7a: Another acceptable answer was one in which you indicate the
each thread that calls the function gets its own copy of the variable.
- Problem 7b: Some students thought that this was about reading from a pipe.
- Problem 7b: Another acceptable answer would be to agree by indicating that
small enough means one byte.
- Problem 8a: The consumer loop should consume the item.
- Problem 9a: You need not mention the C library here.
But if you do, keep in mind that whether or not parts of the C library
are async-signal-safe depends on the implementation.
There are implementations in which most of the functions are
safe to use with signals.
- Problem 9d: One possible correct answer is to say the the semaphore wait
functions are not async-signal-safe, but even if they were, semaphores
could not be used to solve this problem.
With most semaphore implementations, the wait function is interrupted
by a caught signal, with -1 returned and the errno set to EINTR.
The semaphore is still locked, so if wait is called inside the signal
handler, the handler will be blocked.
- Problem 9e: Mutexes cannot solve the problem. The signal handler would
try to lock the mutex while it is already locked, which is a prohibited
operation.
- Problem 10: It is important to answer the question that is asked.
- Problem 11c: Do not assume that there is more to the problem than stated.
It does not say that B has requested a value from A.
A service does not need to be the computation of a number.
We had looked at an example of a log server that just receives logging
information but does not compute anything.