libev and Java
Aleksandar Lazic
al-libev at none.at
Tue Feb 14 12:24:14 CET 2012
Hi,
On 10-02-2012 18:17, Marc Lehmann wrote:
> On Thu, Feb 09, 2012 at 11:24:31PM +0100, Aleksandar Lazic
> <al-libev at none.at> wrote:
>> Hi,
>>
>> what are the list members think about to make a libev Java
>> Interface?
>> Is it worth comapared to NIO & NIO2?
>
> Depends on how you measure "worth", but in most cases, I'd say
> somebody needs
> to try it before being able to say so. Now, NIO* are specifications,
> so it
> mostly depends on how the libev API would look like in java.
>
> Since java requires manual destruction, the API would probably be an
> "objectified C API", as opposed to e.g. the C++ interface which
> stores
> the loop in each watcher to be able to automatically stop watchers.
> So
> basically it would be the normal C API, but with methods. All the
> functions thta expect a loop * as first arg would probably beocme
> loop
> methods, and all the rest probably watcher methods.
>
> If you mean particular implementations of NIO*, then of course it
> depends
> on what those do. It's quite possible for NIO to outperform libev,
> for
> example, because it is better-integrated with java - just nobody
> knows
> that until it has been tried :)
;-)
Well I think to create a selector for NIO* is the *best* way.
http://docs.oracle.com/javase/6/docs/api/java/nio/channels/spi/SelectorProvider.html
http://docs.oracle.com/javase/6/docs/api/java/nio/channels/Selector.html
like the
./jdk/src/solaris/classes/sun/nio/ch/EPollSelectorImpl.java
http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/b6c45a8b14fb/src/solaris/native/sun/nio/ch/
http://hg.openjdk.java.net/jdk6/jdk6/jdk/file/b6c45a8b14fb/src/solaris/classes/sun/nio/ch/
I will take a look into this further but without timeline, it's just
for my curiosity ;-)
Cheers
Aleks
More information about the libev
mailing list