A single-producer, single-consumer (SPSC) queue is a ring buffer shared by exactly two threads: one only pushes, the other only pops. That restriction makes it possible without locks. Only the producer writes tail_ and only the consumer writes head_; each reads the other's counter to see whether there is room or data. With std::atomic counters and the right memory orders, a push or a pop is a few loads and stores.
The orders follow the message-passing pattern from the memory model lesson. The producer writes the slot, then stores tail_ with release; the consumer loads tail_ with acquire before reading the slot. In the other direction, the consumer stores head_ with release once it has read the slot, and the producer loads head_ with acquire before reusing it. Each thread reads its own counter with relaxed, because no other thread writes it.
As in the atomics unit, the tests run your queue on one thread to check its logic, and rules on your code check the memory orders. Running it on two real threads comes with the threads unit.
Each side owns one counter, publishes it with release, and acquires the other's.