37 #include <boost/core/ignore_unused.hpp> 122 m_mutex(), m_threadingType()
160 "Tried to SetThreadingType when it was already set");
199 "Trying to create a ThreadManager before SetThreadingType called");
228 boost::ignore_unused(joblist);
230 "Attempted to QueueJobs in ThreadDefaultManager");
239 boost::ignore_unused(job);
241 "Attempted to QueueJob in ThreadDefaultManager");
269 "Attempted to SetNumWorkers to != 1 in ThreadDefaultManager");
305 boost::ignore_unused(chnk);
307 "Attempted to SetChunkSize in ThreadDefaultManager");
316 boost::ignore_unused(s);
318 "Attempted to SetSchedType in ThreadDefaultManager");
364 boost::ignore_unused(src);
virtual unsigned int GetWorkerNum()
Returns the worker number of the executing thread.
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
std::shared_ptr< ThreadManager > ThreadManagerSharedPtr
virtual ~ThreadManager()
Destructor.
unsigned int GetWorkerNum()
void SetWorkerNum(unsigned int num)
Set number of worker threads.
virtual void QueueJobs(std::vector< ThreadJob *> &joblist)
Pass a list of tasklets to the master queue.
virtual unsigned int GetMaxNumWorkers()
Gets the maximum available number of threads.
virtual unsigned int GetNumWorkers()
Return the number of active workers.
virtual void Hold()
A calling threads holds until all active threads call this method.
ThreadManagerSharedPtr & GetInstance(const ThreadManagerName t)
Gets the ThreadManager associated with string s.
virtual void SetNumWorkers()
Sets the number of active workers to the maximum.
virtual void Wait()
Waits until all queued jobs are finished.
SchedType
Identifies the algorithm for scheduling.
virtual ~ThreadStartupManager()
ThreadJob()
Base constructor.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
ThreadManagerFactory & GetThreadManagerFactory()
std::vector< ThreadManagerSharedPtr > m_threadManagers
std::string m_threadingType
ThreadStartupManager()
ThreadDefaultManager.
virtual void QueueJob(ThreadJob *job)
Pass a single job to the master queue.
virtual void SetSchedType(SchedType s)
Sets the current scheduling algorithm.
ThreadMaster()
Constructor.
ThreadMaster & GetThreadMaster()
virtual void SetChunkSize(unsigned int chnk)
Controls how many jobs are sent to each worker at a time.
virtual const std::string & GetType() const
Returns a description of the type of threading.
ThreadStartupManager & operator=(const ThreadStartupManager &src)
ThreadDefaultManager copy constructor.
ThreadManagerSharedPtr CreateInstance(const ThreadManagerName t, unsigned int nThr)
Creates an instance of a ThreadManager (which one is determined by a previous call to SetThreadingTyp...
Base class for tasks to be sent to the ThreadManager to run.
~ThreadMaster()
Destructor.
virtual bool InThread()
Indicates whether the code is in a worker thread or not.
virtual bool IsInitialised()
ThreadManager implementation.
void SetThreadingType(const std::string &p_type)
Sets what ThreadManagers will be created in CreateInstance.
virtual ~ThreadJob()
Base destructor.
virtual bool IsInitialised()
ThreadManager implementation.
Provides a generic Factory class.