Sorry, but I am not sure to understood; currently, I have a server
application that instatiate an IOAcceptor, named "acceptor". The code
is below:

public static void main(String[] args) throws IOException {

        SSMServerIoHandler handler = new SSMServerIoHandler();
        handler.openConsole("- SSMServerIOHandler -");
        NioSocketAcceptor acceptor = new NioSocketAcceptor();
        acceptor.getFilterChain().addLast("protocol", new
ProtocolCodecFilter(new SSMCodecFactory(false,null)));
        acceptor.setDefaultLocalAddress(new InetSocketAddress(PORT));
        acceptor.setHandler(handler);
        acceptor.bind();
//        System.out.println("event> SSM server is listenig at port " + PORT);
        handler.scope.printOnConsole("event> SSM server is listenig at
port " + PORT);

                
        }

I am running the application on a virtual machine with one core; for
this reason when I create 10 client there is only two thread executed
in concurrent way. If we evaluate the  548 core, this core are
distributed on, about, 18 machine. The previously code is still right?
How I must be conceived the session concept in this case?

Thank you so much,
Best regards,

2013/3/27 elecharny-2 [via Apache MINA] <[email protected]>:
> Le 27 mars 2013 12:33, "IronMan" <[hidden email]> a écrit :
>
>>
>> Dear Emmanuel,
>>
>> Thank you so much for the answer;
>> I have understood that Apache MINA is inherently multi-thread.
>> Basically, it start (numbers of processor +1) thread.
>> I have verified it with my application; however I am developing a
>> storage service able to manage a large number of connections. I am
>> thinking that this service will be deployed on a Grid of Processor. In
>> my university there is a parallel computation system with about 548
>> core.My question is Apache MINA is able to use all the 548 core? If
>> yes, how?
>
> as you mentionned, mina starts nbProcs +1 ioProcessors, and as many
> threads. They are associated with the sessions, so it should scale nicely.
> This is automatic.
>
>>
>> Thank you so much,
>>
>> best regards
>>
>> 2013/3/6 Emmanuel Lécharny [via Apache MINA]
>> <[hidden email]>:
>> > Le 3/6/13 6:16 PM, IronMan a écrit :
>> >> Hi,
>> >> I want to develop a multithreading Client/Server Application using
> Apache
>
>> >> MINA.
>> >> I have find many examples for the single-thread case, but nothing for
>> >> multithread. There is documentation for the multithread case?
>> >
>> > MINA allows you to design a multi-threaded server natively. In fact, it
>> > *is* multi-threaded.
>> >
>> > There is nothing special you have to do to deal with multi-threaded
>> > aspects, except to be sure that you have a thread-safe application.
>> >
>> > Let me explain how it works :
>> >
>> > 1) A client connects to the server : a thread is picked to process the
>> > request. This thread will always be used for every request sent by this
>> > client (unless you start playing with an executor in the middle of your
>> > code)
>> > 2) Once the server has received the request, and ha sprocessed it, it
>> > can send back a rrsponse : this is done on the same thread
>> > 3) And that's it.
>> >
>> > If you have a second client, it will use another thread.
>> >
>> > Ok, now, at some point, it's not anymore a One client/One thread
>> > association. We have a limited number of threads available (default to
>> > Nb processor +1), so when we reach the max number of thread, we reuse
>> > the first thread (this is a round robin mechanism).
>> >
>> > So many clients can use the same thread. Still, this is safe as one
>> > client won't be able to user the thread that is already used by another
>> > client : it will be queued waiting for the previous client to be done.
>> >
>> > That's the way it works. Its an overly simplified explaination though.
>> > You just have to give it a try, you'll see it works pretty well.
>> >
>> > --
>> > Regards,
>> > Cordialement,
>> > Emmanuel Lécharny
>> > www.iktek.com
>> >
>> >
>> >
>> > ________________________________
>> > If you reply to this email, your message will be added to the discussion
>> > below:
>> >
> http://apache-mina.10907.n7.nabble.com/Multithreading-Client-Server-Application-tp36962p36963.html
>> > To unsubscribe from Multithreading Client/Server Application, click
> here.
>
>> > NAML
>>
>>
>>
>> --
>> **********************************************************************
>> Maurizio Colizza
>> Research Engineer
>> Università degli Studi dell'Aquila-Centro di eccellenza DEWS
>> Cel. 3339973021
>> Skype : maurizio.colizza
>> **********************************************************************
>>
>>
>>
>>
>> --
>> View this message in context:
> http://apache-mina.10907.n7.nabble.com/Multithreading-Client-Server-Application-tp36962p37196.html
>> Sent from the Apache MINA Developer Forum mailing list archive at
> Nabble.com.
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-mina.10907.n7.nabble.com/Multithreading-Client-Server-Application-tp36962p37197.html
> To unsubscribe from Multithreading Client/Server Application, click here.
> NAML



-- 
**********************************************************************
Maurizio Colizza
Research Engineer
Università degli Studi dell'Aquila-Centro di eccellenza DEWS
Cel. 3339973021
Skype : maurizio.colizza
**********************************************************************




--
View this message in context: 
http://apache-mina.10907.n7.nabble.com/Multithreading-Client-Server-Application-tp36962p37198.html
Sent from the Apache MINA Developer Forum mailing list archive at Nabble.com.

Reply via email to