Created
March 3, 2020 10:06
-
-
Save games647/de40f74e06a7fd67ff2208257a0ebc02 to your computer and use it in GitHub Desktop.
Advanced Networking processing
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 characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment