On 6/23/06, Trustin Lee <[EMAIL PROTECTED]> wrote:
On 6/23/06, Vinod Panicker <[EMAIL PROTECTED]> wrote:
>
> On 6/23/06, Trustin Lee <[EMAIL PROTECTED]> wrote:
> > On 6/21/06, Vinod Panicker <[EMAIL PROTECTED]> wrote:
> > >
> > > On 6/21/06, Trustin Lee <[EMAIL PROTECTED]> wrote:
> > > > On 6/21/06, Vinod Panicker <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > Even after upgrading to mina 0.9.4, I'm still seeing
> ever-increasing
> > > > > threads for the AnonymousIoService.
> > > >
> > > >
> > > > Do you create a new PooledThreadModel instance whenever you
> bind? You
> > > will
> > > > have to reuse it.
> > >
> > > No we don't. This is what we are doing to bind the acceptor -
> > >
> > > acceptor.bind( inetSocketAddress, argIoHandler );
> > >
> > > And in the connector we are calling connect() directly.
> >
> >
> > Then do you create an instance of IoConnector or IoAcceptor every time
> you
> > connect or bind? If so, it can create so many threads. Because a new
> > PooledThreadModel instance is created every time you create an
> IoService.
> > We need a workaround for this issue.
>
> Acceptors are created just once, of course. But for connectors, there
> have to be multiple instances since we need to connect to different
> endpoints each time.
>
> Do you mean to say that a new Thread pool is created every time we
> create an instance of a connector? What would be a workaround to
> this?
To work around this issue, you need to create a new PooledThreadModel which
is shared among connectors and set their default thread model to it. But
this will look awkard and not very transparent to the implementation. We
need to revise this part. Please let me know if you have any suggestion.
Oh ok. Will look into getting this done.
Regarding the API, it would seem that we need a parent for the
connectors. A connector factory, if you must. Connector instances
will be provided by the factory/parent, which will also be creating
the thread pool. One thread pool should be enough for the connectors
- but we can make that configurable in the future.
BTW the thread name 'anonymoudioservice-91-106' means that there can be 91
thread pools in the JVM.
Didn't quite get this. You mean to say that there are 91 thread pool
instances currently running in the JVM?
Regards,
Vinod.