Hacker News new | ask | show | jobs
by binarycoffee 1489 days ago
To be clear, as mentioned in another thread [0] there is no need to ensure consistency between head and tail for a SPSC so storing them in different cache lines would be much better.

For the multiple-consumer variant, however, consistency between head and tail is required so packing them in the same atomic is the simplest solution.

[0] https://news.ycombinator.com/item?id=31386741