logic: improved indexer parallelization

* added task that injects into PersistentStorage parallel to indexer tasks.
* added Blackboard for Task classes
This commit is contained in:
malte_langkabel
2016-09-12 11:52:14 +02:00
parent 1335f9512a
commit f06dd6abc5
42 changed files with 517 additions and 252 deletions
+26
View File
@@ -0,0 +1,26 @@
#ifndef STORAGE_PROVIDER_H
#define STORAGE_PROVIDER_H
#include <memory>
#include <mutex>
#include <list>
#include "data/IntermediateStorage.h"
class StorageProvider
{
public:
int getStorageCount() const;
void pushIndexerTarget(std::shared_ptr<IntermediateStorage> storage);
// always returns a usable storage
std::shared_ptr<IntermediateStorage> popIndexerTarget();
// returns empty shared_ptr if no storages available
std::shared_ptr<IntermediateStorage> popInjectionSource();
private:
std::list<std::shared_ptr<IntermediateStorage>> m_storages; // larger storages are in front
mutable std::mutex m_storagesMutex;
};
#endif // STORAGE_PROVIDER_H