- selectorThread.registerKey(
>
> processor.getSelectionKey());
> - } else {
> - selectorThread.cancelKey(processor.getSelectionKey());
> + boolean cancelkey = processor.getAptCancelKey() ||
> processor.isError()
> + || !processor.isKeepAlive();
> + try{ + if (!cancelkey){
> + if (processor.getReRegisterSelectionKey()){
> +
> setSelectionKeyTimeout(processor.getSelectionKey(), Long.MIN_VALUE);
> +
> selectorThread.registerKey(processor.getSelectionKey());
> + }
>
" When getReResgisterSelectionKey() return false, we do nothing with the
key, right? But we recycle the processor later, so are we missing a case
here?"
comet handles the key registration (read interest enabled so we can detect
clientclosed) itself and simply keeps its registered on a resume.
"Can you explain here why resetExpiration is gone? Just want to make sure as
this is used by the new Servlet 3.0 Async implementation in GlassFish."
its gone cause we now have 1 sec idle check interval that should be enough ?
Calling that method enforces full idle check, if theres alot of keys and
it triggers idle check in very high frequency it can eat alot of the
selecting threads time. take 10K keys and 1K frequency on a busy server you
got 10mill tests, assume a test is 100 cycles due to a few ram accesses
here and there. its 1Ghz of cpu wasted.
in all other regards we are working hard to Decrease the selector thread
load not to increase it.
having such a method allows for it to be missused.
but if there is valid usercase that cant be implemented in any other way
we should have this method.
--
regards
gustav trede