Re: Multithreading Client/Server Application
Dear Emmanuel, Thank you so much for the answer. I hop that the presentation it went smooth. I am sorry for the delay of my answer but I am was under pressure for a paper that regards Apache MINA. Now,I am working with Apache MINA for my PhD. and I hope to use it also after. For this reason I hope to have the needed features. Can you give me a list of the topics of the current design or how can I go ahead? Thank you so much, Best Regards, P. S. If my paper will be accepted I send you a copy in order to have your opinion on the work and on possible interests from the community. Best Regards, Maurizio 2013/3/27 Emmanuel Lécharny [via Apache MINA] : > Le 3/27/13 3:29 PM, IronMan a écrit : >> Thank you so much; >> >> Apache MINA organizes conferences where is possible to submit >> scientific pubblications? Or there are analogous opportunities for >> publications? > > We don't organize any conference, but we do participate occasionaly on > conferences. For instance, I'm doing a presentation this friday at > Devoxx.fr. Now, nobody forbids you to propose a talk to any conference, > we don't hav a monopole ! > >> Is possible to entry in the development community of Apache MINA? > Sure ! It's a community based work, and we accept any participation. We > currently are working on MINA 3, the next iteration. All the discussions > occur on the development mailing list, you are very welcome to participate. > > Being elected committer is a matter of participating to the existing > effort. It's not that hard, but we expect to get some patches or > contribution for that : the idea is to get contributors that will remain > in the long term... > > Many thanks for your interest ! > > > -- > 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-tp36962p37204.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-tp36962p37258.html Sent from the Apache MINA Developer Forum mailing list archive at Nabble.com.
Re: Multithreading Client/Server Application
Le 3/27/13 3:29 PM, IronMan a écrit : > Thank you so much; > > Apache MINA organizes conferences where is possible to submit > scientific pubblications? Or there are analogous opportunities for > publications? We don't organize any conference, but we do participate occasionaly on conferences. For instance, I'm doing a presentation this friday at Devoxx.fr. Now, nobody forbids you to propose a talk to any conference, we don't hav a monopole ! > Is possible to entry in the development community of Apache MINA? Sure ! It's a community based work, and we accept any participation. We currently are working on MINA 3, the next iteration. All the discussions occur on the development mailing list, you are very welcome to participate. Being elected committer is a matter of participating to the existing effort. It's not that hard, but we expect to get some patches or contribution for that : the idea is to get contributors that will remain in the long term... Many thanks for your interest ! -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
Re: Multithreading Client/Server Application
Thank you so much; Apache MINA organizes conferences where is possible to submit scientific pubblications? Or there are analogous opportunities for publications? Is possible to entry in the development community of Apache MINA? Thank you for your work, Best regards 2013/3/27 Emmanuel Lécharny [via Apache MINA] : > Le 3/27/13 12:54 PM, IronMan a écrit : > >> 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? > > I have no idea how the JVM can spread the threads on core on other > machines... AFAICT, except if you are using a very specific JVM, the > threads used are local to your machine (ie, in your case, 548/18 cores > will be used) > > So base line, you won't be able to exploit the 548 cores on your 18 > machines. > > > -- > 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-tp36962p37199.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-tp36962p37202.html Sent from the Apache MINA Developer Forum mailing list archive at Nabble.com.
Re: Multithreading Client/Server Application
Le 3/27/13 12:54 PM, IronMan a écrit : > 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? I have no idea how the JVM can spread the threads on core on other machines... AFAICT, except if you are using a very specific JVM, the threads used are local to your machine (ie, in your case, 548/18 cores will be used) So base line, you won't be able to exploit the 548 cores on your 18 machines. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
Re: Multithreading Client/Server Application
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] : > 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.10
Re: Multithreading Client/Server Application
Le 27 mars 2013 12:33, "IronMan" 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] > : > > 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.
Re: Multithreading Client/Server Application
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? Thank you so much, best regards 2013/3/6 Emmanuel Lécharny [via Apache MINA] : > 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.
Re: Multithreading Client/Server Application
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