Message passing and shared memory are two techniques parallel programs
use for coordination and communication. This paper studies the streng
ths and weaknesses of these two mechanisms by comparing equivalent, we
ll-written message-passing and shared-memory programs running on simil
ar hardware. To ensure that our measurements are comparable, we produc
ed two carefully tuned versions of each program and measured them on c
losely-related simulators of a message-passing and a shared-memory mac
hine, both of which are based on same underlying hardware assumptions.
We examined the behavior and performance of each program carefully. A
lthough the cost of computation in each pair of programs was similar,
synchronization and communication differed greatly. We found that mess
age-passing's advantage over shared-memory is not clear-cut. Three of
the four shared-memory programs ran at roughly the same speed as their
message-passing equivalent, even though their communication patterns
were different.