Hi again,
>>All 100 sessions are sharing the same IoSession/ProtocolSession?
Yes, all client connections share same IoSession. Once i tried to connect to server over my IoProtocolConnector, i have obtained a session object (session = connector.connect(socket, connectTimeout, protocolProvider); ) And i use same session object for all client requests. Is there a way to duplicate session object, i cannot find a method like copy or duplicate in Session objects. Or do i have to connect server for each client request ( this sounds odd to me) to multiply session objects ? >>If you want to do parallel processing for a single session, you will want to create your own ThreadPoolFilter to achieve this. I have already use SimpleServiceRegistry and adds mina's default IoThreadPoolFilter to the chains of SocketIoAcceptor, what do you mean by writing own ThreadPoolFilter? I cannot see any specialized implementation of ThreadPoolFilter in examples. As i indicated my previous post, i want to see a dynamic and auto-scalable thread pool which increases/decreases its pool size according to traffic. However, i cannot achieve this. (i am also profiling my application).

peter royal wrote:

On May 1, 2006, at 9:57 AM, Serkan Demir wrote:

     int numOfThreads = 100;
       for (int i = 0; i < numOfThreads; i++) {
           thread[i] = new TrafficWorker(session);
           thread[i].setName("Thread#" + i);
       }


All 100 sessions are sharing the same IoSession/ProtocolSession? If so, this will be the cause of your problems. You won't get parallel processing, since by default, MINA does everything for a given session in serial. If you want to do parallel processing for a single session, you will want to create your own ThreadPoolFilter to achieve this.

Try using a new session in each thread of your tests, I think you'll get what you are looking for.
-pete


Reply via email to