I have a lispworks.lisp for bordeaux in which I've added a few entries to bring it more into line with sbcl and cmucl's capabilities
Most notable is condition variable support. Lispworks doesn't appear to support the same conditionals per se (probably why it wasn't trivially added to bordeaux) but its Lispworks wait seems to poll some predicate at some interval - I emulated conditions out of these.
The condition variable basically stores a hashtable (containing only unnotified waiters known to be waiting) and a t-list for supporting queue ordering. Notification notifies only a SINGLE ELEMENT, as the docs claimed was desirable. I've included checks for some plausible cases where a process could leave the wait for reasons other than receiving the notification; but to ensure that an eligible waiter receives the next notification when it arrives. Unwind-protection ensures that the registered waiter is removed from the data structure, and that any unseen notification is passed on to the next waiter.
Please let me know if this sounds to be on the right track, and how/to whom I should submit the change.
Matthew Lamari wrote:
I have a lispworks.lisp for bordeaux in which I've added a few entries to bring it more into line with sbcl and cmucl's capabilities
Most notable is condition variable support. Lispworks doesn't appear to support the same conditionals per se (probably why it wasn't trivially added to bordeaux) but its Lispworks wait seems to poll some predicate at some interval - I emulated conditions out of these.
There is a portable implementation of condition variables included for implementations that don't support them directly. It's better (IMO) to use real condition vars where you can, but I'm curious if the portable ones weren't actually working.
The condition variable basically stores a hashtable (containing only unnotified waiters known to be waiting) and a t-list for supporting queue ordering. Notification notifies only a SINGLE ELEMENT, as the docs claimed was desirable. I've included checks for some plausible cases where a process could leave the wait for reasons other than receiving the notification; but to ensure that an eligible waiter receives the next notification when it arrives. Unwind-protection ensures that the registered waiter is removed from the data structure, and that any unseen notification is passed on to the next waiter.
Please let me know if this sounds to be on the right track, and how/to whom I should submit the change.
This definitely sounds like the right track.
The easiest way to submit the change would be to `darcs send` the patch to this list. Failing that, just attach the diff or whatever.
bordeaux-threads-devel@common-lisp.net