
330 CHAPTER 5 Shared Memory Multiprocessors
EXAMPLE 5.12 Consider the following two program reference patterns:
Pattern 1: Repeat k times; processor
1
writes a new value into variable Vand
processors 2 through P read the value of K This represents a one-producer-
many-consumer scenario that may arise, for example, when processors are
accessing a highly contended flag for one-to-many event synchronization.
Pattern 2: Repeat k times; processor 1 writes M times to variable \/and then
processor 2 reads the value of V. This represents a sharing pattern that may
occur between pairs of processors, where the first successfully computes and
accumulate ...