Note, Eclipse keeps failing to check ChangeLog in, so I've just
committed the code for now. I'll try to update ChangeLog when I can.


Casey Marshall wrote:
> This fixes some issues with the kqueue selector. In brief:
> 
>   - We make KqueueSelectionKeyImpl a subclass of AbstractSelectionKey,
> which handles tracking canceled state.
>   - We ensure that we deregister canceled keys with their channel, and
> ignore keys attached to a closed channel.
>   - Don't keep native state per key; now we just figure out which keys
> need to be added, and which deleted, and build the entire native state
> for that on the fly.
> 
> This now seems to work really well. I'm able to run Azureus (with some
> random hangs that I haven't figured out yet) on jamvm on OS X, and it
> runs nice out-of-the-box.
> 
> I'll make some similar fixes to the epoll selector once I'm able to test
> on Linux again.
> 
> 2006-09-27  Casey Marshall  <[EMAIL PROTECTED]>
> 
>       * gnu/java/nio/KqueueSelectionKeyImpl.java: extend
>       AbstractSelectionKey.
>       (nstate, valid, readEverEnabled, writeEverEnabled): removed.
>       (activeOps, fd): new fields.
>       (cancel): removed.
>       (interestOps): just call `selector.setInterestOps.'
>       (isValid): removed.
>       (toString): include native fd in output.
>       (hashCode, equals, isReadActive, isReadInterested, isWriteActive,
>       isWriteInterested, needCommitRead, needCommitWrite): new methods.
>       * gnu/java/nio/KqueueSelectorImpl.java (MAX_DOUBLING_CAPACITY,
>       CAP_INCREMENT, INITIAL_CAPACITY): new constants.
>       (cancelled): removed.
>       (events): new field.
>       (OP_ACCEPT, OP_CONNECT, OP_READ, OP_WRITE): new constants.
>       (toString, equals): new methods.
>       (doSelect): get cancelled keys from superclass; fix synchronization;
>       initialize events that need to be added/deleted only when selecting;
>       ignore keys attached to closed channels.
>       (register): fix key initialization; synchronize adding keys.
>       (setInterestOps): new method.
>       (updateOps, updateOps): removed.
>       (reallocateBuffer): new method.
>       (doCancel): removed.
>       (kevent_set): add index, active ops parameters; remove delete
>       parameter.
>       (kevent): add output space size parameter.
>       * include/gnu_java_nio_KqueueSelectorImpl.h: regenerated.
>       * native/jni/java-nio/gnu_java_nio_KqueueSelectorImpl.c
>       (Java_gnu_java_nio_KqueueSelectorImpl_kevent_1set): only fill in
>       one filter, at the given index.
>       (Java_gnu_java_nio_KqueueSelectorImpl_kevent): separate incoming
>       event count and outgoing event count.
> 

Reply via email to