On Thursday 17 January 2008 04:52:38 Trustin Lee wrote:
> On Jan 17, 2008 2:58 AM, Luc Willems <[EMAIL PROTECTED]> wrote:
> > the connecting thread will block "forever" when i replace the
> > cf.awaitUninterruptibly() with cf.await() :-(
ok , another day of testing i found some "possible" reasons :
> Doesn't cf.awaitUninterruptibly() with no parameter also block forever?
yes.
<< My SocketConnector code >>>
connector = new NioSocketConnector();
int coresize=10;
Executor pool=Executors.newFixedThreadPool(coresize,new
WVIoThreadFactory(iofactorycount.incrementAndGet()));
final ExecutorFilter executor = new ExecutorFilter(pool);
connector.getFilterChain().addLast("http",new ProtocolCodecFilter(new
HttpCodecFactory()));
connector.getFilterChain().addLast("threadPool", executor);
<----------- problem
connector.getFilterChain().addLast("wv", new WVPlainTextFilter());
the problem seems to be a combination of my current thread model (the
"threadpool" filter ) and the fact
that allot of connections are begin created & closed in a short time.
when i replace this pool with a Executors.newCachedThreadPool() the problem is
solved BUT , a new problem arises.
because of the unbounded nature of this pool, i get Out of Memory Exceptions .
at certain time 2000 Threads where created to handle Io Events :-(
still thinking on how to resolve this. the load tools is by nature a tool with
allot of connections ( > 10000).
when those connections are closed in a short time i have a problem handling all
IO events.
i've seen in de API doc dat ExecutorFilter can "filter" the kind of IoEvent
that needs to be executed in the pool.
would it be a solution to run the connect/close related events NOT in the
thread pool and only the message read/write ?
luc