diff --git a/include/ParallelPriotityQueue/SpapQueueWorker.hpp b/include/ParallelPriotityQueue/SpapQueueWorker.hpp index 0dd0212..f6f7916 100644 --- a/include/ParallelPriotityQueue/SpapQueueWorker.hpp +++ b/include/ParallelPriotityQueue/SpapQueueWorker.hpp @@ -50,17 +50,17 @@ class WorkerResource { private: const std::array()> - channelIndices_; ///< Order of outgoing - ///< channels to push to. - std::array outBuffer_; ///< Small buffer before - ///< pushing to outgoing - ///< channel. + channelIndices_; ///< Order of outgoing + ///< channels to push to. + std::array outBuffer_; ///< Small buffer before + ///< pushing to outgoing + ///< channel. const std::size_t workerId_; ///< Worker Id in the global queue. std::size_t localCount_{0U}; ///< A partial account of the number of tasks in the global queue. GlobalQType &globalQueue_; ///< Reference to the global queue. - typename std::array::iterator - bufferPointer_; ///< Pointer to the next free spot in the outBuffer_. + std::size_t bufferHead_{0U}; ///< Head of out ring buffer. + std::size_t bufferTail_{0U}; ///< Tail of out ring buffer. typename std::array()>::const_iterator channelPointer_; ///< Pointer to the next outgoing channel. const typename std::array()>::const_iterator @@ -75,8 +75,7 @@ class WorkerResource { inline void decrGlobalCount() noexcept; [[nodiscard("Push may fail when channel is full.\n")]] inline bool pushOutBuffer() noexcept; - inline void pushOutBufferSelf( - const typename std::array::iterator fromPointer) noexcept; + inline void pushOutBufferSelf(const std::size_t numElements) noexcept; inline void enqueueInChannels() noexcept; virtual void processElement(const value_type val) noexcept = 0; @@ -121,7 +120,10 @@ class WorkerResource { * @see SpapQueue * @see WorkerResource */ -template