SPSC lock free queue without atomics
问题 I have below a SPSC queue for my logger. It is certainly not a general-use SPSC lock-free queue. However, given a bunch of assumptions around how it will be used, target architecture etc, and a number of acceptable tradeoffs, which I go into detail below, my questions is basically, is it safe / does it work? It will only be used on x86_64 architecture, so writes to uint16_t will be atomic. Only the producer updates the tail . Only the consumer updates the head . If the producer reads an old