On Apr 19, 2007, at 5:26 AM, Rob Butler wrote:
I've been contemplating building a completely event driven non- blocking server using Mina. The server will have to listen to multiple ports and handle both UDP and TCP. I'd like to use a single thread for the entire application (all acceptors) because the server will not need to access any blocking resource. This will also allow me to eliminate any locking code within the server, as with a single thread there will never be any conflicts. Is this possible with Mina? What is the proper way to accomplish this?
yes, us a single IoProcessor thread on the SocketAcceptor. That's TCP- only though. You can't do a single thread between UDP + TCP
I'd like to explore this with several different scenarios. Would these all be handled the same or are some of these scenarios possible with Mina while others are not.
all sounds reasonable and do-able.
Another consideration is mult-core, multi-processor support. Obviously with one thread (the JVM of course has lots of background threads for GC etc) my server will not take full advantage of multiple cores/processors. I could abandon the single thread approach, but that of course would mean the application would require thread synchronization.
i'd recommend this :) .. use java.util.concurrent :) -pete -- [EMAIL PROTECTED] - http://fotap.org/~osi
smime.p7s
Description: S/MIME cryptographic signature
