The Runtime Theory
mediumHardwareInternals#memory-dependency#locality

Why Does a Cache Miss Stall Some Instructions?

A hardware prompt about dependent loads, cache-line fills, out-of-order execution, locality, and measurable program behavior.

TRT practice prompt — not a verified question from a named employer.

The Runtime Theory Team1 min read

A strong answer

A load checks the relevant cache levels after address translation. If the requested line is missing, the processor requests it from a lower level or memory system. Instructions that depend on the loaded value cannot complete until it arrives, but independent instructions may execute meanwhile if the processor can find useful work and resources are available.

Out-of-order execution and speculation can hide some latency; they cannot make an unknown dependent address available early. A pointer chain often has this dependency: each load reveals the address of the next. A sequential scan exposes predictable neighboring addresses and can use cache-line data efficiently.

The requested line may come from a lower cache or a coherent copy in another core, not necessarily directly from DRAM. Exact lookup order, line size, replacement, and latency depend on the processor. I would use hardware counters or a controlled benchmark to test a claim on the target machine.

Follow-up direction

Describe spatial and temporal locality, then explain why replacing a branch with extra memory operations is not automatically an optimization.

This answer walks

Practice follow-ups

  1. 01Why can independent instructions continue while a load waits?
  2. 02How does a pointer chain differ from a sequential scan?
  3. 03Can another core supply a cache line?

One dispatch a week

The trace behind each question, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save