Classes |
Public Member Functions |
Protected Member Functions |
Static Protected Member Functions |
Protected Attributes |
List of all members
Opm::TaskletRunner Class Reference Handles where a given tasklet is run. More...
Detailed DescriptionHandles where a given tasklet is run. Depending on the number of worker threads, a tasklet can either be run in a separate worker thread or by the main thread. Constructor & Destructor Documentation◆ TaskletRunner() [1/2]
◆ TaskletRunner() [2/2]
Creates a tasklet runner with numWorkers underling threads for doing work. The number of worker threads may be 0. In this case, all work is done by the main thread (synchronous mode). References Opm::Parameters::reset(), startWorkerThread_(), and threads_. ◆ ~TaskletRunner()
Destructor. If worker threads were created to run the tasklets, this method waits until all worker threads have been terminated, i.e. all scheduled tasklets are guaranteed to be completed. References dispatch(), and threads_. Member Function Documentation◆ barrier()
Make sure that all tasklets have been completed after this method has been called. References dispatch(), and threads_. Referenced by Opm::VtkMultiWriter< GridView, vtkFormat >::beginWrite(), and Opm::VtkMultiWriter< GridView, vtkFormat >::~VtkMultiWriter(). ◆ dispatch()
Add a new tasklet. The tasklet is either run immediately or deferred to a separate thread. References taskletQueue_, taskletQueueMutex_, threads_, and workAvailableCondition_. Referenced by barrier(), dispatchFunction(), Opm::VtkMultiWriter< GridView, vtkFormat >::endWrite(), and ~TaskletRunner(). ◆ dispatchFunction()
template<class Fn >
Convenience method to construct a new function runner tasklet and dispatch it immediately. References dispatch(). ◆ failure()
◆ numWorkerThreads()
Returns the number of worker threads for the tasklet runner. References threads_. ◆ run_()
do the work until the queue received an end tasklet References taskletQueue_, taskletQueueMutex_, and workAvailableCondition_. Referenced by startWorkerThread_(). ◆ startWorkerThread_()
References run_(), and workerThreadIndex(). Referenced by TaskletRunner(). ◆ workerThreadIndex()
Returns the index of the current worker thread. If the current thread is not a worker thread, -1 is returned. Referenced by startWorkerThread_(). Member Data Documentation◆ taskletQueue_
Referenced by dispatch(), and run_(). ◆ taskletQueueMutex_
Referenced by dispatch(), and run_(). ◆ threads_
Referenced by barrier(), dispatch(), numWorkerThreads(), TaskletRunner(), and ~TaskletRunner(). ◆ workAvailableCondition_
Referenced by dispatch(), and run_(). The documentation for this class was generated from the following file: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||