tasklets.hpp
Go to the documentation of this file.
184 // thread execution will be stopped / no new tasklets will be started and the program will abort.
186 // Atomic operations tagged memory_order_relaxed are not synchronization operations; they do not
187 // impose an order among concurrent memory accesses. They guarantee atomicity and modification order
188 // 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:69 FunctionRunnerTasklet(int numInvocations, const Fn &fn) Definition: tasklets.hpp:72 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:205 int numWorkerThreads() const Returns the number of worker threads for the tasklet runner. Definition: tasklets.hpp:154 static thread_local TaskletRunner * taskletRunner_ Definition: tasklets.hpp:204 std::condition_variable workAvailableCondition_ Definition: tasklets.hpp:202 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:168 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:199 TaskletRunner(const TaskletRunner &)=delete std::queue< std::shared_ptr< TaskletInterface > > taskletQueue_ Definition: tasklets.hpp:200 Definition: blackoilboundaryratevector.hh:37 |