Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 1997 18:00:55 +0800
From:      Peter Wemm <peter@spinner.DIALix.COM>
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 
Message-ID:  <199705181000.SAA06698@spinner.DIALix.COM>
In-Reply-To: Your message of "Sun, 18 May 1997 13:29:06 %2B0400." <Pine.BSF.3.96.970518131753.1299A-100000@nagual.pp.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
=?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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705181000.SAA06698>