Hi Frédéric, Sorry for getting back to you late. I was busy implementing JMX integration. I bet you will like it. I will also look forward to your feed back ;)
On Nov 23, 2007 5:10 PM, Frédéric Brégier <[EMAIL PROTECTED]> wrote: > Now in trunk, NioSocketConnector and NioSocketAcceptor > use SimpleIoProcessorPool when you specify no Executor or no Processor. > SimpleIoProcessorPool implies a newCachedThreadPool, in the past > it was a NewThreadExecutor. > That is what I point out in order to try to understand > (and explain to myself and perhaps to others) > why the setWorkerTimeout disapears from the trunk. > In the past, the NewThreadExecutor implies to take care of the threads > creation and deletion. Now with CachedPool, we don't have to. > Correct me of course if I am wrong... workerTimeout is not for a I/O processor thread but for a connector thread. Peter (Royal) had performance issue with fast connection attempt, and that was why he added workerTimeout property to prevent the connector thread from exiting and closing its selector, which slow down the number of connections made per second seriously. Now we have explicit dispose() method in IoConnector, so there's no overhead for closing and opening selector. And we are not using NewThreadExecutor but using a thread pool executor with 1 max pool size, so there's no need for workerTimeout anymore, either. > One remark on the same subject, on the first constructor of both > NioSocketConnector and NioSocketAcceptor. I take the Acceptor > as example since Connector is the same : > - public NioSocketAcceptor() > OK, except the comment says NewThreadExecutor but it is in fact a > SimpleIoProcessorPool so a CachedPool and 1 single thread. > Looking at the code : it uses Runtime.getRuntime().availableProcessors() > + 1 by default > thread in the CachedThreadPool and the same number of IoProcessor. > - public NioSocketAcceptor(int processorCount) > This one is clear at its does what it means (SimpleIoProcessorPool and > processorCount of IoProcessor). > - public NioSocketAcceptor(IoProcessor<NioSession> processor) > Same as previous except the processorCount is extract from processor and > creates an implicit SimpleIoProcessorPool. > - public NioSocketAcceptor(Executor executor, IoProcessor<NioSession> > processor) > Same as previous except the processorCount is extract from processor and > the executor is the one passed as argument. We need a lot of documentation work here. It is outdated right now but we will make it ready to go before we release RC. > Ok, sorry for so long mails and I fell like I can be a bit ennoying, > but as it seems something to me that can affect performance a bit... It was never annoying. Thank you again for your continuous feed back, and let me look forward to your another question. :) Cheers, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
