Skip to content
Snippets Groups Projects
Commit 24993175 authored by Florian Fischer's avatar Florian Fischer
Browse files

introduce new Scheduler::scheduleOn(fiber, workerId) function

This function is needed to deal with worker local ressources: io_uring
requests for example.

Each worker now always has a MPSC inbox queue which was already used
in the laws scheduling strategy.
Fibers can be scheduled to a specific worker using the new
Scheduler::scheduleOn method.

Since the inbox queues are now always present we can use a single
FiberSource enum combining AbstractWorkStealingStrategy::FiberSource
and LawsStrategy::FiberSource.

The laws strategy now uses the inbox queues as its priority queues.
With the only differenze that when scheduling to a inbox queue
using the Scheduler::scheduleOn the Fiber lifes only in the inbox
queue and not also simultaneously in a WSQ.

Unrelated code changes made while touching the code anyway:
* Introduce FiberSource::io which hints that a Fiber comes from the
  worker's own CQ.
* Strongly type the fiber's source in NextFiberResult.
* Make all scheduler functions return std::optional<NextFiberResult>
* Cleanup the identation in nextFiberResultViaWorkStealing
parent c910c900
No related branches found
No related tags found
Loading
Showing
with 269 additions and 155 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment