tasklets.hpp
Go to the documentation of this file.
187 // thread execution will be stopped / no new tasklets will be started and the program will abort.
189 // Atomic operations tagged memory_order_relaxed are not synchronization operations; they do not
190 // impose an order among concurrent memory accesses. They guarantee atomicity and modification order
191 // consistency. This is the right choice for the setting here, since it is enough to broadcast failure
A simple tasklet that runs a function that returns void and does not take any arguments a given numbe... Definition: tasklets.hpp:71 FunctionRunnerTasklet(int numInvocations, const Fn &fn) Definition: tasklets.hpp:74 FunctionRunnerTasklet(const FunctionRunnerTasklet &)=default virtual void run()=0 int workerThreadIndex() const Returns the index of the current worker thread. bool failure() const static thread_local int workerThreadIndex_ Definition: tasklets.hpp:208 int numWorkerThreads() const Returns the number of worker threads for the tasklet runner. Definition: tasklets.hpp:157 static thread_local TaskletRunner * taskletRunner_ Definition: tasklets.hpp:207 std::condition_variable workAvailableCondition_ Definition: tasklets.hpp:205 void barrier() Make sure that all tasklets have been completed after this method has been called. std::shared_ptr< FunctionRunnerTasklet< Fn > > dispatchFunction(Fn &fn, int numInvocations=1) Convenience method to construct a new function runner tasklet and dispatch it immediately. Definition: tasklets.hpp:171 void dispatch(std::shared_ptr< TaskletInterface > tasklet) Add a new tasklet. TaskletRunner(unsigned numWorkers) Creates a tasklet runner with numWorkers underling threads for doing work. static void startWorkerThread_(TaskletRunner *taskletRunner, int workerThreadIndex) std::vector< std::unique_ptr< std::thread > > threads_ Definition: tasklets.hpp:202 TaskletRunner(const TaskletRunner &)=delete std::queue< std::shared_ptr< TaskletInterface > > taskletQueue_ Definition: tasklets.hpp:203 Definition: blackoilboundaryratevector.hh:39 |