From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Pirotte Newsgroups: gmane.lisp.guile.devel Subject: Re: port threadsafety redux Date: Fri, 13 Feb 2015 16:35:36 -0200 Message-ID: <20150213163536.3c2e380a@capac> References: <87vbj816sg.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/41ia416QBHVWdpJfP/CDwD0"; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1423852616 8962 80.91.229.3 (13 Feb 2015 18:36:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Feb 2015 18:36:56 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Feb 13 19:36:50 2015 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 1YML6f-0002kX-EL for guile-devel@m.gmane.org; Fri, 13 Feb 2015 19:36:49 +0100 Original-Received: from localhost ([::1]:57112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YML6Z-0003Mr-VQ for guile-devel@m.gmane.org; Fri, 13 Feb 2015 13:36:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YML64-0002mR-SP for guile-devel@gnu.org; Fri, 13 Feb 2015 13:36:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YML60-0000Qc-0t for guile-devel@gnu.org; Fri, 13 Feb 2015 13:36:12 -0500 Original-Received: from maximusconfessor.all2all.org ([79.99.200.102]:55667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YML5z-0000Oa-S4 for guile-devel@gnu.org; Fri, 13 Feb 2015 13:36:07 -0500 Original-Received: from localhost (unknown [192.168.0.2]) by maximusconfessor.all2all.org (Postfix) with ESMTP id BF91AA04C0EA; Fri, 13 Feb 2015 19:35:46 +0100 (CET) Original-Received: from maximusconfessor.all2all.org ([192.168.0.1]) by localhost (maximusconfessor.all2all.org [192.168.0.2]) (amavisd-new, port 10024) with ESMTP id aVw7BYTF6GAM; Fri, 13 Feb 2015 19:35:40 +0100 (CET) Original-Received: from capac (unknown [179.210.40.115]) by maximusconfessor.all2all.org (Postfix) with ESMTPSA id 40E71A04C0EC; Fri, 13 Feb 2015 19:35:39 +0100 (CET) In-Reply-To: <87vbj816sg.fsf@pobox.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 79.99.200.102 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:17659 Archived-At: --Sig_/41ia416QBHVWdpJfP/CDwD0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Andy, > ... > This change fixed the crashes I was seeing, but it slows down port > operations. For an intel chip from a couple years ago the slowdown was > something on the order of 3x, for a tight putchar() loop; for Loongson > it could be as bad as 26x. Mark was unhappy with this. I agree with Mark here, especially because it slows down port operation eve= n for single threaded code. > But there are situations where this is not enough and there are also > situations where this is not wanted... Indeed. > One possible alternate solution would be to expose ports more to Scheme > and so to make it easier and safer for Scheme to manipulate port data. > This would also make it possible to implement coroutines in Scheme that > yield when IO would block. Not only does it sounds the best approach, but I can't see drawbacks, is th= ere any? I am in favor of this solution: in the end, only the user knows, and the wa= y Mark resumed this in his email is perfect [the last 3 paragraphs] > Or, we could just make stdio/stderr be locked by default, and some other > things not. Seems squirrely to me though. I would not do that, even for these ports, I'd leave them under the user locking responsiblity. Cheers, David --Sig_/41ia416QBHVWdpJfP/CDwD0 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJU3kP4AAoJEPN0/ZOjBXrXqTkH/ibwlS6ARmLtZaYkJMDa5mrx XkVZTLTMaO7cVoQ31U/4fVAu9zoU0hy5WzFxi93deip7J42SBrppCvwzqTb70t7J Ul64ka2JEYeCkBpZKrQicQwbvdlzNSS4/puDe1tjc1zj2jT6KkWuPUG6lZoD9JsY 5RXwjCRzJFkx2e6O0BqHk8HluhMg2ppOwx+pgSmegiiEhccLMyg7YQTSvjmWdNlU nIZ6H1bHOorJ07e62CXNjYLQVffH7Ukq+LF5iQGRy8VgZBn9n+YabdkrN57ji46s O6jxTdV+pq3TLT7zKjgaP5QxaAf8Jk/BMtrDL5XVubnxBFF4lb6KRlYiDM3C20c= =Eq1y -----END PGP SIGNATURE----- --Sig_/41ia416QBHVWdpJfP/CDwD0--