Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-49106

Add poll function to the ServiceExecutor API

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Service arch 2020-07-13, Service Arch 2020-07-27, Service Arch 2020-08-10

      If we are on a thread pool, we want to avoid blocking threads while waiting for new data to read. This would imply that a thread somewhere is [e]polling for us, most likely an ASIOReactor. However, if we’re already on a dedicated thread, we want to block our own thread. To solve this contradiction, we want to provide a function Future<void> ServiceExecutor::waitForData(Session*) that polls and then reschedules execution for its future. We should be able to invoke asio::async_read with an asio::null_buffers, thus copying no data until we are safely on the correct thread.

            Assignee:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Reporter:
            ben.caimano@mongodb.com Benjamin Caimano (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: