Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 3058 invoked from network); 23 Feb 2004 19:39:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Feb 2004 19:39:19 -0000 Received: (qmail 48314 invoked by uid 500); 23 Feb 2004 19:39:08 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 48281 invoked by uid 500); 23 Feb 2004 19:39:08 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 48266 invoked from network); 23 Feb 2004 19:39:07 -0000 X-Authentication-Warning: suntzu.lyra.org: gstein set sender to gstein@lyra.org using -f Date: Mon, 23 Feb 2004 11:43:01 -0800 From: Greg Stein To: Scott Lamb Cc: dev@apr.apache.org Subject: Re: Compile-time vs. run-time checks Message-ID: <20040223114301.B14031@lyra.org> Mail-Followup-To: Scott Lamb , dev@apr.apache.org References: <29963BD9-6637-11D8-861D-000A95891440@slamb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <29963BD9-6637-11D8-861D-000A95891440@slamb.org>; from slamb@slamb.org on Mon, Feb 23, 2004 at 01:33:31PM -0600 X-URL: http://www.lyra.org/greg/ X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Mon, Feb 23, 2004 at 01:33:31PM -0600, Scott Lamb wrote: > I'm putting together a patch to use SO_(RCV|SND)TIMEO for > apr_socket_timeout where available; I expect I'll find it has better > performance on some platforms, as it would no longer require using > non-blocking IO and preceding every read() and write() with a select(). > (I intend to try benchmarking Apache on Darwin, where the system call > overhead seems to be quite high.) > > On some older versions of platforms (Linux 2.2), these #defines exist > but do not work - it's not possible to set them. Can I assume that if > APR is built with a kernel in which it does work (Linux 2.4), it will > be run with one as well? Or should I include a runtime check for this > option? Icky. I don't think it is really possible to make that assumption. Thankfully, I also believe this is reasonably solved with a global variable (i.e. race conditions around coming up with the same flag don't apply :-), and the value certainly won't change over the process' lifetime). I would recommend a dynamic solution for now. We may be able to make that compile-time for certain platforms, where we know "all" versions handle the flag properly [when present]. Cheers, -g -- Greg Stein, http://www.lyra.org/