Labs ICT
โญ Pro Login

Multi-Core Processors

Modern multi-core CPU design and programming

Multi-Core Processors

Instead of making one processor faster (which has physical limits), why not put multiple processors on one chip? That's exactly what multi-core processors do! This is how modern CPUs achieve better performance.

Multi-Core Architecture


    Multi-Core Processor
    +---------------------------------------------+
    |                                             |
    |  +------+------+  +------+------+          |
    |  | Core 0 | Core 1 |          |
    |  |+------+|+------+|          |
    |  || L1   || L1   ||          |
    |  ||Cache ||Cache ||          |
    |  |+------+|+------+|          |
    |  |  |       |  |       |          |
    |  +--+-------+--+-------+          |
    |     |       |                      |
    |     v       v                      |
    |  +-------------------+            |
    |  |    Shared L2/L3   |            |
    |  |      Cache        |            |
    |  +-------------------+            |
    |           |                        |
    |           v                        |
    |  +-------------------+            |
    |  |   Memory          |            |
    |  |   Controller      |            |
    |  +-------------------+            |
    +---------------------------------------------+

Benefits of Multi-Core

  • Higher Throughput: More work done in parallel
  • Better Power Efficiency: Two slow cores use less power than one fast core
  • Thread Parallelism: Run multiple threads simultaneously
  • Specialization: Different cores can handle different tasks

Multi-Core Design Choices


    Homogeneous vs Heterogeneous
    +---------------------------------------------+
    |                                             |
    |  Homogeneous (e.g., Intel Core i7):       |
    |  All cores are identical                   |
    |  [Core0] [Core1] [Core2] [Core3]          |
    |    |       |       |       |              |
    |    v       v       v       v              |
    |  Same architecture, same capabilities      |
    |                                             |
    |  Heterogeneous (e.g., ARM big.LITTLE):    |
    |  Cores have different capabilities         |
    |  [Big Core] [Big Core] [Little] [Little]  |
    |    |           |         |         |       |
    |    v           v         v         v       |
    |  High performance  Low power/efficiency   |
    +---------------------------------------------+

Cache Coherence

When multiple cores share data, how do we keep their caches consistent? Cache coherence protocols ensure all cores see the same memory values:

  • MSI Protocol: Modified, Shared, Invalid states
  • MESI Protocol: Adds Exclusive state for optimization
  • MOESI Protocol: Adds Owned state for dirty sharing

These protocols use bus snooping or directory-based approaches to maintain consistency.

Programming for Multi-Core

To benefit from multi-core processors, software must be written to use parallelism:

  • Multi-threading: Split work into threads that run on different cores
  • Parallel Libraries: Use OpenMP, TBB, or similar frameworks
  • Async Programming: Languages like Go, Rust, or Erlang make concurrency easier

Without parallel programming, a quad-core CPU might only use one core!

๐Ÿงช Quick Quiz

What is the main advantage of a multi-core processor?