Multicore & Synchronization

Which is NOT a reason a parallel program fails to scale as cores are added?

  1. AFrequent synchronization between threads, such as lock waits
  2. BLarge imbalance in the amount of work per thread
  3. CEach thread reads and writes only its own private data
Show answer and explanation

Answer: C. Each thread reads and writes only its own private data

The main obstacles to parallel speedup include parts that cannot be parallelized (Amdahl's law), waits on locks and barriers, cache lines bouncing due to shared data or false sharing, load imbalance and insufficient memory bandwidth. If each thread works only on its own private data, there is little communication or waiting with other threads, which approaches ideal parallel scaling. Even private data, however, causes false sharing if it sits in the same cache line, and scaling also stops when memory bandwidth runs short.

  • A. Synchronization waits are a classic scaling limit.
  • B. Imbalance creates time spent waiting for slow threads.
  • C. Correct. With no synchronization or sharing, it is unlikely to limit scaling. However, private data placed in the same cache line still causes false sharing.