Multiprocessors I
Multiprocessors I
Multiprocessor System
Content
● Introduction to Multiprocessors
● Historical Context
● Difference MIMD and MDSI
● Multiprocessor - 1
● Flynn Classification
● Memory Consistency
● Sequential Consistency
● Relaxed Memory Models
● Thread & Multithread
● Superpipeline & Superscalar
● Multithreading & Superscalar
● Conclusion
2
1
Introduction to Multiprocessors
Definition
Significance
Symmetric Multiprocessing
● Processing done by multiple processors that share a
common OS and memory.
● The processors share the same input/output (I/O) bus or
data path.
● This shared memory architecture is fundamental to the
operation of SMP systems and is typically implemented
using various techniques: Physical Memory, System bus
arbitration
4
2
Working of Multiprocessor
Flynn Classification
Flynn Classification
6
3
Difference
Multiprocessor - 1
Synchronization
● A spin lock is a synchronization technique used in concurrent programming. When a thread wants to
access a shared resource protected by a spin lock and finds it already locked, instead of waiting, it
repeatedly checks the lock in a loop until it becomes available.
8
4
Multiprocessor - 1
Barrier
● A synchronization construct used in concurrent programming to ensure that a group of threads or
processes reach a designated point (the barrier) in their execution before any of them are allowed to
proceed further
10
5
Relaxed Memory Models
Why do we need Relaxed Consistency ?
- To keep hardware simple and performance high, relax the ordering requirements
- Relaxed Memory Models
11
12
6
Local Ordering: No Relaxing (SC)
- All prior LOADs and prior STORES must be performed ->
LOAD is performed
- All prior LOADs and previous STORE must be performed ->
STORE is performed
13
14
7
Local Ordering: Relaxing W→W & R→RW
- In Processor Consistency and TSO, W→W and R→R are still enforced
- Enforcing R→R order strictly (i.e., reads executed in the order issued)
- Strict enforcement of Write-to-Write order
15
16
8
Memory Model: Weak Ordering
17
18
9
Instruction Level Parallelism - ILP
Definition
● Used to refer to the architecture in which multiple operations can be performed parallelly in a particular process,
with its own set of resources – address space, registers, identifiers, state, and program counters.\
● It refers to the compiler design techniques and processors designed to execute operations, like memory load and
store, integer addition, and float multiplication, in parallel to improve the performance of the processors.
Example
1. y1 = x1*1010
2. y2 = x2*1100
3. z1 = y1+0010
4. z2 = y2+0101
5. t1 = t1+1
6. p = q*1000
7. clr = clr+0010
8. r = r+0001
19
20
10
Instruction Level Parallelism - ILP
21
Motivation:
● A single thread leaves a processor underutilized
● By doubling processor area, single thread performance barely improves
-> Multiple threads share the same large processor, leading to reduces underutilization, efficient resource
allocation.
Multithreading: Multiple thread to share the functional units of one processor via overlapping by duplicating
independent state of each thread e.g., a separate copy of register file or a separate PC. Memory shared through the virtual
memory mechanisms, which already support multiple processes. Hardware for fast thread switch which is much faster
than full process switch
22
11
Thread Level Parallelism -TLP
Fine-Grained Multithreading:
● Switch between threads on each instruction, causing the
execution of multiples threads to be interleaved
● Usually done in a round-robin fashion, skipping any stalled
threads
23
24
12
Multithreading vs Superscalar
25
13