Shared memory (SHM) is another method of interprocess communication (IPC) whereby 2 or more processes share a single chunk of memory to communicate. The shared memory system can also be used to set permissions on memory, allowing for things like malloc debuggers to be written.
Basically there are two different types of shared memory available for most flavors of UNIX. As you may have guessed, each of the two orignal ancestors of modern UNIX have their own implementation, altough almost all modern UNIX flavors implement both. The names of the respective implementations are System V IPC, and BSD mmap.
Basically using shared memory under both systems will involve the following:
Each implementation has a method establishing a system wide unique name for each segment so that other applications may access it. Both also have methods of procuring private (or "anonymous") segments.
Both implementations allow you to specify access using the traditional read/write/execute scheme.
Dealing with race conditions varies under each system. What they do have in common is that race conditions do occurr in each :)