Skip to content
Snippets Groups Projects
  1. Jan 22, 2022
    • Florian Fischer's avatar
      [ScheduleOnTest] block worker thread if IO is not available · 26fdbcca
      Florian Fischer authored
      The alpha fiber waits to ensure the worker threads are suspended before
      starting to schedule work on specific threads.
      emper::sleep uses an AlarmFuture and thus needs emper to be build with IO
      support. If IO is not available we now just block the whole worker thread.
      26fdbcca
  2. Jan 21, 2022
    • Florian Fischer's avatar
      introduce new Scheduler::scheduleOn(fiber, workerId) function · 24993175
      Florian Fischer authored
      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
      24993175
Loading