Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
As we know now, one needs both locks and condition variables to solve a broad range of relevant and interesting concurrency
 

Summary: 30
Semaphores
As we know now, one needs both locks and condition variables
to solve a broad range of relevant and interesting concurrency
problems. The first person who realized this years ago was Eds-
ger Dijkstra, known among other things for his famous "short-
est paths" algorithm in graph theory [D59], an early polemic
on structured programming entitled "Goto Statements Consid-
ered Harmful" [D68a] (what a great title!), and, in the case we
will study here, the introduction of a powerful and flexible syn-
chronization primitive known as the semaphore [D68b,other].
Indeed, he invented this general semaphore before locks and
condition variables; as you will see, one can use semaphores in
both kinds of ways.
30.1 Semaphores: A Definition
A semaphore is as an object with an integer value that we can
manipulate with two routines (which we will call sem wait()
and sem post() to follow the POSIX standard). Because the
initial value of the semaphore determines its behavior, before
calling any other routine to interact with the semaphore, we

  

Source: Arpaci-Dusseau, Remzi - Department of Computer Sciences, Department of Computer Sciences, University of Wisconsin at Madison

 

Collections: Computer Technologies and Information Sciences