You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2006/07/03 10:31:35 UTC

Fixing PooledThreadModel (Was: Re: AnonymousIoService thread)

For now, there's a strong 1-to-1 relationship between PooledThreadModel and
thus it causes excessive creation of thread pools.  I think at least the
PooledThreadModel instances with the same service name should share the same
ThreadPoolFilter insstance. What do you think?

If you agree with me, there are two choices:

* Provide a static factory method for PooledThreadModel instead of
constructors.
* Retain the constructors, but share the filters using a static map.

Thanks in advance for your feedback!

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: Fixing PooledThreadModel (Was: Re: AnonymousIoService thread)

Posted by Niklas Therning <ni...@trillian.se>.
peter royal wrote:
> On Jul 3, 2006, at 4:31 AM, Trustin Lee wrote:
>> For now, there's a strong 1-to-1 relationship between
>> PooledThreadModel and
>> thus it causes excessive creation of thread pools.  I think at least the
>> PooledThreadModel instances with the same service name should share
>> the same
>> ThreadPoolFilter insstance. What do you think?
>>
>> If you agree with me, there are two choices:
>>
>> * Provide a static factory method for PooledThreadModel instead of
>> constructors.
>> * Retain the constructors, but share the filters using a static map.
>
> Static factory method.
>
> -pete
>
> --proyal@apache.org - http://fotap.org/~osi
>
>
>
Is there a JIRA issue for this? Brad Harvey created an issue
(https://issues.apache.org/jira/browse/DIRMINA-231) lately which I think
is related to this. If a user uses a new connector for each connect() a
new thread pool will be created for each connection. I recommended him
to reuse a single connector which of course solves the problem. But if
there's anything we could do to prevent users from running into this
problem in the first place we should do it.

-- 
Niklas Therning
www.spamdrain.net


Re: Fixing PooledThreadModel (Was: Re: AnonymousIoService thread)

Posted by peter royal <pr...@apache.org>.
On Jul 3, 2006, at 4:31 AM, Trustin Lee wrote:
> For now, there's a strong 1-to-1 relationship between  
> PooledThreadModel and
> thus it causes excessive creation of thread pools.  I think at  
> least the
> PooledThreadModel instances with the same service name should share  
> the same
> ThreadPoolFilter insstance. What do you think?
>
> If you agree with me, there are two choices:
>
> * Provide a static factory method for PooledThreadModel instead of
> constructors.
> * Retain the constructors, but share the filters using a static map.

Static factory method.

-pete

-- 
proyal@apache.org - http://fotap.org/~osi