On Thu, Jun 13, 2024 at 08:35:37AM +0200, Ruediger Pluem wrote:
> 
> 
> On 6/11/24 6:05 PM, jor...@apache.org wrote:
> > Author: jorton
> > Date: Tue Jun 11 16:05:22 2024
> > New Revision: 1918258
> > 
> > URL: http://svn.apache.org/viewvc?rev=1918258&view=rev
> > Log:
> > * file_io/unix/pipe.c (file_pipe_create): Use pipe2(,O_NONBLOCK) by
> >   default unless APR_FULL_BLOCK was used; unconditionally set the
> >   blocking state later. Saves two syscalls per invocation for both
> >   APR_READ_BLOCK and APR_WRITE_BLOCK, no [intended] functional change.
> 
> I guess it is me being blind , but how do we save two syscalls for the
> APR_READ_BLOCK and APR_WRITE_BLOCK case each? With the code before the patch
> we started with a blocking pipe and needed to set one end of the pipe to non 
> blocking.
> Now we start with a non blocking pipe and need to set the other end to 
> blocking.
> Where did I get lost and miss the point?

No, you got it correct, I obviously got confused counting syscalls at 
some point there, sorry! APR_FULL_BLOCK is the only case where using 
pipe2() saves syscalls, and for every other case it costs three syscalls 
regardless of whether pipe() or pipe2() is used. So r1918258 is a noop. 
I'll revert this, thanks for the review.

Regards, Joe

Reply via email to