Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
Loading...
Searching...
No Matches
batch_operations.h File Reference

Helper templates for batch operations to eliminate duplicated loop patterns. More...

#include <future>
#include <vector>
#include <utility>
#include <type_traits>
Include dependency graph for batch_operations.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  kcenon
 
namespace  kcenon::thread
 Core threading foundation of the thread system library.
 
namespace  kcenon::thread::detail
 

Functions

template<typename Container , typename Operation >
auto kcenon::thread::detail::batch_apply (Container &&items, Operation &&op)
 Apply an operation to each item in a collection, returning results.
 
template<typename T >
auto kcenon::thread::detail::collect_all (std::vector< std::future< T > > &futures) -> std::vector< T >
 Collect all results from a vector of futures.
 
void kcenon::thread::detail::collect_all (std::vector< std::future< void > > &futures)
 Specialization of collect_all for void futures.
 

Detailed Description

Helper templates for batch operations to eliminate duplicated loop patterns.

This file provides reusable template functions for:

  • Applying operations to collections (batch_apply)
  • Collecting results from futures (collect_all)

These helpers reduce code duplication in submit_wait_all, submit_wait_any, and batch enqueue methods throughout the codebase.

Definition in file batch_operations.h.