template<
typename T,
typename AllocatorType = FMemory>
class TTransactionallySafeSpscQueue< T, AllocatorType >
Fast, transactionally-safe single-producer/single-consumer unbounded concurrent queue. Doesn't free memory until destruction but recycles consumed items. Based on TSpscQueue, which is itself based on http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue
The transactionally-safe queue uses a mutex to enforce thread safety instead of atomic operations. The difference in performance compared to a TSpscQueue should be negligible unless you are CPU-bound on constantly enqueueing and dequeueing objects as fast as possible.
It is not safe to spin-wait on Dequeue from within an AutoRTFM transaction! The other thread's Enqueue will be blocked on the mutex, so you will deadlock inside the spin-wait. This class works best with the game thread as the producer, and a separate helper thread as the consumer.