Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-2567 KRPC milestone 1
  3. IMPALA-2397

Use atomic operations for simple numeric metrics

    XMLWordPrintableJSON

Details

    Description

      The metrics in util/metrics.h use a spin lock to guard the metric value. Most metric values are 64-bit words (e.g. int64_t, uint64_t, double) so we could easily use atomic operations to get and set the value. The spinlock requires at minimum 2 atomic operations to lock and unlock in addition to the actual store, whereas get/set/increment can typically be done with one operation. It may also be reasonable to do a non-atomic read since x64 provides some guarantees about aligned reads of words.

      Attachments

        Activity

          People

            kwho Michael Ho
            tarmstrong Tim Armstrong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: