projects
/
sbcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Constant-fold backquote of constant expressions
[sbcl.git]
/
doc
/
manual
/
threading.texinfo
diff --git
a/doc/manual/threading.texinfo
b/doc/manual/threading.texinfo
index
1ea5e9a
..
f8f77da
100644
(file)
--- a/
doc/manual/threading.texinfo
+++ b/
doc/manual/threading.texinfo
@@
-109,6
+109,8
@@
lockless algorithms.
@include macro-sb-ext-atomic-decf.texinfo
@include macro-sb-ext-atomic-incf.texinfo
@include macro-sb-ext-atomic-decf.texinfo
@include macro-sb-ext-atomic-incf.texinfo
+@include macro-sb-ext-atomic-pop.texinfo
+@include macro-sb-ext-atomic-push.texinfo
@include macro-sb-ext-atomic-update.texinfo
@include macro-sb-ext-compare-and-swap.texinfo
@include macro-sb-ext-atomic-update.texinfo
@include macro-sb-ext-compare-and-swap.texinfo
@@
-116,11
+118,12
@@
lockless algorithms.
Our @code{compare-and-swap} is user-extensible using a protocol
similar to @code{setf}, allowing users to add CAS support to new
Our @code{compare-and-swap} is user-extensible using a protocol
similar to @code{setf}, allowing users to add CAS support to new
-places via eg. @code{defcas}.
+places via e.g. @code{defcas}.
At the same time, new atomic operations can be built on top of CAS
At the same time, new atomic operations can be built on top of CAS
-using @code{get-cas-expansion}. See @code{atomic-update} for an
-example.
+using @code{get-cas-expansion}. See @code{atomic-update},
+@code{atomic-push}, and €@code{atomic-pop} for example of how to do
+this.
@include macro-sb-ext-cas.texinfo
@include macro-sb-ext-define-cas-expander.texinfo
@include macro-sb-ext-cas.texinfo
@include macro-sb-ext-define-cas-expander.texinfo
@@
-136,10
+139,6
@@
thread is allowed to hold the mutex, others which attempt to take it
will be made to wait until it's free. Threads are woken in the order
that they go to sleep.
will be made to wait until it's free. Threads are woken in the order
that they go to sleep.
-There isn't a timeout on mutex acquisition, but the usual WITH-TIMEOUT
-macro (which throws a TIMEOUT condition after n seconds) can be used
-if you want a bounded wait.
-
@lisp
(defpackage :demo (:use "CL" "SB-THREAD" "SB-EXT"))
@lisp
(defpackage :demo (:use "CL" "SB-THREAD" "SB-EXT"))
@@
-159,21
+158,23
@@
if you want a bounded wait.
@end lisp
@include struct-sb-thread-mutex.texinfo
@end lisp
@include struct-sb-thread-mutex.texinfo
+
+@include macro-sb-thread-with-mutex.texinfo
+@include macro-sb-thread-with-recursive-lock.texinfo
+
@include fun-sb-thread-make-mutex.texinfo
@include fun-sb-thread-mutex-name.texinfo
@include fun-sb-thread-make-mutex.texinfo
@include fun-sb-thread-mutex-name.texinfo
+@include fun-sb-thread-mutex-owner.texinfo
@include fun-sb-thread-mutex-value.texinfo
@include fun-sb-thread-grab-mutex.texinfo
@include fun-sb-thread-release-mutex.texinfo
@include fun-sb-thread-mutex-value.texinfo
@include fun-sb-thread-grab-mutex.texinfo
@include fun-sb-thread-release-mutex.texinfo
-@include macro-sb-thread-with-mutex.texinfo
-@include macro-sb-thread-with-recursive-lock.texinfo
-@include fun-sb-thread-get-mutex.texinfo
@node Semaphores
@comment node-name, next, previous, up
@section Semaphores
Semaphores are among other things useful for keeping track of a
@node Semaphores
@comment node-name, next, previous, up
@section Semaphores
Semaphores are among other things useful for keeping track of a
-countable resource, eg. messages in a queue, and sleep when the
+countable resource, e.g. messages in a queue, and sleep when the
resource is exhausted.
@include struct-sb-thread-semaphore.texinfo
resource is exhausted.
@include struct-sb-thread-semaphore.texinfo
@@
-208,7
+209,7
@@
There are three components:
the condition itself (not represented in code)
@item
the condition itself (not represented in code)
@item
-the condition variable (a.k.a waitqueue) which proxies for it
+the condition variable (a.k.a. waitqueue) which proxies for it
@item
a lock to hold while testing the condition
@item
a lock to hold while testing the condition
@@
-287,11
+288,12
@@
following functions and macros also serve as @code{:memory} barriers:
@itemize
@item
@itemize
@item
-@code{sb-ext:atomic-decf} and @code{sb-ext:atomic-incf}.
+@code{sb-ext:atomic-decf}, @code{sb-ext:atomic-incf}, @code{sb-ext:atomic-push},
+and @code{sb-ext:atomic-pop}.
@item
@code{sb-ext:compare-and-swap}.
@item
@item
@code{sb-ext:compare-and-swap}.
@item
-@code{sb-thread:get-mutex}, @code{sb-thread:release-mutex},
+@code{sb-thread:grab-mutex}, @code{sb-thread:release-mutex},
@code{sb-thread:with-mutex} and @code{sb-thread:with-recursive-lock}.
@item
@code{sb-thread:signal-semaphore}, @code{sb-thread:try-semaphore} and
@code{sb-thread:with-mutex} and @code{sb-thread:with-recursive-lock}.
@item
@code{sb-thread:signal-semaphore}, @code{sb-thread:try-semaphore} and