From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Diogo F. S. Ramos" Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Add observation that ports are not thread-safe Date: Tue, 25 Mar 2014 17:36:28 -0300 Message-ID: <1395779788-24115-1-git-send-email-dfsr@riseup.net> References: <87vbv2qd9e.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1395779846 32348 80.91.229.3 (25 Mar 2014 20:37:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Mar 2014 20:37:26 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Mar 25 21:37:35 2014 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WSY6I-0008Tb-VB for guile-devel@m.gmane.org; Tue, 25 Mar 2014 21:37:35 +0100 Original-Received: from localhost ([::1]:44150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSY6I-0008Hj-CQ for guile-devel@m.gmane.org; Tue, 25 Mar 2014 16:37:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSY66-0008H4-S0 for guile-devel@gnu.org; Tue, 25 Mar 2014 16:37:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSY60-0005gK-Hj for guile-devel@gnu.org; Tue, 25 Mar 2014 16:37:22 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:45247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSY60-0005gD-B4 for guile-devel@gnu.org; Tue, 25 Mar 2014 16:37:16 -0400 Original-Received: from fruiteater.riseup.net (fruiteater-pn.riseup.net [10.0.1.74]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Gandi Standard SSL CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id B8E824FED5 for ; Tue, 25 Mar 2014 13:37:15 -0700 (PDT) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dfsr@fruiteater.riseup.net) with ESMTPSA id EE70FF46 X-Mailer: git-send-email 1.9.1 In-Reply-To: <87vbv2qd9e.fsf@pobox.com> X-Virus-Scanned: clamav-milter 0.98.1 at mx1 X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 198.252.153.129 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:17015 Archived-At: 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 --- I'm not sure about the verb tense of "Ports will be thread-safe in Guile 2.2." because you said "[...] this situation is fixed in 2.2." doc/ref/api-io.texi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi index 02d92a2..de4020a 100644 --- a/doc/ref/api-io.texi +++ b/doc/ref/api-io.texi @@ -88,6 +88,11 @@ 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}). Ports will be thread-safe in +Guile 2.2. + @rnindex input-port? @deffn {Scheme Procedure} input-port? x @deffnx {C Function} scm_input_port_p (x) -- 1.9.1