Skip to content
Snippets Groups Projects

add a batch optimization for the global completer

Merged Florian Fischer requested to merge aj46ezos/emper:batch_schedule_from_anywhere into master
  1. Feb 26, 2021
    • Florian Fischer's avatar
      add a batch optimization for the global completer · 17776ba2
      Florian Fischer authored
      This change introduces new scheduleFromAnywhere methods which take
      a range of Fibers to schedule.
      
      Blockable gets a new method returning the fiber used to start
      the unblocked context, which is used by Future/PartialCompletableFuture
      to provide a way of completion and returning the continuation Fiber
      to the caller so they may schedule the continuation how they want.
      
      If the meson option io_batch_anywhere_completions is set the global
      completer will collect all callback and continuation fibers before
      scheduling them at once when it is done reaping the completions.
      The idea is that taking the AnywhereQueue write lock and calling onNewWork
      must only be done once.
      
      TODO: investigate if onNewWork should be extended by an amountOfWork
      argument which determines how many worker can be awoken and have work to
      do. This should be trivially since our WorkerWakeupSemaphore implementations
      already support notify_many(), which may be implemented in terms of
      notify_all though.
      17776ba2
Loading