TRT
Sign in

Expert · Module 13 · Lesson 5 of 6

Project: Allocator Plus Queue Versus STL

Run an honest A/B of a pool plus lock-free queue against a mutex-protected STL queue, interleaved with medians, across three thread shapes before declaring a winner.

Pro — members onlyAbout 12 minutes

By the end you can

  • Design an interleaved A/B harness that reports medians with context
  • Compare a pool plus lock-free queue against a mutex-protected STL queue across thread shapes
  • Decide when custom code ships and when STL remains the choice

Builds on Benchmarking: Clocks, Warmup and Honest Numbers.

01 · A question first

The pool reuses nodes and the queue avoids locks, each fast alone. Together against queue and allocator from the standard library, do they win at one producer and one consumer, at three producers, at eight by eight, and by what margin that repeats tomorrow?

Make a guess before you read on.

02 · The idea

Members only

Unlock the full lesson

This lesson is part of the membership. Join to read it in full, along with every other premium deep dive.

What's inside

  • Start with the problem
  • How the idea works
  • A taste test
  • Why it is correct
  • What it costs
  • Pitfalls and variations
  • Where it is used

03 · Practice

Something wrong with this lesson? Report a problem