lecture10-chapter05 - OperatingSystems Lecture10 Semaphores...

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

View Full Document Right Arrow Icon
Operating Systems Lecture 10: Semaphores Anda Iamnitchi [email protected] 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Mutual Exclusion Idea #3: Semaphores There is no way to inspect or manipulate semaphores other than these three operations A variable that has an integer value upon which only three operations are defined: 1) May be initialized to a nonnegative integer value 2) The semWait operation decrements the value 3) The semSignal operation increments the value
Background image of page 2
Semaphore Primitives
Background image of page 3

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

View Full DocumentRight Arrow Icon
Binary Semaphore Primitives
Background image of page 4
Consequences Three consequences of the semaphore definition: There is no way to know before a process decrements a semaphore whether it will block or not. After a process increments a semaphore and another process gets woken up, both processes continue running concurrently. There is no way to know which process, if either, will continue immediately on a uniprocessor system. When you signal a semaphore, you don’t necessarily know whether another process is waiting, so the number of unblocked processes may be zero or one.
Background image of page 5

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

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

This note was uploaded on 02/18/2012 for the course COP 4600 taught by Professor Andaiamnitchi during the Fall '08 term at University of South Florida.

Page1 / 24

lecture10-chapter05 - OperatingSystems Lecture10 Semaphores...

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

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