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

ThreadPool should use std::deque instead of std::list to hold _pendingTasks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.9
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Platform A (10/09/15)

      Description

      While profiling network_interface_asio_integration_test, which uses a ThreadPool, I found that ~60% of cycles were spent in ThreadPool::schedule(). Changing _pendingTasks from a list to a deque made schedule() take a more reasonable amount of time. The culprit is probably libstdc++ not implementing list::size as an O(1) operation, despite that being mandated by the C++11 standard.

        Attachments

          Activity

            People

            Assignee:
            adam.midvidy Adam Midvidy
            Reporter:
            adam.midvidy Adam Midvidy
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: