Selector cleanup
Alan Bateman
Alan.Bateman at Sun.COM
Fri Jan 25 13:59:25 UTC 2008
Rémi Forax wrote:
> :
> We have observed that a selector doesn't work well with a lot of keys.
Is this just Windows? I ask because the Selector implementations on
Solaris and Linux scale very well and there are many people using it on
servers that are handling thousands of concurrent connections.
>> The idle set is almost always empty and an aside from one case, there
>> shouldn't be any boxing when the set is empty.
> I not agree, reading the code, idle set is used when setInterestOps(0)
> is called.
> I'm not sure that case is not frequent.
> By example, you can found this code in grizzly:
>
> // disable OP_READ on key before doing anything else
> key.interestOps(key.interestOps() & (~SelectionKey.OP_READ));
>
> see
> http://weblogs.java.net/blog/jfarcand/archive/2006/06/tricks_and_tips.html
>
I've only observed it on a few occasions. As it happens that fragment of
Grizzly code is what lead us to add the idle set as I missed this case
in the original implementation (see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6403933 for details).
-Alan.
More information about the core-libs-dev
mailing list