Created
March 3, 2020 10:06
Revisions
-
games647 created this gist
Mar 3, 2020 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ https://programming.vip/docs/java-non-blocking-io-and-asynchronous-io.html Differentiation into Blocking mode IO (Single thread) -> Often standard Asychrnous blocking IO -> many thready only waiting -> spawn a new thread for every blocking call Non-blocking IO -> single-thread can select over multiple connection and get notified on changes => Java Selector call -> worker can process changes => worker can be minimal only used for processing => less CPU overhead (thread creating + context switch between threads) => less memory overhead (holding cpu threads) => Java AsynchronousFileChannel / AsynchronousSocketChannel or similar => Linux: event system epoll used for networking - POSIX forbids it for files => Windows: networking + files