Multiplexer: Take the maximum number of events as a hint #11517
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: