Week_5
Week_5
Landscape
(CS 526)
multi-core chip
Main memory
x=15213
35
The cache coherence
problem
Core 1 reads
x
Core 1 Core 2 Core 3 Core 4
multi-core chip
Main memory
x=15213
36
The cache coherence problem
Core 2 reads
x
Core 1 Core 2 Core 3 Core 4
multi-core chip
Main memory
x=15213
The cache coherence
problem
Core 1 writes to x, setting it to
21660
Core 1 Core 2 Core 3 Core 4
multi-core chip
Main memory
x= 15213
The cache coherence
problem
Core 3 attempts to read x… gets a stale
copy
Both caches
Core 1 Core 2 Core 3 Core 4 contain
inconsistent data.
Unpredictable
One or more One or more One or more One or more Behavior
levels of levels of levels of levels of
cache cache cache cache
x=21660 x=15213
multi-core chip
Cache Coherence Protocols
Has many solutions: Main memory
x=15213
The cache coherence problem
To address the cache coherence problem, various cache coherence
protocols have been developed.
Two common cache coherence protocols are :
1 1 0 1
switched,
or else robot can go unstable
- dedicate an entire core just to this thread
Flynn’s
Taxonomy
• Michael Flynn (from Stanford)
– Made a characterization of computer systems
which became known as Flynn’s Taxonomy
Comput
er
Instructio Dat
ns a
Multiple Processor Organization
Flynn’s Taxonomy:
1.Single Instruction, Single Data stream - SISD
2.Single Instruction, Multiple Data stream - SIMD
3.Multiple Instruction, Single Data stream - MISD
4.Multiple Instruction, Multiple Data stream- MIMD
1. Single Instruction, Single Data Stream – SISD
• Single processor
• Single instruction stream
• Data stored in single memory
• Example: Uni-processor Systems
SI SISD SD
2. Single Instruction, Multiple Data Stream - SIMD
SI SISD SD
SISD SD
3. Multiple Instruction, Single Data Stream - MISD
• Sequence of data
• Transmitted to set of processors
• Each processor executes different instruction
sequence, using same Data
• Few examples: Systolic array Processors
SI SISD
SI SISD SD
SI SISD
4. Multiple Instruction, Multiple Data Stream- MIMD
• Set of processors
• Simultaneously execute different instruction
sequences
• Different sets of data
• Examples: Multi-cores, SMPs, Clusters
SI SISD SD
SI SISD SD
SI SISD SD
MIMD - Overview
• General purpose processors
• Each can process all instructions necessary
• Further classified by method of processor
communication:
1. Via Shared Memory
2. Message Passing (Distributed Memory)
Taxonomy of Processor Architectures
Tightly Coupled -
SMP
• Processors share memory
• Communicate via that shared memory
• Executed in parallel
Definitions of Threads and
Processes
• Process:
– An instance of program running on computer
– A unit of resource ownership:
• virtual address space to hold process image
– Process switch
• Thread switch
– Switching processor between threads within same process
– Typically less costly than process switch
Implicit and Explicit
Multithreading
• All commercial processors use explicit
multithreading:
– Concurrently execute instructions from
different
explicit threads
– Interleave instructions from different threads on shared
pipelines OR parallel execution on parallel pipelines