73 void startQueue(int32_t index,
bool waitWhenFull, uint32_t processingThreadCount, int32_t threadPriority = 0, int32_t threadPolicy = SCHED_OTHER);
83 void startQueue(int32_t index,
bool waitWhenFull, uint32_t initialProcessingThreadCount, uint32_t maxProcessingThreadCount);
90 void stopQueue(int32_t index);
95 bool queueIsStarted(int32_t index);
103 bool addThread(int32_t index);
113 bool enqueue(int32_t index, std::shared_ptr<IQueueEntry> &entry,
bool waitWhenFull =
false);
121 virtual void processQueueEntry(int32_t index, std::shared_ptr<IQueueEntry> &entry) = 0;
129 bool queueEmpty(int32_t index);
136 uint32_t processingThreadCount(int32_t index);
143 uint32_t maxProcessingThreadCount(int32_t index);
151 int32_t queueSize(int32_t index);
153 double threadLoad(int32_t index);
154 double maxThreadLoad(int32_t index);
155 double maxThreadLoad1m(int32_t index);
156 double maxThreadLoad10m(int32_t index);
157 double maxThreadLoad1h(int32_t index);
158 int64_t maxWait(int32_t index);
159 int64_t maxWait1m(int32_t index);
160 int64_t maxWait10m(int32_t index);
161 int64_t maxWait1h(int32_t index);
163 std::mutex _addThreadMutex;
164 int32_t _bufferSize = 10000;
165 std::vector<int32_t> _bufferHead;
166 std::vector<int32_t> _bufferTail;
167 std::vector<int32_t> _bufferCount;
168 std::vector<bool> _waitWhenFull;
169 std::vector<std::vector<std::shared_ptr<IQueueEntry>>> _buffer;
170 std::unique_ptr<std::mutex[]> _queueMutex =
nullptr;
171 std::vector<std::vector<std::shared_ptr<std::thread>>> _processingThread;
172 std::unique_ptr<std::condition_variable[]> _produceConditionVariable =
nullptr;
173 std::unique_ptr<std::condition_variable[]> _processingConditionVariable =
nullptr;
175 std::unique_ptr<std::atomic<uint32_t>[]> _threadsInUse;
177 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad1mCurrent;
178 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad1m;
179 std::unique_ptr<std::atomic<int64_t>[]> _maxWait1mCurrent;
180 std::unique_ptr<std::atomic<int64_t>[]> _maxWait1m;
181 std::unique_ptr<std::atomic<int64_t>[]> _last1mCycle;
183 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad10mCurrent;
184 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad10m;
185 std::unique_ptr<std::atomic<int64_t>[]> _maxWait10mCurrent;
186 std::unique_ptr<std::atomic<int64_t>[]> _maxWait10m;
187 std::unique_ptr<std::atomic<int64_t>[]> _last10mCycle;
189 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad1hCurrent;
190 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad1h;
191 std::unique_ptr<std::atomic<int64_t>[]> _maxWait1hCurrent;
192 std::unique_ptr<std::atomic<int64_t>[]> _maxWait1h;
193 std::unique_ptr<std::atomic<int64_t>[]> _last1hCycle;
195 std::unique_ptr<std::atomic<double>[]> _maxThreadLoad;
196 std::unique_ptr<std::atomic<int64_t>[]> _maxWait;
198 void process(int32_t index);
This is the base library main class.
Definition: BaseLib.h:95
Definition: IQueueBase.h:45
Definition: BaseLib.cpp:34
virtual ~IQueueEntry()=default
This class implements a queue after the producer-consumer paradigm.
Definition: IQueue.h:52
int64_t time
Definition: IQueue.h:46