CS 3733 Operating Systems, Spring 2008 Assignment 5 Comments

Some comments on some of the questions:
  1. It should be volatile since it may be changed by a different thread.
  2. Yes.
  3. The buffer could be corrupted.
  4. Most likely, this did not happen since it would be a rare occurrence.
  5. Most people used mutex locks.
  6. volatile
  7. It should not be a problem since you are just checking to see if it ever changed from 0.
  8. Probably
  9. The thread may not be killed soon enough.
  10. One way to test this is to comment out the line that kills the second thread.
    If it is not killed, it might have a chance to generate a factor that is not prime.