Nikolai

Nikolai

How to Introduce Unit-Tests in Your Project

Unit tests don’t have to be a “big rewrite.” This article shows a practical way to introduce unit tests into an existing C++ project: integrate GoogleTest with CMake/CTest, start with isolated code, scale with fixtures, and mock external dependencies without turning your codebase upside down.

std::mutex Isn’t Enough: 3 Rules for Using It Safely

Adding std::mutex does not automatically make C++ code thread-safe. This article breaks down three practical rules for using std::mutex safely: rely on RAII, keep synchronization boundaries explicit, and treat std::recursive_mutex as a design smell before treating it as a solution.

C++ Transactional Memory

Transactional memory looks like an elegant solution to concurrency problems — but in C++, it comes with serious trade-offs.

This article walks through GCC’s transactional memory implementation, explains how atomicity and rollback work in practice, and compares performance against mutex-based solutions. You’ll learn when transactional memory simplifies concurrent code — and when it makes things worse.