From owner-freebsd-hackers Sun May 19 5:24:43 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from web21108.mail.yahoo.com (web21108.mail.yahoo.com [216.136.227.110]) by hub.freebsd.org (Postfix) with SMTP id 9DCAD37B412 for ; Sun, 19 May 2002 05:24:37 -0700 (PDT) Message-ID: <20020519122437.3254.qmail@web21108.mail.yahoo.com> Received: from [62.254.0.5] by web21108.mail.yahoo.com via HTTP; Sun, 19 May 2002 05:24:36 PDT Date: Sun, 19 May 2002 05:24:36 -0700 (PDT) From: Hiten Pandya Reply-To: hiten@uk.FreeBSD.org Subject: Re: tuning a CPU bound server To: Peter Wemm Cc: Doug White , Omar Thameen , freebsd-hackers@FreeBSD.ORG In-Reply-To: <20020519051546.A1FC539F9@overcee.wemm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --- Peter Wemm wrote: > > -- Hiten Pandya wrote: > > Just wondering, are these the kind of problems which can be solved by > > using the kqueue(2) mechanism, or am I talking nuts again? > > > > Regards. > > Yes, kqueue solves it nicely. I overestimated the work required. In > fact, it looks like it would be quite easy to do. There are three places > that need work. > src/util/events.c (the main event loop, keeps a persistent select mast) > src/util/readable.c (quick select-until-readable) > src/util/writable.c (quick select-until-writable) > > events.c is practically begging to be converted to kqueue as it has > explicit init/register/unregister/loop type operation that allows callers > to register/unregister callbacks for given fd's when they become readable > or writable. This is the exact scenario that kqueue is ideal for. > > The other two are not heavily used and could quickly whip up their own mini > kqueue for the task. Sounds like a good task for someone with time in their hands. ;) As an example: http://www.monkeys.com/freeware/kqueue-echo.c, someone might find that useful. Regards. -- Hiten Pandya -- , __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message