Skip to content
Snippets Groups Projects
  1. Sep 04, 2022
    • Florian Fischer's avatar
      AbstractIoSleepStrategy: remove erroneous assertion · 3ac76c00
      Florian Fischer authored
      In my master's thesis, I described in listing 4.4 an io_uring-based
      suspension and notification algorithm, which is slightly different from
      what emper does.
      
      The described algorithm does not reset the sleep state if a worker
      skips sleeping because of a global sleeper count of less than 0 (line 21).
      
      Emper does always reset the sleep state to SleeperState::Running if
      the sleep method returned early (either the worker was specifically
      notified or the global sleep count indicated to skip the sleep attempt).
      
      Both variants are sound, but invariably resetting the sleeper count to
      running minimizes the windows of useless specific notifications.
      
      However, the assertion in onNewWorkNotification assumes the sleep state
      is always SleeperState::Notified if a specific notification is received
      through the worker's io_uring.
      
      Emper, resetting the sleep state, introduces a race between the notifier
      observing the state as sleeping, setting it to notified, and posting a
      notification to the potential sleeper's io_uring.
      But the sleeper skips the sleep attempt because the global sleeper count
      righteously resetting its state to running while invalidating the
      assertion.
      
      Therefore we remove the assertion because it is not invariant.
      3ac76c00
  2. Sep 01, 2022
  3. Jul 20, 2022
  4. Jul 19, 2022
  5. Jul 12, 2022
  6. Jun 10, 2022
Loading