Confused about Netty NIO

Holger Hoffstätte holger.hoffstaette at googlemail.com
Thu Oct 15 08:08:55 EDT 2009


phi6 wrote:
> Thanks for that Iain, does that mean however you end up with Thread per
> connection anyway (albeit indirectly) which is what I was trying to get away
> from in the first place? 

In Java you will _always_ end up with at least one thread per *concurrent
activity* since Java does not have continuations - the ability to freeze a
running activity in-flight and resume it later. For that you need a
user-level activity scheduler and some form of compiler or byte code
weaving support. There are several open-source continuations
implementations available, all with different degrees of maturity and
performance and advantages/drawbacks: off the top of my hat I remember
Kilim and RIFE - google for others.
Alternatively you can use Scala's upcoming continuations package or move
to Erlang.

-h


More information about the netty-users mailing list