Jobrocket
jobrocket::JobGroup Class Reference

#include <JobGroup.hpp>

Overview

A grouping of many jobs that can be waited on until the final job in the group finishes execution

Public Member Functions

 JobGroup ()
 
template<typename Fn , typename... Args>
void run (Fn function, Args &&... args)
 Adds a job to the group and runs it. More...
 
void wait_for_all ()
 

Constructor & Destructor Documentation

◆ JobGroup()

jobrocket::JobGroup::JobGroup ( )
inline

Member Function Documentation

◆ run()

template<typename Fn , typename... Args>
void jobrocket::JobGroup::run ( Fn  function,
Args &&...  args 
)
inline

Adds a job to the group and runs it.

◆ wait_for_all()

void jobrocket::JobGroup::wait_for_all ( )
inline

Waits for all jobs in the group to finish execution. Rather than sleeping or busy-waiting this function will cause the calling thread to start popping and stealing jobs from queues in an effort to help with the schedulers work-load