Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
WorkForce< CONF > Class Template Reference

#include "vault/gear/work-force.hpp"

Description

template<class CONF>
class vault::gear::WorkForce< CONF >

Pool of worker threads for rendering.

Note
the
Template Parameters
CONFconfiguration/policy base must define:
  • doWork - the work-functor (with #SIG_WorkFun)
  • finalHook - called at thread exit
See also
WorkForce_test
SchedulerCommutator

Definition at line 240 of file work-force.hpp.

Public Member Functions

 WorkForce (CONF config)
 
 ~WorkForce ()
 
void activate (double degree=1.0)
 Activate or scale up the worker pool.
 
void incScale (uint step=+1)
 
void awaitShutdown ()
 
size_t size () const
 

Private Types

using Pool = std::list< work::Worker< CONF > >
 

Private Attributes

CONF setup_
 
Pool workers_
 

Additional Inherited Members

- Private Member Functions inherited from NonCopyable
 ~NonCopyable ()=default
 
 NonCopyable ()=default
 
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Constructor & Destructor Documentation

◆ WorkForce()

template<class CONF >
WorkForce ( CONF  config)
inline

Definition at line 250 of file work-force.hpp.

◆ ~WorkForce()

template<class CONF >
~WorkForce ( )
inline

Definition at line 255 of file work-force.hpp.

References WorkForce< CONF >::awaitShutdown(), and ERROR_LOG_AND_IGNORE.

+ Here is the call graph for this function:

Member Typedef Documentation

◆ Pool

template<class CONF >
using Pool = std::list<work::Worker<CONF> >
private

Definition at line 243 of file work-force.hpp.

Member Function Documentation

◆ activate()

template<class CONF >
void activate ( double  degree = 1.0)
inline

Activate or scale up the worker pool.

Parameters
degreefraction of the full #COMPUTATION_CAPACITY to activate
Note
will always activate at least one worker; will never scale down; setting values > 1.0 leads to over-provisioning...

Definition at line 271 of file work-force.hpp.

References util::limited(), WorkForce< CONF >::setup_, and WorkForce< CONF >::workers_.

+ Here is the call graph for this function:

◆ incScale()

template<class CONF >
void incScale ( uint  step = +1)
inline

Definition at line 280 of file work-force.hpp.

References util::min(), WorkForce< CONF >::setup_, and WorkForce< CONF >::workers_.

+ Here is the call graph for this function:

◆ awaitShutdown()

template<class CONF >
void awaitShutdown ( )
inline

Definition at line 289 of file work-force.hpp.

References WorkForce< CONF >::setup_, WorkForce< CONF >::size(), and WorkForce< CONF >::workers_.

Referenced by WorkForce< CONF >::~WorkForce().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

template<class CONF >
size_t size ( ) const
inline

Definition at line 298 of file work-force.hpp.

References WorkForce< CONF >::workers_.

Referenced by WorkForce< CONF >::awaitShutdown().

+ Here is the caller graph for this function:

Member Data Documentation

◆ setup_

template<class CONF >
CONF setup_
private

◆ workers_

template<class CONF >
Pool workers_
private
+ Inheritance diagram for WorkForce< CONF >:
+ Collaboration diagram for WorkForce< CONF >:

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