NIO or IO?

From: Jeffrey Spoon (JeffreySpoon_at_hotmail.com)
Date: 01/27/05


Date: Thu, 27 Jan 2005 16:36:36 +0000


Hello. I'm thinking of implementing a simple (to start with) P2P system.
The test system will be pretty simple but I was wondering whether I
should use IO or NIO. The thing is it would have to be scalable as I
envisage quite a high number of nodes. Would NIO be worth the hassle, or
should I stick with IO for now? I have some knowledge of IO but none of
NIO. Are the performance advantages of NIO that good? As far as I know
NIO is much better at multiple connections since you use channels rather
than sockets, and switch between channels, thus saving threads. For IO I
take it I would simply have to use multiple threads for each connection?
That could get quite heavy on the CPU, I suspect. But I know IO is going
to be a lot easier to use. Any suggestions?

-- 
Jeffrey Spoon