Synchronization

 

 

 

 

 

Synchronization

 

 

Implementing Locks using Coherence

 

 

 

Implementing Locks using Coherence

Implementing Locks using Coherence

#

P0

P1

P2

Coherence state

Bus/directory activity

4

 

Waits while bus/directory busy

Lock = 0

Shared

Cache miss for P2 satisfied.

5

 

Lock=0

Executes swap, gets cache miss

Shared

Cache miss for P1 satisfied.

6

 

Executes swap, gets cache miss

Completes swap: returns 0 and sets Lock=1.

Exclusive

Bus/directory services P2 cache miss; generates invalidate.

7

 

Swap completes and returns 1

Enter critical section.

Shared

Bus/directory services P2 cache miss; generates writeback.

8

 

Spins, testing if lock=0.

 

 

None.

Implementing Locks using Coherence

 

 

Barrier synchronization

 

Barrier synchronization

 

Memory Consistency Models

 

 

 

 

 

The Future of Multiprocessors

 

 

 

 

 

The Future of Computer Architecture

 

 

 

The Future of Computer Architecture

 

 

 

 

 

The Future of Computer Architecture