From owner-cvs-lib Sun May 18 03:03:23 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id DAA22914 for cvs-lib-outgoing; Sun, 18 May 1997 03:03:23 -0700 (PDT) Received: from spinner.DIALix.COM (spinner.dialix.com [192.203.228.67]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id DAA22904; Sun, 18 May 1997 03:02:53 -0700 (PDT) Received: from spinner.DIALix.COM (localhost.dialix.com.au [127.0.0.1]) by spinner.DIALix.COM with ESMTP id SAA06698; Sun, 18 May 1997 18:00:57 +0800 (WST) Message-Id: <199705181000.SAA06698@spinner.DIALix.COM> X-Mailer: exmh version 2.0gamma 1/27/96 To: =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= cc: Bruce Evans , 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." Date: Sun, 18 May 1997 18:00:55 +0800 From: Peter Wemm Sender: owner-cvs-lib@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 > > http://www.nagual.pp.ru/~ache/ Cheers, -Peter