From owner-cvs-src@FreeBSD.ORG Mon May 14 21:11:31 2007 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 159B416A402; Mon, 14 May 2007 21:11:31 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id ABB2B13C480; Mon, 14 May 2007 21:11:30 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 5188317382; Mon, 14 May 2007 21:11:29 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.1/8.14.1) with ESMTP id l4ELBXeS001156; Mon, 14 May 2007 21:11:33 GMT (envelope-from phk@critter.freebsd.dk) To: John Baldwin From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 14 May 2007 16:45:54 -0400." <200705141645.55584.jhb@freebsd.org> Date: Mon, 14 May 2007 21:11:33 +0000 Message-ID: <1155.1179177093@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: cvs-src@freebsd.org, Alexander Motin , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libnetgraph internal.h msg.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2007 21:11:31 -0000 In message <200705141645.55584.jhb@freebsd.org>, John Baldwin writes: >On Monday 14 May 2007 10:18:41 am Alexander Motin wrote: >> Log: >> Replace select() by poll() to avoid problems with big >> descriptor number. > >Why not kevent(2)? kevent(2) is most useful if you have many descriptors open (ie: apache). poll(2) works quite well for a low number of descriptors, and doesn't care what their numeric numbers are. select(2) is terrible unless you have a limited number of descriptors and they are all low numbered. This is because of the array representation. Given that poll(2) is a much simpler API than kqueue(2), I'd say it was the right choice here. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.