Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-1177

Consider signaling cond vars outside lock in BlockingQueue

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: perf
    • Labels:
      None

      Description

      It seems like in current implementations of libc, they don't implement the optimization where signaling a condition variable just moves the signaled thread to the top of the lock's wait queue. Instead, it actually wakes the thread, which will then immediately just proceed to try to take the lock, and block again, causing extra context switches.

      https://sourceware.org/ml/libc-alpha/2005-03/msg00228.html noted this behavior but it doesn't seem like anything got done, best I can tell. Warrants some benchmarking and investigation. Also worth noting that Impala does the signal outside the lock.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tlipcon Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: