Search |
||
Tricks and Tips with NIO.2/AIO part 0: A new beginningPosted by jfarcand on October 29, 2008 at 1:32 PM PDT
In this new installment series of tricks in tips, I will start sharing my observations with the upcoming NIO.2 (Asynchronous I/O) support in JDK 7 (jsr 203). The idea is simple: I've already added some support inside the Grizzly Framework (upcoming 1.9.0 version), and will share what I've learned/measured. Everything is new, from the JDK to upcoming Grizzly support! But first, before I deep dive into what I've learned (and that's why this blog's title contains "part 0" :-)), I strongly recommend you first install JDK 7, take a look at the new AIO API, and build Grizzly 1.9.0 with AIO support enabled: The module that contains AIO support are located under modules/grizzly-aio, the equivalent of the Grizzly Framework and modules/http-aio, which is a redesign of the http web server. Two OSGi bundles can can be launched (modules/bundles/grizzly-aio and modules/bundles/http-aio) using any OSGi runtime or directly using java -jar ... OK now I have to admit, the code is far from well designed (that will improve over time...trust me :-)). Why? Because I've added support to AIO on top of the NIO.1 framework and without forcing JDK 7 support for all modules. Only the AIO module requires JDK 7, hence I've "extended" as much as I can the original framework without adding JDK 7 dependencies. To write a Grizzly application that use AIO, you just need to: As you can see, buiding an AIO application using Grizzly is almost the same as with NIO.1 Of course it would have been better to hide the difference between NIO.1 and NIO.2 (AIOController vs Controler, AIOReadFilter vs ReadFilter), but it would have means adding a dependencies on JDK 7 to the framework, which is unthinkable right now. OK next time I will start describing what I needed to change, what are the new concepts and starts comparing NIO.1 performance with NIO.2. So far I've pretty good news :-) »
Related Topics >>
Open JDK Comments
Comments are listed in date ascending order (oldest first)
Submitted by igf1 on Fri, 2008-10-31 14:37.
Hmm, if you can serialize the API wrapper you could add a build fork based on the compiling JVM to the POM?
Submitted by kiory on Mon, 2008-11-10 07:05.
our comment submission failed for the following reasons:
|
||
|