2 @section sb-concurrency
6 Additional data structures, synchronization primitives and tools for
7 concurrent programming. Similiar to Java's @code{java.util.concurrent}
11 @anchor{Section sb-concurrency:queue}
13 @cindex Queue, lock-free
15 @code{sb-concurrency:queue} is a lock-free, thread-safe FIFO queue
18 The implementation is based on @cite{An Optimistic Approach to
19 Lock-Free FIFO Queues} by Edya Ladan-Mozes and Nir Shavit.
21 Before SBCL 1.0.38, this implementation resided in its own contrib
22 (@pxref{sb-queue}) which is still provided for backwards-compatibility
23 but which has since been deprecated.
25 @include struct-sb-concurrency-queue.texinfo
27 @include fun-sb-concurrency-dequeue.texinfo
28 @include fun-sb-concurrency-enqueue.texinfo
29 @include fun-sb-concurrency-list-queue-contents.texinfo
30 @include fun-sb-concurrency-make-queue.texinfo
31 @include fun-sb-concurrency-queue-count.texinfo
32 @include fun-sb-concurrency-queue-empty-p.texinfo
33 @include fun-sb-concurrency-queue-name.texinfo
34 @include fun-sb-concurrency-queuep.texinfo
37 @subsection Mailbox (lock-free)
38 @cindex Mailbox, lock-free
40 @code{sb-concurrency:mailbox} is a lock-free message queue where one
41 or multiple ends can send messages to one or multiple receivers. The
42 difference to @ref{Section sb-concurrency:queue, queues} is that the receiving
43 end may block until a message arrives.
45 Built on top of the @ref{Structure sb-concurrency:queue, queue} implementation.
47 @include struct-sb-concurrency-mailbox.texinfo
49 @include fun-sb-concurrency-list-mailbox-messages.texinfo
50 @include fun-sb-concurrency-mailbox-count.texinfo
51 @include fun-sb-concurrency-mailbox-empty-p.texinfo
52 @include fun-sb-concurrency-mailbox-name.texinfo
53 @include fun-sb-concurrency-mailboxp.texinfo
54 @include fun-sb-concurrency-make-mailbox.texinfo
55 @include fun-sb-concurrency-receive-message.texinfo
56 @include fun-sb-concurrency-receive-message-no-hang.texinfo
57 @include fun-sb-concurrency-receive-pending-messages.texinfo
58 @include fun-sb-concurrency-send-message.texinfo
61 @anchor{Section sb-concurrency:gate}
65 @code{sb-concurrency:gate} is a synchronization object suitable for when
66 multiple threads must wait for a single event before proceeding.
68 @include struct-sb-concurrency-gate.texinfo
70 @include fun-sb-concurrency-close-gate.texinfo
71 @include fun-sb-concurrency-gate-name.texinfo
72 @include fun-sb-concurrency-gate-open-p.texinfo
73 @include fun-sb-concurrency-gatep.texinfo
74 @include fun-sb-concurrency-make-gate.texinfo
75 @include fun-sb-concurrency-open-gate.texinfo
76 @include fun-sb-concurrency-wait-on-gate.texinfo
79 @anchor{Section sb-concurrency:frlock}
80 @subsection Frlocks, aka Fast Read Locks
82 @cindex Fast Read Lock
84 @include struct-sb-concurrency-frlock.texinfo
86 @include macro-sb-concurrency-frlock-read.texinfo
87 @include macro-sb-concurrency-frlock-write.texinfo
89 @include fun-sb-concurrency-make-frlock.texinfo
90 @include fun-sb-concurrency-frlock-name.texinfo
92 @include fun-sb-concurrency-frlock-read-begin.texinfo
93 @include fun-sb-concurrency-frlock-read-end.texinfo
94 @include fun-sb-concurrency-grab-frlock-write-lock.texinfo
95 @include fun-sb-concurrency-release-frlock-write-lock.texinfo