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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access