10 Apr
Posted by: Brandon Harper in: Algorithms, Computer Science, Culture, Disciplines, Java, Languages, Tips, Hacks, & Tricks
One of the newer features of Java as of 1.4 is non-blocking IO, yet it’s very hard to find decent documentation about it or even a simple tutorial. NIO is a very powerful feature but easy to get wrong given it’s complexity. However, James Greenfield, an engineer for Amazon, recently announced that he’d put up a tutorial for NIO, including a lot of important details of using NIO with SSL.
5 Responses
PaulH
10|Apr|2007 1cool, i’ve had to make use of NIO several time over the last few years, wish i’d seen that tutorial before. thanks.
Sean LeBlanc
11|Apr|2007 2Funny you should blog about this. I’ve been spending a good deal of the last week trying to untangle NIO (the non-blocking networking part, not all the other stuff that NIO entails like memory mapping).
I found that a pretty nice package has been moved into Apache called MINA. I’ve decided that I will most likely use this for our purposes. It was previously called Netty2. If you don’t feel like struggling with a poorly documented API unnecessarily, I’d consider it. MINA is still lacking documentation, too, but the mailing list is very lively, and the examples are pretty good.
I’ve also read that under certain conditions/requirements, using BIO still wins out in performance. I’ll be darned if I remember where, but I think it was on Sun discussion boards, or maybe the IBM ones.
Brandon Harper
11|Apr|2007 3Yeah, I have yet to actually dive into NIO myself, but a library I’m using at the moment is NIO based as well as some other stuff in the platform I work on, so it’s been on my radar lately.
Marcus Herou
02|Jul|2007 4Yep. I dug into it when it was first released but I never understood the benefits fully back then. And how the world can documentation about such a nice piece of architecture as event driven communication (which bytw is hot hot hot in lighttpd, apache etc) be so crappy ?
Anyway I think most tutorials only work in windows especially the thing that a key mostly is writeable in linux will make you to hack some workarounds to not have zillions of wakeups on write events.
I will try this tutorial. I’m writing since 4 years (yet another) caching framework (which I will release on SF) and will include a nonblocking distributed server/client cache. I have a total well performing blocking solution with worker threads, traffic control etc but I want to measure the difference between a well implemented nonblocking solution compared to a blocking.
It will not be easy since serialization is involved and I think I will be needing a bunch of worker threads handling send queues. People tend to say that you always should use one thread but I’m skeptic since
the underlying operations might read a file, db or so=block.
Everywhere I read people says Serialization=not NIO. but I know it can be done since I have a stupid echo serializing server now.
Keep up the blogging about this issue I sure need it
Kindly
//Marcus
bea
26|Jul|2007 5There is another good nio tutorial on java. net.
Leave a reply
Search
Categories
Archives
Links
Calendar
A design creation of Design Disease
devnulled is a personal blog and reflects the ideas and opinions of brandon harper and not his employer, dog, shoes, or stapler.
All content copyright © 2002-9002 brandon harper. All rights reserved.
devnulled is powered by FreeBSD, WordPress and the combustion of dead dinosaurs. It has also been made magically delicious by the pfm module.