Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jun 2001 19:11:37 -0400
From:      Josh Osborne <stripes@mac.com>
To:        "E.B. Dreger" <eddy+public+spam@noc.everquick.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: question: aio / nbio / kqueue
Message-ID:  <200106222313.QAA09104@smtpout.mac.com>
In-Reply-To: <Pine.LNX.4.20.0106222258500.12615-100000@www.everquick.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200106222313.QAA09104>