llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
Public Member Functions | Protected Member Functions | List of all members
JobRunner< Task, Result > Class Template Referenceabstract

#include <tools/llir-reducer/job_runner.h>

Public Member Functions

 JobRunner (unsigned threadCount=1)
 Initialises the job runner.
 
virtual ~JobRunner ()
 Cleanup on exit.
 
void Execute (const Timeout &timeout)
 Run the pool.
 

Protected Member Functions

virtual std::optional< Task > Request ()=0
 
virtual Result Run (Task &&task)=0
 Run the task on a separate thread.
 
virtual void Post (Result &&result)=0
 Post the result of a task.
 

Detailed Description

template<typename Task, typename Result>
class JobRunner< Task, Result >

Parallel job runner which requests jobs until one finishes.

Member Function Documentation

◆ Request()

template<typename Task , typename Result >
virtual std::optional<Task> JobRunner< Task, Result >::Request ( )
protectedpure virtual

Request a new task to run on a free thread. Short-running task that runs on the main thread.


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