harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Wilson <jessewil...@google.com>
Subject Re: [jira] Commented: (HARMONY-6312) Concurrency problems in NIO
Date Tue, 29 Sep 2009 16:31:47 GMT
On Tue, Sep 29, 2009 at 1:20 AM, Regis <xu.regis@gmail.com> wrote:

> I think "changes to the selected keys set" doesn't help to show more
> things.
> Because there is no much difference in processSelectResult. And the reason
> for maintaining readableFDs/writableFDs and mapping is avoiding O(num(keys))
> in Selector.select() [1]
>
> What do you think?
>

The optimizations moved work from selectNow() to register() and
SelectionKey.interestOps(). Microbenchmarks that don't exercise those
methods encourage the wrong kind of optimizations.

And the current code is allocation heavy. In select cycles where the number
of the ready keys changes, it allocates and copies O(numReadyKeys) memory.
Unfortunately, the 4879 benchmark doesn't include any of these allocations.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message