Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-12658

Review use of multi thread semantics. Do we need to use C++11?

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Not specified
    • Resolution: Fixed
    • None
    • 6.0.0
    • None

    Description

      There are various multi threading patterns which frequently occur in our code, but there is often some confusion over whether critical sections/locks/memory barriers are required.

      Some examples:

      • Setting a boolean on one thread, and accessing from another. [And any reordering issues of code before/after]
      • Incrementing a value from one thread and checking from another
      • Decrementing a value from one thread and checking from another
      • check boolean, get lock, check boolean again
      • Reusing the same value set from another thread gives consistent values.

      X86/64 is strongly ordered, but other platforms powerpc/arm may expose problems in the existing implementation.

      One question is whether we need to switch to c++11 in order to obtain the necessary atomic memory ordering constraints.

      jakesmith richardkchapman mckellyln for discussion...we should document best practice somewhere in the sources, and extend as we hit new examples.

      Attachments

        Activity

          People

            ghalliday Gavin Halliday
            ghalliday Gavin Halliday
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: