You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Dong Liu <ed...@gmail.com> on 2007/05/23 19:11:43 UTC

What is the difference between so-called asynchronous I/O and non-blocking I/O

Hi,

I found some think they are the same. Do you know the difference?

Cheers,

Dong

-- 
Dong Liu
http://blogs.usask.ca/dong_notes/

Re: What is the difference between so-called asynchronous I/O and non-blocking I/O

Posted by peter royal <pr...@apache.org>.
On May 24, 2007, at 3:47 AM, John Preston wrote:
> I think the thing to note is not any difference between the two, but
> that adding this API will expose the native capabilities of the OS (if
> I'm correct).

Correct. It really lets the OS push up more of its "event driven" IO  
stack to the application layer.

And make no mistake, using MINA is future-proofing your app against  
the various IO API's due to appear.. Since MINA already presents an  
async-IO view to you, putting *real* async-IO under the hood would  
only be a boon with high-performance OS-level support.

-pete

-- 
proyal@apache.org - http://fotap.org/~osi




Re: What is the difference between so-called asynchronous I/O and non-blocking I/O

Posted by John Preston <by...@gmail.com>.
I think the thing to note is not any difference between the two, but
that adding this API will expose the native capabilities of the OS (if
I'm correct). If the OS has these, then it is possible that they might
be faster than how it is done now with NIO.

John Preston

On 5/24/07, Jeroen Brattinga <je...@gmail.com> wrote:
> AFAIK they are the same. Asynchronous and non-blocking are identical in
> this context. They both mean that you don't have to wait for a response
> to continue (as oposed to synchronous or blocking I/O). You need to work
> with event handlers to process the responses (as mentioned by Mladen).
>
> Check out http://en.wikipedia.org/wiki/Asynchronous_io if you want to
> know more.
>
>
> Jeroen Brattinga
>
> Dong Liu wrote:
> > Hi,
> >
> > I found some think they are the same. Do you know the difference?
> >
> > Cheers,
> >
> > Dong
> >
>

Re: What is the difference between so-called asynchronous I/O and non-blocking I/O

Posted by Jeroen Brattinga <je...@gmail.com>.
AFAIK they are the same. Asynchronous and non-blocking are identical in 
this context. They both mean that you don't have to wait for a response 
to continue (as oposed to synchronous or blocking I/O). You need to work 
with event handlers to process the responses (as mentioned by Mladen).

Check out http://en.wikipedia.org/wiki/Asynchronous_io if you want to 
know more.


Jeroen Brattinga

Dong Liu wrote:
> Hi,
>
> I found some think they are the same. Do you know the difference?
>
> Cheers,
>
> Dong
>

Re: What is the difference between so-called asynchronous I/O and non-blocking I/O

Posted by Dong Liu <ed...@gmail.com>.
So that means asynchronous I/O is what one can observe, and it can be
implemented or has already be implemented by NIO.

And I think NIO is also one of the approaches to implementing asynchronous
messaging or processing. I am not sure if I am right.
Please comment.

Cheers,

Dong

On 5/23/07, Mladen Turk <mt...@apache.org> wrote:
>
> Dong Liu wrote:
> > Hi,
> >
> > I found some think they are the same. Do you know the difference?
> >
>
> With nio you call select and act accordingly to the returned values,
> with async you register event handlers, and do that for multiple
> files/sockets. Its something MINA already does internally.
>
> Think I've been concise enough ;)
>
> Regards,
> Mladen.
>
>


-- 
Dong Liu
http://blogs.usask.ca/dong_notes/

Re: What is the difference between so-called asynchronous I/O and non-blocking I/O

Posted by Mladen Turk <mt...@apache.org>.
Dong Liu wrote:
> Hi,
> 
> I found some think they are the same. Do you know the difference?
> 

With nio you call select and act accordingly to the returned values,
with async you register event handlers, and do that for multiple
files/sockets. Its something MINA already does internally.

Think I've been concise enough ;)

Regards,
Mladen.