1.0.37.57: better DEFMETHOD pretty-printing
[sbcl/pkhuong.git] / contrib / sb-concurrency / sb-concurrency.texinfo
blobf81223ccd1fb2b6696e968a40d1dbfe27a6dccd1
1 @node sb-concurrency
2 @section sb-concurrency
3 @cindex Concurrency
4 @cindex Sb-concurrency
6 Additional data structures, synchronization primitives and tools for
7 concurrent programming. Similiar to Java's @code{java.util.concurrent}
8 package.
10 @page
11 @anchor{Section sb-concurrency:queue}
12 @subsection Queue
13 @cindex Queue, lock-free
15 @code{sb-concurrency:queue} is a lock-free, thread-safe FIFO queue
16 datatype.
17 @*@*
18 The implementation is based on @cite{An Optimistic Approach to
19 Lock-Free FIFO Queues} by Edya Ladan-Mozes and Nir Shavit.
20 @*@*
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 @sp 1
26 @unnumberedsubsubsec Synopsis:
28 @code{enqueue} can be used to add objects to a queue, and
29 @code{dequeue} retrieves items from a queue in FIFO order.
31 @sp 1
32 @unnumberedsubsubsec Dictionary:
34 @include struct-sb-concurrency-queue.texinfo
36 @include fun-sb-concurrency-dequeue.texinfo
37 @include fun-sb-concurrency-enqueue.texinfo
38 @include fun-sb-concurrency-list-queue-contents.texinfo
39 @include fun-sb-concurrency-make-queue.texinfo
40 @include fun-sb-concurrency-queue-count.texinfo
41 @include fun-sb-concurrency-queue-empty-p.texinfo
42 @include fun-sb-concurrency-queue-name.texinfo
43 @include fun-sb-concurrency-queuep.texinfo
45 @page
46 @subsection Mailbox (lock-free)
47 @cindex Mailbox, lock-free
49 @code{sb-concurrency:mailbox} is a lock-free message queue where one
50 or multiple ends can send messages to one or multiple receivers. The
51 difference to @ref{Section sb-concurrency:queue} is that the receiving
52 end may block until a message arrives.
53 @*@*
54 The implementation is based on the Queue implementation above
55 (@pxref{Structure sb-concurrency:queue}.)
57 @sp 1
58 @unnumberedsubsubsec Synopsis:
59 @code{send-message} can be used to send a message to a mailbox, and
60 @code{receive-message} retrieves a message from a mailbox, or blocks
61 until a new message arrives. @code{receive-message-no-hang} is the
62 non-blocking variant.
63 @*@*
64 Messages can be any object.
66 @sp 1
67 @unnumberedsubsubsec Dictionary:
69 @include struct-sb-concurrency-mailbox.texinfo
71 @include fun-sb-concurrency-list-mailbox-messages.texinfo
72 @include fun-sb-concurrency-mailbox-count.texinfo
73 @include fun-sb-concurrency-mailbox-empty-p.texinfo
74 @include fun-sb-concurrency-mailbox-name.texinfo
75 @include fun-sb-concurrency-mailboxp.texinfo
76 @include fun-sb-concurrency-make-mailbox.texinfo
77 @include fun-sb-concurrency-receive-message.texinfo
78 @include fun-sb-concurrency-receive-message-no-hang.texinfo
79 @include fun-sb-concurrency-receive-pending-messages.texinfo
80 @include fun-sb-concurrency-send-message.texinfo