Multi-producer multi-consumer queue with optional blocking
Summary: MPMCQueue<T> is a high-performance bounded concurrent queue that supports multiple producers, multiple consumers, and optional blocking. The queue has a fixed capacity, for which all memory will be allocated up front. The bulk of the work of enqueuing and dequeuing can be performed in parallel. To make an MPMCQueue<T>, T must satisfy either of two conditions: - it has been tagged FOLLY_ASSUME_FBVECTOR_COMPATIBLE; or - both the constructor used during enqueue and the move operator are marked noexcept. This diff extracts the generic component from tao/queues/ConcurrentQueue and renames identifiers to match those of existing folly queues. It also includes an extraction of Futex, which wraps the futex syscall, and DeterministicScheduler, which allows for deterministic exploration of thread interleavings for components built from std::atomic and Futex. Test Plan: new unit tests Reviewed By: tudorb@fb.com FB internal diff: D866566
Showing
folly/MPMCQueue.h
0 → 100644
This diff is collapsed.
folly/detail/Futex.h
0 → 100644
folly/test/FutexTest.cpp
0 → 100644
folly/test/MPMCQueueTest.cpp
0 → 100644
This diff is collapsed.
Please register or sign in to comment