diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-03-14 23:37:00 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-03-14 23:41:10 +0100 |
commit | deec8986ff889724a6fa3fdd9d5e7221473956fe (patch) | |
tree | 42e49a939078580ead020246f5b59e9f60da40db /doc/ref/libguile-concepts.texi | |
parent | d3b5628c6de88ee08787aab5b1af96f913b77ed4 (diff) | |
download | guile-deec8986ff889724a6fa3fdd9d5e7221473956fe.tar.gz |
doc: Update "Multi-Threading" node.
* doc/ref/libguile-concepts.texi (Multi-Threading): Remove bits about
the requirement not to block in guile mode.
Diffstat (limited to 'doc/ref/libguile-concepts.texi')
-rw-r--r-- | doc/ref/libguile-concepts.texi | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/doc/ref/libguile-concepts.texi b/doc/ref/libguile-concepts.texi index 16f07e125..c14973027 100644 --- a/doc/ref/libguile-concepts.texi +++ b/doc/ref/libguile-concepts.texi @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Guile Reference Manual. -@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005 +@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2010 @c Free Software Foundation, Inc. @c See the file guile.texi for copying conditions. @@ -450,21 +450,15 @@ that are stored in local variables. When a thread puts itself into guile mode for the first time, it gets a Scheme representation and is listed by @code{all-threads}, for example. -While in guile mode, a thread promises to reach a safe point -reasonably frequently (@pxref{Asynchronous Signals}). In addition to -running signal handlers, these points are also potential rendezvous -points of all guile mode threads where Guile can orchestrate global -things like garbage collection. Consequently, when a thread in guile -mode blocks and does no longer frequent safe points, it might cause -all other guile mode threads to block as well. To prevent this from -happening, a guile mode thread should either only block in libguile -functions (who know how to do it right), or should temporarily leave -guile mode with @code{scm_without_guile}. - -For some common blocking operations, Guile provides convenience -functions. For example, if you want to lock a pthread mutex while in -guile mode, you might want to use @code{scm_pthread_mutex_lock} which is -just like @code{pthread_mutex_lock} except that it leaves guile mode +Threads in guile mode can block (e.g., do blocking I/O) without causing any +problems@footnote{In Guile 1.8, a thread blocking in guile mode would prevent +garbage collection to occur. Thus, threads had to leave guile mode whenever +they could block. This is no longer needed with Guile 2.0.}; temporarily +leaving guile mode with @code{scm_without_guile} before blocking slightly +improves GC performance, though. For some common blocking operations, Guile +provides convenience functions. For example, if you want to lock a pthread +mutex while in guile mode, you might want to use @code{scm_pthread_mutex_lock} +which is just like @code{pthread_mutex_lock} except that it leaves guile mode while blocking. |