Non-blocking IO
- Reference: https://stackoverflow.com/questions/25099640/non-blocking-io-vs-async-io-and-implementation-in-java
- OS provides two ways of I/O:
- Blocking I/O
- Non-blocking I/O
Implementing sync and async IO
- Synchronous I/O:
- Use Blocking I/O
- Asynchronous I/O:
- Use Blocking I/O:
- must use multi-threading
- Use Non-blocking I/O:
- single threaded
- multi-threaded
- Use Blocking I/O:
Java NIO
- stands for New Input/Output
- original
java.ioblocks IO java.nioallows for non-blocking communicationNettyis built on top of Java NIO client server framework