lec11-semaphores - Lecture 11: Synchronization (Chapter 6,...

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

View Full Document Right Arrow Icon
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 11: Synchronization (Chapter 6, cont)
Background image of page 1

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

View Full DocumentRight Arrow Icon
6.2 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Semaphores (by Dijkstra 1930 – 2002) Born in Rotterdam, The Netherlands 1972 recipient of the ACM Turing Award Responsible for The idea of building operating systems as explicitly synchronized sequential processes The formal development of computer programs Best known for His efficient shortest path algorithm Having designed and coded the first Algol 60 compiler. Famous campaign for the abolition of the GOTO statement Also known for his hand-written communications with friends and colleagues. For example: http://www.cs.utexas.edu/users/EWD/ewd12xx/EWD1205.PDF
Background image of page 2
6.3 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Semaphores Synchronization tool that does not require busy waiting Semaphore S – integer variable Two standard operations modify S: wait() and signal() Originally called P() and V() Also called down() and up() The value of S can only be accessed through wait() and signal() wait (S) { signal (S) { while S <= 0 S++; ; // no-op } S--; }
Background image of page 3

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

View Full DocumentRight Arrow Icon
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Semaphore Implementation with no Busy waiting With each semaphore there is an associated waiting queue. typedef struct{ tnt value; struct process *list; } semaphore; Two operations on processes: block – place the process invoking the operation on the appropriate waiting queue. wakeup
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

lec11-semaphores - Lecture 11: Synchronization (Chapter 6,...

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

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