Track 03 · Advanced · Free

C++ Advanced

Real-time, deterministic C++ for machines that must not miss a deadline.

Architecture and determinism: allocation-free control loops, lock-free messaging, deep template machinery and the discipline needed for code that drives actuators.

Prerequisite: C++ Intermediate, or working experience with RAII, move semantics and templates.

Start course

You will be able to

  • Write allocation-free, deterministic control loops
  • Design lock-free message paths between real-time threads
  • Apply advanced templates and compile-time computation
  • Instrument latency and prove timing budgets with data

Lesson outline

01

Real-time constraints

Determinism, jitter budgets, priority inversion, what to ban.

6hOpen lesson
02

Custom allocators & pools

Arena allocation, pmr, allocation-free steady state.

6hOpen lesson
03

Lock-free data structures

Memory order, SPSC queues, hazard-free designs.

7hOpen lesson
04

Template metaprogramming

constexpr, CRTP, tag dispatch, compile-time unit checks.

7hOpen lesson
05

Architecture & interfaces

Layered control stacks, dependency inversion, plugins.

6hOpen lesson
06

Sanitizers & static analysis

ASan, TSan, UBSan, clang-tidy in CI.

5hOpen lesson
07

Latency instrumentation

Tracing, histograms, deadline-miss detection.

6hOpen lesson
08

Capstone hardening

Review, fuzzing, failure injection, release readiness.

7hOpen lesson

Project examples

PRJ-07

1 kHz control loop

A PID joint controller with a hard 1 ms period, zero heap traffic and a measured jitter histogram.

void ControlLoop::tick(std::chrono::nanoseconds dt) noexcept {
  const auto err = target_ - state_.position;
  command_ = pid_.update(err, dt);  // no allocation, no locks
}
PRJ-08

Compile-time unit system

Strong types for radians, metres and newton-metres that make unit mistakes a compile error.

constexpr auto torque = 4.2_Nm;
constexpr auto angle  = 1.57_rad;
// static_assert: torque + angle does not compile
PRJ-09

Capstone: motion stack

A layered planner → interpolator → driver pipeline with sanitizers, tests and latency reporting in CI.

Planner planner{limits};
Interpolator interp{planner.plan(goal)};
Driver driver{interp, ControlLoop::Period{1ms}};

Free course

Begin when you are ready.

8 weeks · ~7h/week. Curriculum aligned with the ISO C++ reference material and verified September 2026.

ISO C++ resources
Continue to ROS 2 Lyrical Luth

Free enrollment · C++ Advanced

Start learning

Leave your details and we'll send the setup guide and first lesson.

Free · no payment details