Pad the hot cache line

  • Fix
  • Metal 05
  • Chip

Difficulty 2 of 5

Two threads on two cores each count their own events: 1M increments each, in one stats struct. Alone, one thread finishes in 1 ms. Together they take 122 ms. Make both threads finish in under 1.5 ms with one change.

09:12 Event counter at 16M increments/s, expected 2,000M. Graph: both cores at 100 percent, one increment 122 ns.

Play level

HostCPU coreCPU coreL1 cacheL1 cacheL3 cache
The board at the start of the level
Where a read finds its dataDrag or use arrow keys to pick where the data lives

NVMe drive · 75 µs per read

Goals and limits

Completion time
under 1.5 ms
Monthly cost
under 1,000 USD/mo
Edit limit
1

Concepts

How players did

Player results load from the server.