SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
smtrat::ThreadPool Class Reference

#include <ThreadPool.h>

Collaboration diagram for smtrat::ThreadPool:

Public Member Functions

 ThreadPool (std::size_t maxThreads)
 
 ~ThreadPool ()
 
Answer runBackends (const std::vector< Module * > &_modules, bool _final, bool _full, carl::Variable _objective)
 

Private Member Functions

bool shallBeSkipped (std::size_t index)
 
bool notify (std::size_t index)
 
void runTask (Task *task)
 
void deleteTask (Task *task)
 
void submitBackend (Task *task)
 

Private Attributes

const std::size_t mMaxThreads
 
std::atomic< std::size_t > mCounter
 Initialized with 1: There is always the main thread in the beginning. More...
 
std::atomic< std::size_t > mNumberThreads
 Initialized with 1: There is always the main thread in the beginning. More...
 
std::mutex mBackendSynchrosMutex
 
std::vector< BackendSynchronisation * > mBackendSynchros
 
std::mutex mQueueMutex
 
std::mutex mThreadCreationMutex
 
std::priority_queue< Task * > mQueue
 

Detailed Description

Definition at line 72 of file ThreadPool.h.

Constructor & Destructor Documentation

◆ ThreadPool()

smtrat::ThreadPool::ThreadPool ( std::size_t  maxThreads)
inline

Definition at line 120 of file ThreadPool.h.

◆ ~ThreadPool()

smtrat::ThreadPool::~ThreadPool ( )
inline

Definition at line 122 of file ThreadPool.h.

Member Function Documentation

◆ deleteTask()

void smtrat::ThreadPool::deleteTask ( Task task)
inlineprivate

Definition at line 109 of file ThreadPool.h.

Here is the caller graph for this function:

◆ notify()

bool smtrat::ThreadPool::notify ( std::size_t  index)
inlineprivate

Definition at line 95 of file ThreadPool.h.

Here is the caller graph for this function:

◆ runBackends()

Answer smtrat::ThreadPool::runBackends ( const std::vector< Module * > &  _modules,
bool  _final,
bool  _full,
carl::Variable  _objective 
)
Parameters
_modules
_final
_full
_objective

Definition at line 55 of file ThreadPool.cpp.

Here is the call graph for this function:

◆ runTask()

void smtrat::ThreadPool::runTask ( Task task)
private
Parameters
task

Definition at line 17 of file ThreadPool.cpp.

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

◆ shallBeSkipped()

bool smtrat::ThreadPool::shallBeSkipped ( std::size_t  index)
inlineprivate

Definition at line 91 of file ThreadPool.h.

Here is the caller graph for this function:

◆ submitBackend()

void smtrat::ThreadPool::submitBackend ( Task task)
private
Parameters
task

Definition at line 44 of file ThreadPool.cpp.

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

Field Documentation

◆ mBackendSynchros

std::vector<BackendSynchronisation*> smtrat::ThreadPool::mBackendSynchros
private

Definition at line 83 of file ThreadPool.h.

◆ mBackendSynchrosMutex

std::mutex smtrat::ThreadPool::mBackendSynchrosMutex
private

Definition at line 81 of file ThreadPool.h.

◆ mCounter

std::atomic<std::size_t> smtrat::ThreadPool::mCounter
private

Initialized with 1: There is always the main thread in the beginning.

Definition at line 77 of file ThreadPool.h.

◆ mMaxThreads

const std::size_t smtrat::ThreadPool::mMaxThreads
private

Definition at line 75 of file ThreadPool.h.

◆ mNumberThreads

std::atomic<std::size_t> smtrat::ThreadPool::mNumberThreads
private

Initialized with 1: There is always the main thread in the beginning.

Definition at line 79 of file ThreadPool.h.

◆ mQueue

std::priority_queue<Task*> smtrat::ThreadPool::mQueue
private

Definition at line 89 of file ThreadPool.h.

◆ mQueueMutex

std::mutex smtrat::ThreadPool::mQueueMutex
private

Definition at line 85 of file ThreadPool.h.

◆ mThreadCreationMutex

std::mutex smtrat::ThreadPool::mThreadCreationMutex
private

Definition at line 87 of file ThreadPool.h.


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