Nektar++
Classes | Typedefs | Enumerations | Functions
Nektar::Thread Namespace Reference

Classes

class  ThreadJob
 Base class for tasks to be sent to the ThreadManager to run. More...
 
class  ThreadManager
 The interface class for the controller for worker threads and jobs. More...
 
class  ThreadManagerStd
 Implementation of ThreadManager using std::thread. More...
 
class  ThreadMaster
 
class  ThreadStartupManager
 A default ThreadManager. More...
 
class  ThreadWorkerStd
 Implementation class for ThreadManagerStd. More...
 

Typedefs

typedef std::shared_ptr< ThreadManagerThreadManagerSharedPtr
 
typedef LibUtilities::NekFactory< std::string, ThreadManager, unsigned int > ThreadManagerFactory
 
typedef std::unique_lock< std::shared_mutex > WriteLock
 
typedef std::shared_lock< std::shared_mutex > ReadLock
 
typedef std::unique_lock< std::mutex > Lock
 

Enumerations

enum  SchedType { e_guided , e_dynamic }
 Identifies the algorithm for scheduling. More...
 

Functions

ThreadManagerFactoryGetThreadManagerFactory ()
 
ThreadMasterGetThreadMaster ()
 

Typedef Documentation

◆ Lock

typedef std::unique_lock<std::mutex> Nektar::Thread::Lock

Definition at line 50 of file ThreadStd.h.

◆ ReadLock

typedef std::shared_lock<std::shared_mutex> Nektar::Thread::ReadLock

Definition at line 377 of file Thread.h.

◆ ThreadManagerFactory

Definition at line 71 of file Thread.h.

◆ ThreadManagerSharedPtr

Definition at line 69 of file Thread.h.

◆ WriteLock

typedef std::unique_lock<std::shared_mutex> Nektar::Thread::WriteLock

Definition at line 376 of file Thread.h.

Enumeration Type Documentation

◆ SchedType

Identifies the algorithm for scheduling.

Currently there are two strategies to determine the number of jobs. e_static always loads m_chunkSize jobs onto each worker, e_guided uses a simple algorithm that loads a larger proportion of jobs onto the worker as the size of the queue list is large, but scales down to no fewer than m_chunkSize as the queue empties.

See also
ThreadManager::SetChunkSize()
Enumerator
e_guided 
e_dynamic 

Definition at line 62 of file Thread.h.

63{
66};

Function Documentation

◆ GetThreadManagerFactory()

ThreadManagerFactory & Nektar::Thread::GetThreadManagerFactory ( )

Definition at line 45 of file Thread.cpp.

46{
47 static ThreadManagerFactory instance;
48 return instance;
49}
Provides a generic Factory class.
Definition: NekFactory.hpp:104

Referenced by Nektar::Thread::ThreadMaster::CreateInstance().

◆ GetThreadMaster()

ThreadMaster & Nektar::Thread::GetThreadMaster ( )

Definition at line 128 of file Thread.cpp.

129{
130 static ThreadMaster instance;
131 return instance;
132}