CSIS3600 Quiz 6-answer

CSIS3600 Quiz 6-answer - CSIS 3600 Operating System...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSIS 3600 Operating System Concepts Quiz #6 Answer We discussed the use of spin-locks and semaphores for achieving mutual exclusion. Semaphores are designed to avoid busy waiting and provide fairness. (a) Is it always desirable to use semaphores rather than spin-locks? To answer, address the overhead incurred in each approach. In a multi-processor system, semaphores and spin-locks have some tradeoffs. Consider two processes A and B running on two processors X and Y, respectively. a) Small critical section Spin-lock is better. Assume A is in the critical section. A will be in for a very short time. B can spin on the lock for the short duration and then enter the critical section. If a semaphore is used, then process B will be switched out and another process on Y will be switched in. The process switch overhead makes semaphore solution a bad choice. ** It is possible that while A is in critical section, A is switched out. So, B will need to spin for a long time. But since the chance of this happening is very small,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/10/2008 for the course CSIS 3600 taught by Professor Tu during the Spring '08 term at Southern Utah.

Page1 / 2

CSIS3600 Quiz 6-answer - CSIS 3600 Operating System...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online