O'Reilly logo

Java I/O, NIO and NIO.2 by Jeff Friesen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter    13

Asynchronous I/O

NIO provides multiplexed I/O (a combination of nonblocking I/O, discussed in Chapter 7, and readiness selection, discussed in Chapter 8) to facilitate the creation of highly scalable servers. Client code registers a socket channel with a selector to be notified when the channel is ready to start I/O.

NIO.2 provides asynchronous I/O, which lets client code initiate an I/O operation and subsequently notifies the client when the operation is complete. Like multiplexed I/O, asynchronous I/O is also commonly used to facilitate the creation of highly scalable servers.

Note  Multiplexed I/O is often used with operating systems that offer highly scalable and performant polling interfaces—Linux and Solaris are examples. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required