7131697 :(se) Need AsynchronousChannelProvider implementation

Alan Bateman Alan.Bateman at oracle.com
Fri Jan 27 05:35:23 PST 2012


The Mac port doesn't currently have an implementation of the 
asynchronous I/O API and so all tests for this area, including JCK 
tests, are failing. I've whipped up an initial implementation based on 
kqueue and put the webrev here:

http://cr.openjdk.java.net/~alanb/7131697/webrev/

It's very simple and works very similarly to the the epoll based 
implementation that we have on Linux. It passes all tests on both 10.6.8 
and 10.7. In summary, each channel group has a kernel queue and channels 
associated with the group register for events on that queue. The channel 
group's thread pool services the events. The events are retrieved in 
batch by a leader thread that makes them available to any other threads. 
There is clearly some performance work that needs to be done around this 
but it's not critical in the short term.

Note that that sun.nio.ch.KQueue is its own class so that we can re-use 
in a re-work of Apple's kqueue based Selector implementation. That 
Selector needs a bit of work in order to pass all tests and so is not 
currently used by default. Another thing to mention is that I updated 
the mapfile although that doesn't appear to be used in the current build.

-Alan.



More information about the macosx-port-dev mailing list