Added configurable mechanism for manually setting static event loop to use for new handles #2450
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.
For some context, please refer to the exchange this comment belongs to, as it's where the idea came from.
To summarize, normally when you use the static
event_loops
configuration, new handles are automatically added to loops following a round robin distribution. This patch allows you to configure Janus so that you can also optionally use the Janus API itself to tell the core which loop a new handle you're attaching should be added to. The discussion above provides some information on why it may be useful in some cases.To enable the functionality,
event_loops
must be configured, andallow_loop_indication
set totrue
(it'sfalse
by default). In that case, adding aloop_index
to anattach
request will instruct the core to manually add the handle to the specified core, rather than doing it automatically. Providing an invalid index will fall back to round robin.This PR is based on the
sendmmsg
branch, as #2295 is where we're trying to work on most optimizations. Please test and provide feedback, as that's the fastest way to get this merged soon.