On 7/18/07, peter royal <[EMAIL PROTECTED]> wrote:
On Jul 10, 2007, at 3:31 AM, Trustin Lee wrote:
> I found writing messages very fast from many threads sometimes doesn't
> scale because the internal implementation of Seletor.wakeup() acquires
> an exclusive lock.  We could minimize the wakeup() calls in
> SocketIoProcessor.flush(), but I don't have any good idea to do so.
>
> I thought about improving SocketIoProcessor.flush() like the
> following,
>
>    void flush(SocketSessionImpl session) {
>        boolean needsWakeup = flushingSessions.isEmpty();
>        scheduleFlush(session);
>        if (needsWakeup) {
>            Selector selector = this.selector;
>            if (selector != null) {
>                selector.wakeup();
>            }
>        }
>    }
>
> but I doubt it might not wake the selector up when it needs to be
> waken up.

Seems reasonable at first glance.. make the change and re-run your
tests?

Yep, it worked fine.  I am just somewhat worried about the selector
not getting notified under low load.  I made sure it performs very
nicely under heavy load.

Thanks for the confirmation,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to