CIS343|510
Chapter Five Review w/ Answers1. Which is the correct definition of test and set?
B
2. Which of these mutual exclusion implementations are correct?
B & C
3. Which of these solutions to the infinite buffer producer/consumer problem using binary semaphores is correct?
B
4.
What problem can occur in the incorrect solution?Consumer can attempt to consume a nonexistent item
5. Which of these solutions to the infinite buffer producer/consumer problem using semaphores is correct?
B
6.
What problem can occur in the incorrect solution?Deadlock, if consumer enters CS when buffer is empty (n.count=0), since
no producer can ever append to buffer (blocked from CS)
7. Which of these implementations of sempahores involve busy waiting?
a. Dekker’s algorithm b. Peterson’s algorithm
c. Test and set d. Inhibiting interrupts
All except d
8. Which of these solutions to the bounded buffer producer/consumer problem using monitors is correct?
B
9.
Do binary semaphore have the same expressive power as general semaphores?Yes