Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cJobThreadMgr Class Reference

#include <cJobThread.h>

Inheritance diagram for GrayLib::cJobThreadMgr:
GrayLib::cJobThreadSet< cJobThread >

Public Member Functions

 cJobThreadMgr (int iMaxThreads=32)
 
 ~cJobThreadMgr ()
 
HRESULT ScheduleJob (cJobBase *pJob, TIMESYSD_t mSecDelay)
 
void OnTickJobs ()
 
- Public Member Functions inherited from GrayLib::cJobThreadSet< cJobThread >
 cJobThreadSet (int iMinThreads=0, int iMaxThreads=32) noexcept
 
ITERATE_t get_RunningJobQty () const noexcept
 
ITERATE_t get_WaitingJobQty () const noexcept
 

Friends

class cJobThread
 

Additional Inherited Members

- Protected Attributes inherited from GrayLib::cJobThreadSet< cJobThread >
const int m_iMinThreads
 min Threads i should keep in a pool ready to go. TODO More...
 
const int m_iMaxThreads
 max total Threads I'm allowed to use for this set. More...
 
cArrayRef< cJobThreadm_aRunningThreads
 Active Threads currently running/sleeping on Jobs/scripts. Idle threads get returned back to the shared cJobThreadPool. More...
 
cJobArray m_WaitingJobs
 cJobBase to schedule some TIME later. (not yet occupying a Thread.) More...
 

Detailed Description

A set of jobs to be run concurrently (if possible), sharing a limited set of threads. m_iMaxThreads Jobs can run concurrently until done. hold threads to be re-used for new jobs.

Constructor & Destructor Documentation

◆ cJobThreadMgr()

GrayLib::cJobThreadMgr::cJobThreadMgr ( int  iMaxThreads = 32)

◆ ~cJobThreadMgr()

GrayLib::cJobThreadMgr::~cJobThreadMgr ( )

Member Function Documentation

◆ OnTickJobs()

void GrayLib::cJobThreadMgr::OnTickJobs ( )

Do we have any jobs waiting to run? Try to assign it to a free thread.

◆ ScheduleJob()

HRESULT GrayLib::cJobThreadMgr::ScheduleJob ( cJobBase pJob,
TIMESYSD_t  mSecDelay 
)

Schedule the job to run mSecDelay from now.

Todo:
FIX ScheduleJob

Friends And Related Function Documentation

◆ cJobThread

friend class cJobThread
friend

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