>> 2) NioSocketAcceptor acceptor = new NioSocketAcceptor(es, XXX);
>>
>> What must i write as the second parameter XXX ? (processor)

>You don't need to do that.

1) I thought that in order to use a thread pool with io services, i must use

NioSocketAcceptor acceptor = new
NioSocketAcceptor(Executors.newCachedThreadPool(), XXX);

so, i need XXX.
How can i use a thread pool with io services without that?

2) What is the correct thread pool creation parameters for
OrderedThreadPoolExecuter?
corePoolSize =Runtime.getRuntime().availableProcessors() + 1
maximumPoolSize =Runtime.getRuntime().availableProcessors() + 1

or should maximumPoolSize be higher than that?

Thanks,

--
Cem Uzunlar


2008/3/31, 이희승 (Trustin Lee) <[EMAIL PROTECTED]>:
> Hi Cem,
>
>  Answers inline...
>
>
>  On Mon, 2008-03-31 at 06:02 +0900, Cem Uzunlar wrote:
>  > Hi,
>  >
>  > 1) ExecutorService es = new OrderedThreadPoolExecutor();
>  >
>  > is this a correct thread pool for using as a global thread pool? (For
>  > IoServices and ExecutorFilters)
>
>
> Yes for ExecutorFilters.  For IoServices, I recommed
>  Executors.newCachedThreadPool().
>
>
>  > 2) NioSocketAcceptor acceptor = new NioSocketAcceptor(es, XXX);
>  >
>  > What must i write as the second parameter XXX ? (processor)
>
>
> You don't need to do that.
>
>
>  > 3) What is the best core and maximum thread count for the
>  > OrderedThreadPoolExecutor? (For a board game server application)
>  >
>  > 2 * Runtime.getRuntime().availableProcessors() + 1 for "IoServices +
>  > ExecuterFilters"
>  >
>  > is that ok?
>
>
> Yes for IoService.  For ExecutorFilter, you will have to experiment.
>  You can even try to drop ExecutorFilter from your filter chain depending
>  on what your application is going to do.
>
>  HTH,
>
>
>  --
>  Trustin Lee - Principal Software Engineer, JBoss, Red Hat
>
> --
>  what we call human nature is actually human habit
>  --
>  http://gleamynode.net/
>
>

Reply via email to