• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does Java have asynchronized I/O?

 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,


I am wondering whether Java has asynchronized I/O (whether built-in core Java SDK or 3rd party release), which is similar as select or poll in UNIX. Current read/write will be blocked when underlying stream is not ready. For example, when retrieving data from remote machine, we will be blocked if the remote machine will not response immediately.


Thanks in advance,
George
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it does, in the java.nio package. This was added in JDK 1.4. Here's an article that gives you an idea of what you can do.
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For your Googling pleasure, Java refers to this as "non-blocking I/O." Both Sun and IBM's tutorials are very good -- just the right balance of terseness and depth (for me anyway).
 
Udegbunam Morah
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be you can start from this link:
http://www.google.com/search?hl=en&q=Non-blocking+IO+in+Java
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to IO...
 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ernest,


Originally posted by Ernest Friedman-Hill:
Yes it does, in the java.nio package. This was added in JDK 1.4. Here's an article that gives you an idea of what you can do.


Your reply is very helpful. I am using JDK 1.3, and do you know some solutions for JDK 1.3?


regards,
George
 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ilja,


Originally posted by Ilja Preuss:
Moving to IO...


I think this sub-forum is more suitable for my topic. Thanks again! :-)


regards,
George
 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Udegbunam,


Originally posted by Udegbunam Morah:
May be you can start from this link:
http://www.google.com/search?hl=en&q=Non-blocking+IO+in+Java


Your suggestion is very helpful! I have found that if I want to use Non-blocking IO in JDK 1.3, I have to use a native wrapper (or have some dependencies on native libraries). Are there any pure Java Non-blocking IO libraries for JDK 1.3?


regards,
George
 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David,


Originally posted by David Harkness:
For your Googling pleasure, Java refers to this as "non-blocking I/O." Both Sun and IBM's tutorials are very good -- just the right balance of terseness and depth (for me anyway).


Your reply is very helpful! I have found that if I want to use Non-blocking IO in JDK 1.3, I have to use a native wrapper (or have some dependencies on native libraries). Are there any pure Java Non-blocking IO libraries for JDK 1.3?


regards,
George
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!