Intro to C++ Programming
References
This lesson introduces references, explaining how they work, their benefits, and their role in performance and data manipulation
Practical DSA
Queues and Stacks
Learn how to decouple producers and consumers using FIFO and LIFO buffering structures.
Practical DSA
MPMC Ring Buffers
Build a Multi-Producer Multi-Consumer lock-free queue using CAS loops, Sequence Tickets, and memory ordering.
Practical DSA
Lock-Free Object Pools
Build a highly concurrent, lock-free object pool and defeat the ABA problem using generation tags.
Practical DSA
Lock-Free Stacks
Build a highly concurrent Treiber stack using atomic Compare-And-Swap (CAS) instructions.
Practical DSA
Locks and Atomics
Learn how mutexes and atomics prevent race conditions, and why hardware contention can make multithreaded code slower than single-threaded code.
Practical DSA
Cache Coherency and False Sharing
Explore the performance cost of synchronization, how to mitigate it, and how to avoid it entirely with better algorithm design.
Practical DSA
Data Tearing and std::atomic
Understand the physical reality of moving data between RAM and registers. Learn why explicit loads and stores are required to prevent data tearing in complex structs.
Practical DSA
Compare-And-Swap (CAS)
Learn how to perform complex lock-free atomic updates using compare_exchange_weak() and the hardware limitations.
Practical DSA
Instruction Reordering
Learn how CPU out-of-order execution breaks lock-free code, and how to use seq_cst, acquire, release, acq_rel, and relaxed to fix it.
Practical DSA
Lock-Free Pointers
Discover why using CAS on pointers is a hardware minefield, exposing the physical realities of memory allocators and the infamous ABA problem.