In a shared-memory model, processes communicate through shared variables (sometimes more generally called shared resources).
Here, the read and write operations on the shared variable are each considered atomic. Note that there are other shared- memory models, e.g., where there is a set of shared variables:
and an (atomic) write is a simultaneous write to each variable. This model might be appropriate for modeling a replicated database or a multiprocessor with a main memory and local caches per processor. In either case, we might want an update to a single copy of the data to be effected on all copies at the same time (at least from the outside observer's viewpoint).
In a message-passing model, processes communicate through a message channel (sometimes called a message buffer).
Here, the send and receive operations are each considered atomic. Again, there are other message-passing models. For example, the multiple write operation in the second shared memory model above would be akin to an atomic broadcast primitive. More familiarly, we might consider the send and receive operations together to be atomic as in remote procedure call: P sends data to Q and blocks; Q receives and does some local computation; Q sends results to P; P receives the results.