Exercise questions ------------------ 1. State the differences between threads and processes. 2. Specify the hardware support necessary for memory protection, and explain briefly how it works. 3. State the correctness criteria for the producer-consumer problem. 4. Write down a solution of the Producer-Consumer problem using monitor. Let N be the buffer size. 5. Write down the solution of the Readers-Writers problem using 3 semaphores (mitex, OKTORead, OKToWreite). 6. Synchronization has two parts: mutual exclusion and scheduling. Discuss how they are provided in monitors. 7. Draw the state transision diagram of a process and indicate which transition can be incurred by wait and signal operations of a monitor. 8. In the semaphore solution of readers/writers, can OKToWrite ever get greater than 1? What about OKToRead? Explain how it can (or cannot) happen. 9. In the monitor solution of readers/writers, is FIFO order guaranteed for Writers (i.e., the first writer who calls checkWrite will go into the database before other writers who call checkWrite later)? 10. Regarding the monitor solution of readers/writers, if the first writer (P1) is inside the doneWrite procedure when the second writer (P2) arrives to the system, how far can it go within the checkWrite procedure?