From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1d73e77a5b74942eb88cb5119949c536@hamnavoe.com> To: 9fans@9fans.net From: Richard Miller <9fans@hamnavoe.com> Date: Sun, 19 Aug 2012 14:37:01 +0100 In-Reply-To: <377d293c5366a0fb65398923b7a6ed38@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] tcp! Topicbox-Message-UUID: ac443be4-ead7-11e9-9d60-3106f5b1d025 > also i forgot to mention that this version of qread can > potentially cut the number of reads on tcp channels by up > to 1/2. one might as well completely satisfy the read, > if possible. This looks like a good idea for tcp. But there are other users of qread, with stricter assumptions. Aren't you in danger of breaking the contract of pipe(3) which uses qwrite/qread: Writes are atomic up to a certain size, typically 32768 bytes, that is, each write will be delivered in a single read by the recipient, provided the receiving buffer is large enough. To preserve the atomicity of qread/qwrite, maybe tcp should be coalescing the blocks itself by multiple calls to qread.