None
DE
Beyond OpenMP in C++ and Rust: Taskflow, Rayon, Fork Union
['Ash Vardanian']
Hacker News
Most thread-pools use classes like std::future , std::packaged_task , std::function , std::queue , std::conditional_variable . In Rust land, there will often be a std::Box , std::Arc , std::collections::VecDeque , std::sync::mpsc or even std::sync::mpmc . template < typename serial_at = stl_accumulate_gt < float >> class taskflow_gt { float const * const begin_ = nullptr ; float const * const end_ = nullptr ; std :: size_t const cores_ = 0 ; tf :: Executor executor_ ; tf :: Taskflow taskflow_ ; struct alignas ( 128 ) thread_result_t { double partial_sum = 0.0 ; }; std :: vector < thread_result_t > sums_ ; public : taskflow_gt () = default ; taskflow_gt ( float const * b , float const * e ) : begin_ { b }, end_ { e }, cores_ { total_cores ()}, executor_ { static_cast < unsigned > ( cores_…