From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Making custom binary input ports unbuffered Date: Wed, 15 Jan 2014 19:15:46 -0500 Message-ID: <87a9ewsrwt.fsf@netris.org> References: <878uuiyxsb.fsf@gnu.org> <87k3e1vlzq.fsf@netris.org> <8761pkvoxh.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389831501 26128 80.91.229.3 (16 Jan 2014 00:18:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jan 2014 00:18:21 +0000 (UTC) Cc: Andy Wingo , guile-devel To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 16 01:18:25 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 1W3afB-0005ff-D2 for guile-devel@m.gmane.org; Thu, 16 Jan 2014 01:18:25 +0100 Original-Received: from localhost ([::1]:57806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3afA-0007N2-Vr for guile-devel@m.gmane.org; Wed, 15 Jan 2014 19:18:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3af1-0007Mx-Uc for guile-devel@gnu.org; Wed, 15 Jan 2014 19:18:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3aew-0007IU-Kj for guile-devel@gnu.org; Wed, 15 Jan 2014 19:18:15 -0500 Original-Received: from world.peace.net ([96.39.62.75]:50933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3aew-0007Ho-Hg; Wed, 15 Jan 2014 19:18:10 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W3aep-0005va-Lp; Wed, 15 Jan 2014 19:18:03 -0500 In-Reply-To: <8761pkvoxh.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 15 Jan 2014 23:51:54 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 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:16806 Archived-At: ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mark H Weaver skribis: > >> While I agree that CBIPs should be unbuffered by default, I think it's >> important to have a way to enable buffering, even if it's not portable. > > So I started with the patch below, which allows us to specify which > ports (really: which port types) support =E2=80=98setvbuf=E2=80=99. This= is > conservative so that ports that do not explicitly claim to support it > won=E2=80=99t break. > > Then I started modifying the CBIP. The problem is that the CBIP has a > bytevector stored in its SCM_STREAM, whose contents are normally stored > in =E2=80=98read_buf=E2=80=99. So it needs to know if a new buffer is in= stalled. > > Perhaps that, rather than a =E2=80=98supports_setvbuf=E2=80=99 bit, we ne= ed a pointer to > the port=E2=80=99s =E2=80=98setvbuf=E2=80=99 method? For file ports it w= ould be > =E2=80=98scm_fport_buffer_add=E2=80=99, for instance. Yes, it sounds like we'll need custom 'setvbuf' methods. In master, maybe we can move it to scm_t_ptob_descriptor. Thanks, Mark