From a95e33b9e091130664cc937102db84bc02eb27c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Thu, 10 Nov 2016 19:43:28 +0100 Subject: [PATCH] newdoc: mp: improve documentation --- src/doc/new-doc/extensions/mp.txi | 25 ++++++++++++++++++++- src/doc/new-doc/extensions/mp_ref_mutex.txi | 25 +++++++++++---------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/doc/new-doc/extensions/mp.txi b/src/doc/new-doc/extensions/mp.txi index adac2415a..36f065024 100644 --- a/src/doc/new-doc/extensions/mp.txi +++ b/src/doc/new-doc/extensions/mp.txi @@ -42,7 +42,30 @@ both for flexibility and a greater risk. In order to control access to different resources, ECL provides the user with locks, as explained in the next section. -@node Native threads reference +@node Locks (mutexes) +@subsection Locks and readers-writer locks + +Locks are used to synchronize access to the shared data. Lock may be +owned only by a single thread at any given time. Recursive locks may be +re-acquired by the same thread multiple times (and non-recursive locks +can't). + +Readers-writer (or shared-exclusive ) lock allows concurrent access for +read-only operations and write operations require exclusive access. + +@node Condition variables +@subsection Condition variables + +Condition variables are used to wait for a particular condition becoming +true (e.g new client connects to the server). + +@node Synchronization primitives +@subsection Semaphores +@subsection Barriers +@subsection Mailboxes +@subsection Atomic operations + +@node Native threads dictionary @subsection Native threads reference @include extensions/mp_ref_process.txi diff --git a/src/doc/new-doc/extensions/mp_ref_mutex.txi b/src/doc/new-doc/extensions/mp_ref_mutex.txi index 1b2c1b7cb..d416d9daa 100644 --- a/src/doc/new-doc/extensions/mp_ref_mutex.txi +++ b/src/doc/new-doc/extensions/mp_ref_mutex.txi @@ -1,19 +1,20 @@ - @node Locks -@subsubsection Locks (mutexes) -/* threads/process.d */ -@lspindex mp:make_lock -@cppindex mp_make_lock -@defun mp:make_lock -@table @var -@item returns -??? -@item C/C++ signature -cl_object mp_make_lock _ECL_ARGS((cl_narg narg, ...)); -@end table +@node Locks dictionary +@subsubsection Locks dictionary + + +@cppindex ecl_make_lock +@deftypefun ecl_make_lock (cl_object name, bool recursive) +@end deftypefun + + +@lspindex mp:make-lock + +@defun mp:make-lock &key name ((:recursive recursive) ECL_NIL) @end defun + @lspindex mp:recursive_lock_p @lspindex mp_recursive_lock_p @defun mp:recursive_lock_p