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]