From owner-freebsd-hackers Fri Jun 22 16:14:15 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtpout.mac.com (smtpout.mac.com [204.179.120.88]) by hub.freebsd.org (Postfix) with ESMTP id 94DB837B419 for ; Fri, 22 Jun 2001 16:14:08 -0700 (PDT) (envelope-from stripes@mac.com) Received: by smtpout.mac.com; Fri, 22 Jun 2001 16:13:35 -0700 (PDT) Message-Id: <200106222313.QAA09104@smtpout.mac.com> Received: from asmtp01.mac.com ([10.13.10.65]) by smtp-relay01.mac.com (Netscape Messaging Server 4.15) with ESMTP id GFCTUN00.0IG for ; Fri, 22 Jun 2001 16:13:35 -0700 Received: from localhost ([207.126.105.134]) by asmtp01.mac.com (Netscape Messaging Server 4.15 asmtp01 Jun 6 2001 13:16:42) with ESMTP id GFCTUM00.FIF; Fri, 22 Jun 2001 16:13:34 -0700 Date: Fri, 22 Jun 2001 19:11:37 -0400 From: Josh Osborne Content-Type: text/plain; format=flowed; charset=us-ascii Subject: Re: question: aio / nbio / kqueue Cc: freebsd-hackers@FreeBSD.ORG To: "E.B. Dreger" X-Mailer: Apple Mail (2.388) In-Reply-To: Mime-Version: 1.0 (Apple Message framework v388) Content-Transfer-Encoding: 7bit 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 On Friday, June 22, 2001, at 07:01 PM, E.B. Dreger wrote: > Quick question, hopefully not too basic for this list: > > AIO vs. non-blocking IO vs. kernel queues > > I'm familiar with (and *love*) kernel queues. Non-blocking IO is > straightforward. AIO seems simple enough. > > My question is, from a performance standpoint, in what situations are > these techniques most appropriate? AIO is good when you are not receiving much data (or not receiving it very frequently), and presumably want very low latency. Nonblocking I/O is good when you know you will almost never actually block (because you can skip the select/pool/kqueue call), it's not so bad if you combine it with a select/pool/kqueue if you can't use the socket right away, but will suck a lot if you busy wait. kqueue would (I assume) be good if you expect some not insignificant amount of blocking. And have more then one fd to do I/O on (if you only have one, blocking I/O is simpler to code up...) That's in theory, I can't quote any study that proves that. More vexing I can't say where the cross over in "frequency of blocking" says you should try the I/O operation before falling back to kqueue, vs. when you are better off doing the kqueue... -- Not speaking for my employer Barely speaking for myself To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message