logic: multithreaded parsing

* modified the TaskParseCxx to be able to run multiple times in parallel
* made FileRegister threadsafe and changed a lot of its mechanisms
* added TaskGroupParallel that runs all children in parallel
* added TaskParseWrapper that acts as a decorator to execute some code before and after parsing.
* implemented task setup in project with 4 parsing threads
* removed SimpleTask as it was only used as interface for the LambdaTask
This commit is contained in:
malte_langkabel
2016-05-13 13:23:54 +02:00
parent 245cafdc7b
commit c61efbbcde
27 changed files with 535 additions and 317 deletions
@@ -0,0 +1,30 @@
#ifndef TASK_GROUP_PARALLEL_H
#define TASK_GROUP_PARALLEL_H
#include "utility/scheduling/TaskGroup.h"
#include <mutex>
class TaskGroupParallel
: public TaskGroup
{
public:
TaskGroupParallel();
virtual ~TaskGroupParallel();
virtual void enter();
virtual TaskState update();
virtual void exit();
virtual void interrupt();
virtual void revert();
private:
void processTask(std::shared_ptr<Task> task);
volatile bool m_interrupt;
bool m_running;
volatile int m_activeTaskCount;
std::mutex m_activeTaskCountMutex;
};
#endif // TASK_GROUP_PARALLEL_H