Overview

When the CPU needs a single byte of data, it doesn't just fetch that byte; it fetches a whole 'line' of data (typically 64 bytes in modern x86 CPUs). This is based on the principle of spatial locality—the idea that if you need one piece of data, you'll likely need the data next to it soon.

Structure

A cache is organized as an array of cache lines. Each line contains the actual data plus a 'tag' that identifies which part of main memory the data came from.

False Sharing

A performance issue in multi-core systems where two cores modify different variables that happen to reside on the same cache line, causing unnecessary cache invalidations.

Related Terms