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

Use EPOLLONESHOT #6

Open
sergiu128 opened this issue Jul 18, 2022 · 0 comments
Open

Use EPOLLONESHOT #6

sergiu128 opened this issue Jul 18, 2022 · 0 comments
Assignees
Labels
epoll good first issue Good for newcomers

Comments

@sergiu128
Copy link
Collaborator

sergiu128 commented Jul 18, 2022

We add an event to epoll: https://github.com/talostrading/sonic/blob/master/internal/poll_linux.go#L160
When we poll for that event, we delete it: https://github.com/talostrading/sonic/blob/master/internal/poll_linux.go#L160

We don't want to delete it, but rather do it like poll_bsd where we don't do anything: https://github.com/talostrading/sonic/blob/master/internal/poll_linux.go#L160

This boils down to using EPOLLONESHOT correctly. The interface is not as straightforward as kqueue's, as the file descriptor is still kept in the eventlist by epoll after an event occurs on it, unlike in kqueue which automatically removes it. This means that logic for adding an event will probably be like this:

  • check if the event is in epoll's list
  • if not, then add it and register interest on it
  • if yes, then just register interest on it
@sergiu128 sergiu128 self-assigned this Jul 18, 2022
@sergiu128 sergiu128 added the good first issue Good for newcomers label Jul 22, 2022
@sergiu128 sergiu128 changed the title Use EPOLLONESHOT Use EPOLLONESHOT Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epoll good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant