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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message