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 08:14:28 -0300 Message-ID: <1395746068-20604-1-git-send-email-dfsr@riseup.net> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1395746099 5230 80.91.229.3 (25 Mar 2014 11:14:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Mar 2014 11:14:59 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Mar 25 12:15:09 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 1WSPK0-0003zq-Uz for guile-devel@m.gmane.org; Tue, 25 Mar 2014 12:15:09 +0100 Original-Received: from localhost ([::1]:41002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSPK0-000470-E8 for guile-devel@m.gmane.org; Tue, 25 Mar 2014 07:15:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSPJr-0003xx-0D for guile-devel@gnu.org; Tue, 25 Mar 2014 07:15:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSPJl-0003da-0u for guile-devel@gnu.org; Tue, 25 Mar 2014 07:14:58 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:60192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSPJk-0003dO-RF for guile-devel@gnu.org; Tue, 25 Mar 2014 07:14:52 -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 B5487430EA for ; Tue, 25 Mar 2014 04:14:51 -0700 (PDT) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dfsr@fruiteater.riseup.net) with ESMTPSA id B7C28F91 X-Mailer: git-send-email 1.9.1 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:17006 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 --- 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