votca 2024.2-dev
|
Framework for threaded execution. More...
#include <thread.h>
Public Member Functions | |
Thread () | |
virtual | ~Thread () |
void | Start () |
Starts and runs a thread. | |
void | WaitDone () |
WaitDone() will not exit until thread ends computation. | |
bool | IsFinished () const |
Checks to see if the thread is done. | |
Protected Member Functions | |
virtual void | Run (void)=0 |
Run() executes the actual code. | |
Private Attributes | |
pthread_attr_t | attr_ |
pthread_t | thread_ |
bool | finished_ |
Friends | |
void * | runwrapper (void *arg) |
Framework for threaded execution.
The Thread class handles the threaded execution of VOTCA code. In its current state, it is based on POSIX threads. It mainly contains a wrapper, a start and a wait function. This class should not be touched by the user.
|
default |
|
virtualdefault |
bool votca::tools::Thread::IsFinished | ( | ) | const |
|
protectedpure virtual |
Run() executes the actual code.
It is left blank here and must be overloaded, for the thread to do any work. This method should never be called by the user, it is called internally by the Start method.
Implemented in votca::csg::CsgApplication::Worker, votca::xtp::ParallelXJobCalc< JobContainer >::JobOperator, and votca::xtp::QMThread.
void votca::tools::Thread::Start | ( | ) |
void votca::tools::Thread::WaitDone | ( | ) |
WaitDone() will not exit until thread ends computation.