by zach @ . March 25, 2011 . 3:59AM
by zach @ . March 18, 2011 . 3:59AM
by Zacharias @ http://inexactitu.de . March 17, 2011 . 12:20PM
1. The test-and-set (TS) instruction and the swap instruction are part of the hardware support for process synchronization contained in modern CPUs.
True. Since test-and-set solutions rely on condition codes (stored in the PSW), the processor reads the previous instruction.
2. Although the spin-lock solution and the Peterson algorithm provide busy-waiting solutions to the critical section problem, only the spin-lock solution controls the order of entry for waiting processes.
False. Spin-locks don’t control order. Peterson’s is a busy-wait in software.
3. In class we discussed a bounded-waiting solution to the critical section problem using test-and-set. This solution works because a process exiting the critical section transferees control of entry to the next process in an ordered list awaiting entry.
True. Bounded-waiting Mutual Exclusion with TestandSet().
4. In the single producer – single consumer, multi-slot budder problem, the critical section is the manipulation of the count of the number of filled cells.
True.
5. The implementation of the operations P & V on binary semaphores only require block/wakeup, while these same operations on general semaphores require block/wakeup and counting.
False. We want this to happen at their own rate. We are looking at the count value.
6. When semaphores and semaphore operations are implemented in a non-preeemmptable kernel, we will not have any busy waiting.
True. We need to do this if the semaphore is implemented in user-space.
7. In the multiple producer, multiple consumer problem with a multi-slot buffer, we require mutual exclusion of the ‘deposit’ and ‘take’ to ensure proper order of entry.
False. This solution doesn’t provide proper order. This only provides only the ability to feed the consumer empty spaces and the consumer full spaces.
8. How many philosophers may eat simultaneously in the Dining Philosophers problem with only 4 philosophers?
Two. Draw a picture if this isn’t obvious.
9. The readers-writers problem discussed in class…
c… required that no reader will be kept waiting unless a writer has already obtained permission to use the shared database.
10. A monitor wait() operation always blocks.
True. Waiting signal can be implemented using semaphores. A monitor wait using a binary semaphore initialized to 0, whenever a process waits, it’s guaranteed to block.
Questions about how semaphores are implemented and conditions are implemented. This is very important to synchronization.
by zach @ . March 11, 2011 . 3:59AM
by zach @ . March 4, 2011 . 3:59AM