From: Matthew C. <mpc...@li...> - 2003-05-23 15:51:22
|
It's not as bad as all that. Each connection is encapsulated into a "nio.Channel" object. You can attempt to write the entire response as we do now write() doesn't block in non-blocking mode so that isn't a problem (though if the write failes to write the whole content in one go you would need to remember how far the write got). However if your worried about one client with a large bandwidth connection hogging all your cpu time this may be possible that's why I expect most NIO solution still employ multiple threads just not in the order of magnitude you need in a high load apache system (one per client) Matt. > > You mean if there isnt any data to send we just iterate through the > loop again and check in the next round whether there is data waiting? > This would work, however it seems it would be rather difficult to > understand such a code as it would need many lists to keep track of > active connections with their associations to running applications. We > would need to split every outgoing data (regular files and CGI data) > into small pieces which would need to be transferred individually in > order to prevent that blocking. > > Does anyone have comments to that? > > Alexander > > |