5.4.Multicore and Other Shared Memory Multiprocessors

5.4.Multicore and Other Shared Memory Multiprocessors

1.Amdarl's Law

2.Multiprocessor design

  There are two kinds of multiprocessor designs: one is to provide a single physical address space that all processors can share, another is to have a separate address space per processor that requires that sharing must be explicit.

  A Shared memory multiprocessor(SMP) is one that offers the programmer a single physical address space across all processors:

  In this multiprocessor, Processors communicate through shared variables in memory, with all processors capable of accessing any memory location via loads and stores.

3.Multiprocessor operations

  Processors need to coordinate when operating on shared data, which is called synchronization. One way is to use a lock for a shared variable: Only one processor r at a time can acquire the lock, and other processors interested in shared data must wait until the original processor unlocks the variable.