Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is the wakeup flag still checked after NioEventLoop.select is executed? #9782

Closed
jffree opened this issue Nov 16, 2019 · 4 comments
Closed
Assignees
Milestone

Comments

@jffree
Copy link

jffree commented Nov 16, 2019

Netty version

4.1

Description

In NioEventLoop.run function:

                       if (wakenUp.get()) {
                            selector.wakeup();
                        }

Why is the wakeup flag still checked after NioEventLoop.select is executed?In NioEventLoop.select function, already use hasTasks func to check if there are new tasks joined. I don't think this step is necessary.

@normanmaurer
Copy link
Member

@njhill can you have a look as you worked on this stuff ?

@franz1981
Copy link
Contributor

For different reasons I've come at a similar conclusion some time ago: linking the issue here hoping will help #9112

@njhill
Copy link
Member

njhill commented Nov 23, 2019

I actually had not really dug into the NioEventLoop impl too much, prior focus was on streamlining EpollEventLoop. But from what I'd seen it was really in need of an equivalent overhaul.

The latest structure of EpollEventLoop should actually be mostly applicable to the other async transports including NIO so I took a quick stab at refactoring NioEventLoop along those lines, will open a PR.

@njhill
Copy link
Member

njhill commented Nov 23, 2019

@normanmaurer @franz1981 @jffree PTAL #9799

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants