One-stop learning Java network programming comprehensive understanding of BIO_NIO_AIO, learning notes (9)

Hi everybody, I'm方圆


1. Applicable scenarios of the three models

  1. BIO: Suitable for a small number of connections, and the server resources are sufficient for the connections we know, and the development is simple
  2. NIO: Compared with BIO, development is more difficult, but the number of customer connections is relatively high. It is worth noting that because NIO is a single thread polling to process data, it is necessary to avoid too long each task execution time and prevent other threads from waiting too long
  3. AIO: The number of connections accepted is large. Compared with NIO, it is asynchronous. It can accept a task that takes too long, but the development is more difficult and the maintenance is not easy.
  • Attachment: You can use VisualVM under the JDK folder to monitor the usage of the program
    Insert picture description here

end

Guess you like

Origin blog.csdn.net/qq_46225886/article/details/107579178