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

Multiplexer: Take the maximum number of events as a hint #11517

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

rgacogne
Copy link
Member

@rgacogne rgacogne commented Apr 8, 2022

Short description

This allows indicating the maximum number of events we want to process in a single run, which is usually bounded by the number of file descriptors we are planning on watching.
The default is still 1024 events, but this change makes it possible to allocate a smaller vector of events to reduce the memory usage when we know we are going to need to process so many events in a single run.

As usual for code that touches to our multiplexer, I unfortunately do not have the platforms needed to test /dev/poll, kqueue and ports at hand, so I would appreciate any feedback, as well as a good review :)

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

This allows indicating the maximum number of events we want to process
in a single run, which is usually bounded by the number of file descriptors
we are planning on watching.
The default is still 1024 events, but this change makes it possible to
allocate a smaller vector of events to reduce the memory usage when we
know we are going to need to process so many events in a single run.
@omoerbeek
Copy link
Member

omoerbeek commented Apr 8, 2022

It builds and seems to run fine on OpenBSD (using kqueue). Will do a review now.

@rgacogne rgacogne merged commit 0f5fcaf into PowerDNS:master Apr 8, 2022
@rgacogne rgacogne deleted the mplexer-smaller-event-arrays branch April 8, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants