5 ms·
Note that bordeaux-threads, like CLIM-SYS or CFFI-sys, is not only a portability layer, but also a standard: BORDEAUX-THREADS is a proposed standard for a
by junke 9y ago
Note that bordeaux-threads, like CLIM-SYS or CFFI-sys, is not only a portability layer, but also a standard:
BORDEAUX-THREADS is a proposed standard for a minimal MP/Threading interface. It is similar to the CLIM-SYS threading and lock support, but for the following broad differences:
Some behaviours are defined in additional detail: attention has been given to special variable interaction, whether and when cleanup forms are run. Some behaviours are defined in less detail: an implementation that does not support multiple threads is not required to use a new list (nil) for a lock, for example.
Many functions which would be difficult, dangerous or inefficient to provide on some implementations have been removed. Chiefly these are functions such as thread-wait which expect for efficiency that the thread scheduler is written in Lisp and 'hookable', which can't sensibly be done if the scheduler is external to the Lisp image, or the system has more than one CPU.
Unbalanced ACQUIRE-LOCK and RELEASE-LOCK functions have been added.
Posix-style condition variables have been added, as it's not otherwise possible to implement them correctly using the other operations that are specified.
Threads may be implemented using whatever applicable techniques are provided by the operating system: user-space scheduling, kernel-based LWPs or anything else that does the job.
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.")
And so, instead of one standard like C, you have the CL standard, as well as additional standards that are not called annexes but fulfill the same role.
From a practical point of view, I consider portability layers to be sufficient; but having those additional standards offer stronger guarantees across implementations.
https://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocumentation https://trac.common-lisp.net/bordeaux-threads/wiki/ApiDocume...
https://common-lisp.net/project/cffi/spec/cffi-sys-spec.html#Introduction https://common-lisp.net/project/cffi/spec/cffi-sys-spec.html...
- flavio81 9y agoJust for showing how Bordeaux-Threads can be considered almost universally portable. This is the list of Lisp implementations supported by Bordeaux Threads: - Armed Bear Common Lisp (ABCL) - Allegro Common Lisp (ACL) - CLISP - Clozure CL - CMUCL - Corman Lisp - Embeddable Common Lisp (ECL) - LispWorks - MCL - MKCL - Steel Bank Common Lisp (SBCL) - Scieneer CL