Re: [Updated3] Patch for ABCL against BORDEAUX-THREADS HEAD
Martin Simmons <martin@...
2011-03-02 19:50:05 GMT
>>>>> On Tue, 01 Mar 2011 16:18:35 +0100, Mark Evenson said:
> After critique from Stellian, I have [successfully brought my patches in
> alignment with BORDEAUX-THREADS GIT head].
> Please review this for inclusion.
> : http://slack.net/~evenson/abcl/bordeaux-threads-abcl-20110301a.diff
I think that the implementation of condition-wait has some major problems:
1) If no other threads are trying to claim the lock, then condition-wait will
return immediately rather than waiting.
2) If two threads are waiting in condition-wait and two other threads call
condition-notify, then it is possible that only one thread will return from
condition-wait because the call to acquire-lock in one of them might return
nil causing it to wait again.
3) If condition-notify is called by one thread when a waiting thread is just
about to enter the threads:synchronized-on form (but before it gets
synchronized), then the notify will be lost. This happens because the
underlying threading primitives have no "memory" of calls to notify when
nothing it waiting (which is also the expected semantics for POSIX condition
Also, I think condition-notify should be using threads:object-notify rather