Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "John B. Matthews" Newsgroups: comp.lang.java.programmer Subject: Re: NIO multiplexing + thread pooling Date: Sun, 25 Sep 2011 00:26:21 -0400 Organization: The Wasteland Lines: 31 Message-ID: References: NNTP-Posting-Host: LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8279 In article , Giovanni Azua wrote: > I need to build a Client-Middleware-Database architecture in the > context of a course in my grad studies. In a nutshell, multiple > Client component instances connect and send random DML statements to > multiple Middleware (server) which in turn execute those DML against > a Database server and send the results back to the Clients. After > carefully studding the description and requirements I have two > choices for the communication between the Client and Middleware: > > - Classic sockets + thread pool. > - NIO multiplexing. > > I think I will end implementing both but I am curious in the case of > the NIO multiplexing: in your experience would it increase > performance to setup a Thread Pool and associate one SelectionKey to > one specific Thread in the pool so that all read/write operations for > each specific channel go through one specific Thread from the Pool? > From all code examples/tutorials/books I have reviewed online the > "Selector Thread" seems like a bottleneck to me. I haven't seen this > approach anywhere so that's why I am asking. This related thread may be helpful: -- John B. Matthews trashgod at gmail dot com