From: "Diogo F. S. Ramos" <dfsr@riseup.net>
To: guile-devel@gnu.org
Subject: [PATCH] Add observation that ports are not thread-safe
Date: Tue, 25 Mar 2014 08:14:28 -0300 [thread overview]
Message-ID: <1395746068-20604-1-git-send-email-dfsr@riseup.net> (raw)
It's not obvious that ports are not thread-safe and trying to have
multiple threads writing to one returns errors that are not
recognizable as been caused by this lack of thread-safeness.
* doc/ref/guile.texi: non thread-safe observation
---
doc/ref/api-io.texi | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi
index 02d92a2..e9f79ae 100644
--- a/doc/ref/api-io.texi
+++ b/doc/ref/api-io.texi
@@ -88,6 +88,10 @@ representation for output. There are three possible strategies: to
raise an error, to replace the character with a hex escape, or to
replace the character with a substitute character.
+Ports are not thread-safe. A port has to be protected if you want to
+access it from multiple threads using mechanisms like mutexes.
+(@pxref{Mutexes and Condition Variables})
+
@rnindex input-port?
@deffn {Scheme Procedure} input-port? x
@deffnx {C Function} scm_input_port_p (x)
--
1.9.1
next reply other threads:[~2014-03-25 11:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-25 11:14 Diogo F. S. Ramos [this message]
2014-03-25 14:14 ` [PATCH] Add observation that ports are not thread-safe Andy Wingo
2014-03-25 17:10 ` Diogo F. S. Ramos
2014-03-25 19:39 ` Andy Wingo
2014-03-25 20:36 ` Diogo F. S. Ramos
2014-04-15 11:24 ` Diogo F. S. Ramos
2014-03-26 5:10 ` Guile's I/O procedures should *not* do thread synchronization Mark H Weaver
2014-03-26 8:25 ` Andy Wingo
2014-03-26 15:32 ` Mark H Weaver
2014-03-26 19:45 ` Andy Wingo
2014-04-06 6:08 ` Mark H Weaver
2014-04-08 20:53 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395746068-20604-1-git-send-email-dfsr@riseup.net \
--to=dfsr@riseup.net \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).