qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches

Multiple-Producer Single-Consumer lockfree queue. More...

#include <chrono>
#include <mutex>
#include "spinlock.h"
#include "spsc.h"
Include dependency graph for mpsc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  qb::lockfree::mpsc::ringbuffer< T, max_size, nb_producer >
 Multi-Producer Single-Consumer ring buffer with fixed number of producers. More...
class  qb::lockfree::mpsc::ringbuffer< T, max_size, 0 >
 Multi-Producer Single-Consumer ring buffer with runtime-determined number of producers. More...

Typedefs

using qb::lockfree::mpsc::Clock = std::chrono::high_resolution_clock
 High-resolution clock type used for distribution of producer indexes.
using qb::lockfree::mpsc::Nanoseconds = std::chrono::nanoseconds
 Nanosecond duration type used for time measurements.

Detailed Description

Multiple-Producer Single-Consumer lockfree queue.

This file provides lockfree queue implementations that allow multiple producer threads to safely enqueue items while a single consumer thread dequeues them, all without using locks. These data structures are optimized for high-throughput concurrent systems where multiple threads need to communicate with a single processing thread.

Author
qb - C++ Actor Framework

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.