Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "Multiplexed, non-blocking I/O, [..] much more scalable than thread-oriented, blocking I/O"?

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?

like image 936
Mads Nielsen Avatar asked Jan 29 '12 22:01

Mads Nielsen


1 Answers

Because a thread stack is usually much larger than the data structure needed to support an async I/O connection. Also, scheduling thousands of threads is inefficient.

like image 125
Ben Voigt Avatar answered Oct 24 '22 07:10

Ben Voigt