I’m reading about Channels in the JDK 7 docs (here), and stumbled upon this:
Multiplexed, non-blocking I/O, which is much more scalable than thread-oriented, blocking I/O, […]
Is there a simple explanation as to why this is so?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“Blocking” means that threads have to wait as long as necessary for a resource to become available…which means, by definition, threads will be sitting around waiting for resources. Non-blocking avoids this sort of thing.
Generally, non-blocking solutions are trickier, but they avoid resource contention, which makes it much easier to scale up. (That said, the point of
Channelis to make this less tricky.)