From dev-return-203839-archive-asf-public=cust-asf.ponee.io@tomcat.apache.org Wed Nov 27 15:59:46 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 7FC87180648 for ; Wed, 27 Nov 2019 16:59:46 +0100 (CET) Received: (qmail 7179 invoked by uid 500); 27 Nov 2019 15:59:45 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 7165 invoked by uid 99); 27 Nov 2019 15:59:45 -0000 Received: from Unknown (HELO mailrelay1-lw-us.apache.org) (10.10.3.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Nov 2019 15:59:45 +0000 Received: from mail-yw1-f47.google.com (mail-yw1-f47.google.com [209.85.161.47]) by mailrelay1-lw-us.apache.org (ASF Mail Server at mailrelay1-lw-us.apache.org) with ESMTPSA id 13DE04FB4 for ; Wed, 27 Nov 2019 15:59:45 +0000 (UTC) Received: by mail-yw1-f47.google.com with SMTP id d80so8527537ywa.6 for ; Wed, 27 Nov 2019 07:59:45 -0800 (PST) X-Gm-Message-State: APjAAAUm2G76IPe+8w4M2Dp3huCRROsjOvoJ/Gkk4Qos8yY3QvKQ+sQm PVwIwxRJb79SQw3scjAf8aT1A17KtV8+IMNdYas= X-Google-Smtp-Source: APXvYqxDGx6kk/iCmwzdKmvmfLBXLE0bzscdjh3LkH9PgrPrZrUfNqx4icsM9PzF4yO2t/hE9ZJOYM+iPeMc6C7z8OQ= X-Received: by 2002:a0d:d50d:: with SMTP id x13mr3589261ywd.431.1574870384764; Wed, 27 Nov 2019 07:59:44 -0800 (PST) MIME-Version: 1.0 References: <092f3a47-1027-ee96-2c48-09211efcf2cb@apache.org> <6c187238-9519-c91e-cf93-3c3a81557898@apache.org> In-Reply-To: <6c187238-9519-c91e-cf93-3c3a81557898@apache.org> From: =?UTF-8?Q?R=C3=A9my_Maucherat?= Date: Wed, 27 Nov 2019 16:59:33 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Drop SocketWrapperBase.write(Non)BlockingDirect methods To: Tomcat Developers List Content-Type: multipart/alternative; boundary="000000000000d9ee1205985615b7" --000000000000d9ee1205985615b7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 27, 2019 at 4:51 PM Mark Thomas wrote: > I've been looking at the 9.0.x changes. > > What is clearer now (I think the differences were always there - just > harder to see with the more complex code) is that there are some minor > differences in behaviour when all of the following are true: > - the source buffer is emptied when it is copied to the socket buffer > - the socket buffer is full after the source buffer has been copied > > In some cases there will be an immediate write to the network. In other > cases the network write will wait until the next write to the socket > buffer or the next explicit flush. > > I think I prefer an immediate write in this scenario. WDYT to updating > (very carefully) all of the write methods to behave that way? > Ah personally I did prefer not writing that full buffer (unless the source still has data, of course) on purpose since I considered not doing IO reduced the likelihood to block on IO (or write 0 for non blocking and having to use the poller). That's possible though if you like it better. R=C3=A9my --000000000000d9ee1205985615b7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Nov 27, 2019 at 4:51 PM Mark Thomas <markt@apache.org> wrote:
I've been looking at the 9.0.x changes= .

What is clearer now (I think the differences were always there - just
harder to see with the more complex code) is that there are some minor
differences in behaviour when all of the following are true:
- the source buffer is emptied when it is copied to the socket buffer
- the socket buffer is full after the source buffer has been copied

In some cases there will be an immediate write to the network. In other
cases the network write will wait until the next write to the socket
buffer or the next explicit flush.

I think I prefer an immediate write in this scenario. WDYT to updating
(very carefully) all of the write methods to behave that way?

Ah personally I did prefer not writing that full buf= fer (unless the source still has data, of course) on purpose since I consid= ered not doing IO reduced the likelihood to block on IO (or write 0 for non= blocking and having to use the poller). That's possible though if you = like it better.

R=C3=A9my

--000000000000d9ee1205985615b7--