Tools, Algorithms & Patterns

1. Correctness Tools

2. Performance Tools

3. Algorithms

3.1 The ABA Problem

CAS can fail to detect changes if the value changes from A to B and back to A (the "ABA problem"). Solutions include:

4. Patterns

RAII (Resource Acquisition Is Initialization): A programming idiom where resource management is tied to object lifetime. Resources are acquired in constructors and released in destructors, ensuring that resources are always properly released even if an exception is thrown. We can use consistent semantics when passing arguments:

RAII is also commonly used in locks ensuring they are always properly released.

Back to Home