dev@grizzly.java.net

Re: thread block #2 (continue)

From: Oleksiy Stashok <Oleksiy.Stashok_at_Sun.COM>
Date: Fri, 04 Dec 2009 11:28:13 +0100

Hi Rama,

so, it looks like the issue was with the default thread pool
configuration? If yes - I'll probably ask you to check why it happened
by adding some output. Will appreciate your help :))

> but, a small side effect imho is created using statsthreadpool..
>
> in the past i have open a few ticket asking that the threadpool
> neet to obey
> min/max threadN workers.
>
> for that reason 2 new threadpools was proposed (probably by gustav
> and later patched by others, i didn't remember well sorry)
>
> this 2 threadpools was fixedtp and defaulttp.
>
> By default, selectorthread what kind of threadpool use on the
> version that i have try? (1.9.18-x)
SyncThreadPool is used by default with SelectorThread. It's
predictable and accurate, but as Gustav mentioned (and thread-pool
name confirms this) it's synchronized.


> That's because i think that if i change the threadpool i'll lose the
> mighty stuff of having the ability to set max-min
> threadworker number (andall the threads will be spawned and stay
> there forever)
>
> am i in right?
Yes.
As Gustav mentioned, FixedThreadPool doesn't support min/max threads
and threads live forever in it, but it's asynchronous and fast. We
just have to make sure it might be used with HTTP module.

> Also, will be nice to know something about that :)
> What are the plans for the future (in the default GWS http config)?
GWS will be mostly preserved. For sure internal implementation might
change, but otherwise GWS, IMO, is very useful.

> Use a threadpool that obey to min/max, use the "old" fixed size
> threadpool?
If you don't need min/max and fine with fact, that all threads will be
kept alive during server lifecycle - you can use fixed thread pool.
The benefit depends on tasks thread pool executes, so fixed thread
pool will probably show much better numbers on fast tasks, but not
sure what will be the benefit for more complex tasks like HTTP request
processing.

> tnx and sorry for the delay of the mails
No problem, you're welcome.

WBR,
Alexey.

>
>
>
>> Hi Rama,
>>
>> ok, pls. remove all output related "ADD" code, but keep:
>>
>> ExtendedThreadPool threadPool = new StatsThreadPool("MyPool", 3, 5,
>> -1, 30l, TimeUnit.SECONDS);
>> gws.getSelectorThread().setThreadPool(threadPool);
>>
>> Probably the issue is in default thread pool configuration.
>>
>> Thank you.
>>
>> WBR,
>> Alexey.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>