httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [PATCH] less than 20 syscalls for a static request
Date Sat, 16 Aug 1997 01:54:01 GMT
I should annotate this... I was half asleep when I made this post (but fully
awake when I wrote/tested the patch).

On Thu, 14 Aug 1997, Dean Gaudet wrote:

> This doesn't work at all with scoreboard files.

... and the patch just does the old alarm() code for scoreboard files, so
it doesn't break them.

> So I said I could get it in under 20 syscalls.  The way to do that is
> to eliminate all the SIGUSR1 manipulations and replace them with a global
> usr1 state variable, leaving the handler active at all times.  I haven't
> done this yet because I'm not 100% sure that we've always required all of
> the code to expect an EINTR ... code which runs under timeouts certainly
> expects it.  But other code might not.

I am sorely tempted to use SA_RESTART for USR1 on those systems that support
it, and that will get us down to 19 syscalls without having to verify
the EINTR safety of all of the code.

For 2.0 I want EINTR safety to be part of the API ... but it will come
"for free" then because in order to support multiple threading models
we need to abstract all i/o into our own layer.

> Index: core/buff.c
> ===================================================================
> RCS file: /export/home/cvs/apachen/src/core/buff.c,v
> retrieving revision 1.43
> diff -u -r1.43 buff.c
> --- buff.c	1997/08/08 08:00:18	1.43
> +++ buff.c	1997/08/14 09:31:13
> @@ -474,7 +474,7 @@
>      fd_set fds;
>      struct timeval tv;
>  
> -    if (fb->incnt > 0) {
> +    if (fb->incnt > 0 || fb->outcnt == 0) {
>  	return;
>      }
>      /* test for a block */

I didn't mention this performance tweak to bhalfduplex().  If there's
nothing in the buffer, there's no need to test if it needs flushing.

Dean


Mime
View raw message