Point-to-point synch.
- Normally done in software with flags
P0: A = 1; flag = 1;
P1: while (!flag); print A;
- Some old machines supported full/empty bits in memory
- Each memory location is augmented with a full/empty bit
- Producer writes the location only if bit is reset
- Consumer reads location if bit is set and resets it
- Lot less flexible: one producer-one consumer sharing only (one producer-many consumers is very popular); all accesses to a memory location become synchronized (unless compiler flags some accesses as special)
- Possible optimization for shared memory
- Allocate flag and data structures (if small) guarded by flag in same cache line e.g., flag and A in above example