I'm interested in the "multiplexing NIO" chapter - how advanced it is, what topics it covers, etc.
That chapeter is available online:
http://www.oreilly.com/catalog/javanio/Here is a quote that is relevent to our other long thread but I'm not gonna make another post just for it. From page 144 of the
Java NIO book:
For the first scenario, in which you want to bring more threads into play to service channels,resist the urge to use multiple selectors.Performing readiness selection on large numbers of channels is not expensive;most of the work is done by the underlying operating system. Maintaining multiple selectors and randomly assigning channels to one of them is not a satisfactory solution to this problem.It simply makes smaller versions of the same scenario.
A better approach is to use one selector for all selectable channels and delegate the servicing of ready channels to other threads.You have a single point to monitor channel readiness and a decoupled pool of worker threads to handle the incoming data. The thread pool size can be tuned (or tune itself,dynamically)according to deployment conditions. Management of selectable channels remains simple,and simple is good.