bordeaux-threads is a proposed standard for a minimal MP/threading interface.
About This Package
Resource contention: locks and recursive locks
Resource contention: condition variables
AuthorBased on original Bordeaux-MP spec by Dan Barlow <email@example.com>
VersionThis is a documentation of Version 0.8.2.
Mailing Listbordeaux-threads-devel for developers
bordeaux-threads-announce for announcements
bordeaux-threads-ticket for bug updates
DownloadReleases are available at http://common-lisp.net/project/bordeaux-threads/releases/
Source CodeYou can browse the repository or download the current development tree at common-lisp.net or gitorious
Dependenciesbordeaux-threads needs the package alexandria.
LicensePermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. CLIM-SYS threading and lock support, but for the following broad differences:
Some parts of this specification can also be implemented in a Lisp that does not support multiple threads. Thread creation and some thread inspection operations will not work, but the locking functions are still present (though they may do nothing) so that thread-safe code can be compiled on both multithread and single-thread implementations without need of conditionals.
To avoid conflict with existing MP/threading interfaces in implementations, these symbols live in the bordeaux-threads package. Implementations and/or users may also make them visible or exported in other more traditionally named packages.
Creates and returns a thread named name, which will call the function function with no arguments: when function returns, the thread terminates. ...
Returns the thread object for the calling thread. ...
Returns true if object is a thread, otherwise nil.
Returns the name of the thread, as supplied to make-thread.
Creates a lock (a mutex) whose name is name. ...
Acquire the lock lock for the calling thread. ...
Release lock. ...
Create and return a recursive lock whose name is name. ...
As for acquire-lock, but for recursive locks.
Release the recursive lock. ...
A condition variable must be used in conjunction with a lock to protect access to the state of the object of interest. The procedure is as follows:
Suppose two threads A and B, and some kind of notional event channel C. A is consuming events in C, and B is producing them. CV is a condition-variable
Allows other threads to run. ...
Atomically release lock and enqueue the calling thread waiting for condition-variable. ...
Notify at least one of the threads waiting for condition-variable. ...
Returns a sequence of all of the threads. This may not be freshly-allocated, so the caller should not modify it.
Interrupt thread and cause it to evaluate function before continuing with the interrupted path of execution. ...
Returns true if thread is alive, that is, if destroy-thread has not been called on it.
Wait until thread terminates. If thread has already terminated, return immediately.