Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-8299

[C++] Reusable "optional ParallelFor" function for optional use of multithreading

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.17.0
    • C++

    Description

      We often see code like

          if (use_threads) {
            return ::arrow::internal::ParallelFor(n, Func);
          } else {
            for (size_t i = 0; i < n; ++i) {
              RETURN_NOT_OK(Func(i));
            }
            return Status::OK();
      

      It might be nice to have a helper function to do this. It doesn't even need to be an inline template, it could be a precompiled function accepting std::function<Status(int)>

      Attachments

        Issue Links

          Activity

            People

              fan_li_ya Liya Fan
              wesm Wes McKinney
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h