On 6/16/11 6:34 AM, Alan D. Cabrera wrote:
On Jun 6, 2011, at 2:46 AM, Julien Vermillard wrote:

Hi !
Just a few heads up on current work on MINA 3.

As stated before, we are re-writing from scratch (but using MINA well
know interface/concepts) a simple NIO TCP server for experimenting
different strategy around NIO selector.

The work is done on this branch :
http://svn.apache.org/repos/asf/mina/branches/3.0/

Here the current Javadoc :
http://people.apache.org/~jvermillard/mina-3.0/apidocs/

Actually the NioTcpServer accept connections, write some basic bytes
and read incoming data in a SelectorProcessor. A SelectorProcessor is
a thread selecting/polling a bunch of sockets.

The main design change is the SelectorStrategy idea :
When you create a Service (server or client) you provide a
SelectorStrategy which will be in charge of providing the
SelectorProcessor for the different operations (accept, read, write).
So we can implements (and seriously benchmark) different SelectorStrategy like :
- OneThreadSelectorStrategy (currently implemented) which will spawn
only one SelectorProcessor for handling all the operations
(accept/read/write)
- a processor thread for read, another for write, another for accept
- a processor thread for each CPU
- ...

The idea is to stress test few ideas and  find the winning scenario
for common use cases (connection less like HTTP, long living sessions,
write intensive protocols, latency, etc..)

I now need to plug a serious API for writing real tests : IoHandler
and perhaps a filter chain and a test environment.

For the IoHandler/ chain I'll dig in the ML archive, a lot of idea was
proposed, but for the test env, I'm a bit puzzled, does I'm supposed
to ask resources to infra ?

Any help/patch/review comment on the code is welcomed even if I
haven't much hope :)
Julien

Very cool!  I have a few questions.

Why have a class for WriteQueue and not simply use Queue<WriteRequest>?

Why have an interface WriteRequest and not simply use Object?

Why do we have IoSessionFuture, CloseFuture, ConnectFuture and WriteFuture and not 
simply use Future<>?
Those are all good questions. No time to think about it this morning, but definitively something I'll give some thought later today.
A long time ago I also took a stab a Mina 3 API.  Mine was driven by an async 
HTTP implementation.  It would be neat if we could merge the two sets of ideas; 
not sure how much time I can devote to this in the short term though.  :)
We are all on the same page ith the same problem : lack of time :) But we will fix this problem too !


--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to