Building a Fast Lock-Free Queue in Modern C++ from Scratch

Why do standard mutex-based queues feel very slow under extreme contention? Lets take a deep dive into the chaotic world of lock-free programming, Hazard Pointers, cache-line optimizations, and C++20 concepts to build a Multi-Producer Multi-Consumer queue that scales to dozens of threads without choking on the OS scheduler.
78 points by ibobev 91 days ago blog.jaysmito.dev 34 comments

Summary

Learn how to create a high-performance, lock-free queue in C++ that can handle multiple threads efficiently, addressing the limitations of traditional mutex-based queues. The article covers advanced programming techniques including Hazard Pointers and cache-line optimizations to enhance scalability.

Comments (34 of ) ⌛

Loading more comments... ⌛
Scroll down to load more comments
No comments available.
Type to search HN and engineering blog articles
Press Escape to close  |  ↑↓ to navigate  |  Enter to open