pulsatrix
Loading...
Searching...
No Matches
pulsatrix::DataThreadPool Class Reference

Minimal, generic thread pool for CPU-side data pipeline work (fetch, decode, transform, collate stages) – campaign_exai_dl_library_data_pipeline's staged- pipeline backbone alongside BoundedQueue. Deliberately not tied to Dataset/DataLoader types. More...

#include <data_thread_pool.hpp>

Public Member Functions

 DataThreadPool (unsigned num_threads)
 
 ~DataThreadPool ()
 
 DataThreadPool (const DataThreadPool &)=delete
 
DataThreadPool & operator= (const DataThreadPool &)=delete
 
template<typename F >
auto submit (F &&task) -> std::future< std::invoke_result_t< F > >
 Enqueues a task for execution by a worker thread.
 

Detailed Description

Minimal, generic thread pool for CPU-side data pipeline work (fetch, decode, transform, collate stages) – campaign_exai_dl_library_data_pipeline's staged- pipeline backbone alongside BoundedQueue. Deliberately not tied to Dataset/DataLoader types.

Note
This is pulsatrix's first concurrent code path. No production DataLoader path exercises this class yet in Phase 1 – see bounded_queue.hpp's matching note.

Constructor & Destructor Documentation

◆ DataThreadPool() [1/2]

pulsatrix::DataThreadPool::DataThreadPool ( unsigned  num_threads)
explicit

◆ ~DataThreadPool()

pulsatrix::DataThreadPool::~DataThreadPool ( )

◆ DataThreadPool() [2/2]

pulsatrix::DataThreadPool::DataThreadPool ( const DataThreadPool &  )
delete

Member Function Documentation

◆ operator=()

DataThreadPool & pulsatrix::DataThreadPool::operator= ( const DataThreadPool &  )
delete

◆ submit()

template<typename F >
auto pulsatrix::DataThreadPool::submit ( F &&  task) -> std::future<std::invoke_result_t<F>>
inline

Enqueues a task for execution by a worker thread.

Returns
A future resolving to the task's return value (or exception, if it throws).
Exceptions
std::runtime_errorif the pool has already been stopped (destructor entered) – external boundary: a caller submitting after shutdown has begun is a real usage error a well-formed caller can still trigger under a race.

The documentation for this class was generated from the following file: