httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject More on FreeBSD timeout problem
Date Sun, 18 May 1997 15:30:34 GMT

------- Forwarded Message

To: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= <ache@nagual.pp.ru>
cc: Bruce Evans <bde@zeta.org.au>, cvs-all@FreeBSD.ORG,
        cvs-committers@FreeBSD.ORG, cvs-lib@FreeBSD.ORG, peter@FreeBSD.ORG
Subject: Re: cvs commit: src/lib/libc/gen sleep.c 
In-reply-to: Your message of "Sun, 18 May 1997 13:29:06 +0400."
             <Pine.BSF.3.96.970518131753.1299A-100000@nagual.pp.ru> 
Date: Sun, 18 May 1997 18:00:55 +0800
From: Peter Wemm <peter@spinner.DIALix.COM>
Sender: owner-cvs-all@FreeBSD.ORG
X-Loop: FreeBSD.org
Precedence: bulk

=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= wrote:
> On Sun, 18 May 1997, Bruce Evans wrote:
> 
> > >Hmm.  Perhaps install a temporary dummy SIGALRM handler in the sleep.c stu
    b
> > >so that it doesn't die if there isn't one.  The old setitimer way doesn't
> > >mess with alarm(2), using nanosleep() wont change that.
> > 
> > Why would a program generate alarms without installing an alarm handler?
> 
> They assume sleep() install one for them. It is commonly used way to
> terminate sleep() in a child since not all sleep implementations
> terminates by other signals. 

BTW, I think apache is being silly using a sleep() in wait_or_timeout.  
The 1-second sleep in there was causing an artificially raised load 
average on our old SVR4 systems.  Changing the sleep(1) to poll(0,0,1000)
made it use *much* less cpu time and generally work better on SVR4.  But 
this is essentially the same change as we originally made to sleep() to 
make it use nanosleep which caused all the problems.  Quite why this 
sort of change works so well on SVR4 and so badly on BSD I don't know.

IMHO, apache should use either select() or poll() (since it uses select() 
already it shouldn't matter) to do it's sleeps rather than mess with 
signals and sigalarms etc.  Apache already uses select() for timeouts 
elsewhere, it should finish the job. :-)

> -- 
> Andrey A. Chernov
> <ache@null.net>
> http://www.nagual.pp.ru/~ache/

Cheers,
- -Peter


------- End of Forwarded Message




Mime
View raw message