From owner-freebsd-arch@FreeBSD.ORG Mon Jan 5 00:52:27 2015 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B54307B6; Mon, 5 Jan 2015 00:52:27 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id A03E4325E; Mon, 5 Jan 2015 00:52:27 +0000 (UTC) Received: from [10.0.1.106] (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 51003341F88A; Sun, 4 Jan 2015 16:52:27 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Libxo bugs and fixes. From: Alfred Perlstein X-Mailer: iPhone Mail (12B440) In-Reply-To: <201501050033.t050X9L5086220@idle.juniper.net> Date: Sun, 4 Jan 2015 16:52:26 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201501050033.t050X9L5086220@idle.juniper.net> To: Phil Shafer Cc: Marcel Moolenaar , John-Mark Gurney , Alfred Perlstein , "Simon J. Gerraty" , "arch@freebsd.org" , Poul-Henning Kamp , freebsd-arch , Konstantin Belousov X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jan 2015 00:52:27 -0000 > On Jan 4, 2015, at 4:33 PM, Phil Shafer wrote: >=20 > Alfred Perlstein writes: >> I think we REALLY want to have the fflush be a callback offered by libxo,= otherwise the=20 >> layering violations are pretty difficult to deal with. Consider if libxo= is outputting=20 >> to a non-stdio buffer, then what is the paradigm? Is it not better to gi= ve libxo a "flu >> sh" callback and have that exposed via the xop interface? >=20 > The problem is divining when to flush. If you are whiffling thru a list, > does the app want to flush after each list member, or when the complete > list is done. >=20 > Or maybe you are just looking at the case when pretty output > is made to the terminal? I am more thinking of the case where you pass a libxo handle down to a subsy= stem that shouldn't have to know if it is a studio object or not.=20 Consider the code sample you gave me, but instead of using the handleless ve= rsion xo_flush() you are writing a routine that takes a handle so instead yo= u would be calling xo_flush_h().=20 In the case of xo_flush_h() how does a subroutine know how to flush the back= ing object of the handle? -ap=20