[threads-standard-discuss] bordeaux-mp Specification,1.6,1.7

Daniel Barlow,,, dan at loaclhost.telent.net
Mon Jul 12 23:41:53 UTC 2004


Update of /usr/local/src/cvs/bordeaux-mp
In directory loaclhost.telent.net:/tmp/cvs-serv28367

Modified Files:
	Specification 
Log Message:
condition variables: minor edits

Index: Specification
===================================================================
RCS file: /usr/local/src/cvs/bordeaux-mp/Specification,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Specification	12 Jul 2004 23:28:43 -0000	1.6
+++ Specification	12 Jul 2004 23:41:50 -0000	1.7
@@ -208,8 +208,8 @@
 condition-variable 
 
 1) A acquires the lock that safeguards access to C
-2) A processes and removes all events that are present
-3) When the channel is empty, A calls CONDITION-WAIT, which atomically
+2) A processes and removes all events that are available in C
+3) When C is empty, A calls CONDITION-WAIT, which atomically
  releases the lock and puts A to sleep on CV
 4) Loop back to step 1, for as long as processing should continue
 
@@ -219,11 +219,12 @@
 3) releases the lock
 4) calls CONDITION-NOTIFY on CV to wake any sleeping process
 
-The implementation must guarantee that CONDITION-WAIT in process A
-atomically release the lock and sleeps.  If this does not happen, and
-process B can add an event an call CONDITION-NOTIFY between the lock
-release and the sleep, the notify call will not see A.  This is the
-"lost wakeup" problem.
+To avoid the "lost wakeup" problem, the implementation must guarantee
+that CONDITION-WAIT in process A atomically release the lock and
+sleeps.  If this is not guaranteed there is the possibility that
+process B can add an event and call CONDITION-NOTIFY between the lock
+release and the sleep - in this case the notify call would not see A,
+which would be left sleeping despite there being events available.
 
 make-condition-variable () [function]
 





More information about the Threads-standard-discuss mailing list