Callback Based Selectors

David Lloyd david.lloyd at redhat.com
Wed Mar 14 15:47:58 UTC 2018


On Wed, Mar 14, 2018 at 10:14 AM,  <forax at univ-mlv.fr> wrote:
>> De: "David Lloyd" <david.lloyd at redhat.com>
>> A brand new API which doesn't have the same select-under-lock behavior
>> would be nifty, but I think that's a much bigger "ask".
>
> I think it's a lesser "ask", the Selector API is already small in term of number of methods, the main issue is the locking scheme,
> that why i think it's easier to create a new API with no public locking scheme that trying to retrofit the Selector API.
>
> Alan will know more but i believe that we have a separate class AsynchronousFileChannel instead of an asynchronous API in FileChannel for the same reason.

I did not mean to imply that it is not a good idea.  The locking model
of Selectors is a primary source of problems with our NIO-based
software.  A pure callback-based replacement would be really great for
us at least; I just don't think that it's necessarily exclusive to the
idea of adding a callback-based method like Alan proposed, which
already allows us to improve things by reducing copying in our
selection operations.


-- 
- DML


More information about the nio-dev mailing list