The Qpid project developed just such a multi threaded SocketIOProcessor,
https://issues.apache.org/jira/browse/DIRMINA-301 This creates two worker threads, one to read from the socket and one to write data to the socket. We did see an improvement in performance but only when run a machine with sufficient cpus to handle the extra threads. We are going to be upgrading our Mina shortly and will be retesting the performance difference with this MultiThreadedIOProcessor against the default single threaded Mina Processor. Any problems with the code feel free to give me a shout. As Mina has moved on somewhat since I first wrote this. Cheers On 02/05/07, angel figueroa <[EMAIL PROTECTED]> wrote:
The read and the write operation will occurs at the same time. It is possible to have a daemon thread one for reading and one for writing, and this two daemon thread is startup when the session is open. Another Worker Thread will be startup at the Application Startup. His jobs is to process all the transactions posted on the reading LinkedBlockingQueue, process the transaction and place the response into the writing LinkedBlockingQueue. This two LinkedBlockingQueue will be share between all sessions. The Reading daemon thread will write the information to a reading LinkedBlockingQueue. The Writing daemon thread will read the information from the writing LinkedBlockingQueue. Both operation will be operating in parallel. Any suggestion how it can be accomplished with the mina. Eugene Labunsky-2 wrote: > > I'm not using read/write one time. Only write or read. > > 2007/5/2, angel figueroa <[EMAIL PROTECTED]>: >> >> >> But How You accomplish to read and write from the socket connection at >> the >> same time? >> >> >> Trustin Lee wrote: >> > >> > On 5/2/07, angel figueroa <[EMAIL PROTECTED]> wrote: >> >> >> >> Hi, >> >> >> >> IF i development a Financial Transaction Server. The protocol is >> ISO >> >> 8583. But the Bank Transaction Switch will make a connection to our >> >> server >> >> written in mina. But it Require that the incoming transaction be queue >> >> and >> >> process but at the same time sending the response by the outgoing tcp >> >> connection. >> >> >> >> All example i review is more a conversational transaction. You >> received >> a >> >> transaction. Process it and Response Back. >> >> >> >> Is any example where you are simultaneous reading information. Other >> >> worker >> >> Thread and processing information. Put the response in a Queue, where >> the >> >> outgoing worker thread sent bank the response. >> > >> > I'm not sure I understood every single line, but what I can say is >> > that the bottom line is that you can read and write at the same time. >> > >> > Trustin >> > -- >> > what we call human nature is actually human habit >> > -- >> > http://gleamynode.net/ >> > -- >> > PGP Key ID: 0x0255ECA6 >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Simultaneous-reading-and-writing-using-mina-tf3678684.html#a10280335 >> Sent from the mina dev mailing list archive at Nabble.com. >> >> > > > -- > Regards, > Eugene Labunsky. > http://www.TrendMedium.com - MetaStock Add-on > > -- View this message in context: http://www.nabble.com/Simultaneous-reading-and-writing-using-mina-tf3678684.html#a10287085 Sent from the mina dev mailing list archive at Nabble.com.
-- Martin Ritchie
