directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [seda] A preview on redesigned SEDA (or Netty?)
Date Wed, 08 Dec 2004 16:11:57 GMT
Hi.  I'm glad to see some comments finally. :)

> The process of setting up the system is not too different from my
> thoughts on it.

Good.

> I'm sure the internals are going to be very different from our two
> thought processes.

Could you explain your thought process?  I think we need to cooperate.

> You had a head start on mina, so you got it done sooner :).  Anyway, I
> haven't
> really looked into the internals yet.  Does it use the ProtocolHandler
> interface that
> the old SEDA system did?  That is one of the goals I have.

No, but we can migrate very easily.  I'm not using snickers yet, but
I'll provide a wrapper for it.

> I'd like to see the difference in how these perform as well as how easy
> it is to work
> with.  If it looks like mina is easier to work with and seda is more
> scalable, we might
> look at merging some concepts.

I expect MINA to perform better than SEDA for a few reasons:

1. MINA doesn't create events and bytebuffer instances frequently.
2. MINA has constant route calculation time. (SEDA takes O(n) time)

But MINA can be slow too because she provides more complex event
hooks, and she has only one I/O thread. (SEDA has one for read and the
other for write.)

Her strength is in its freedom; you can use only core packages or can
use higher-level protocol package.  You can run your network
application in a single thread or in a thread pool.  Basically MINA
doesn't care if the user logic runs together with internal I/O thread.
 It is absolutely 100% up to the API user.  This flexibility is
accomplished by decorator pattern.  Currently MINA lacks rich set of
decorators, but I'll add them sooner or later.  Here is a possible
example:

Acceptor acceptor = new TcpAcceptor();
acceptor.bind(new InetSocketAddress(8080),
ThreadPooledSessionHandler.decorate(CoreAdapter.adapt(new
MyProtocolProvider()), /* TP size */ 16));


Cheers,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message