Shared Memory

When multiple processes cooperate, they often need to share tables of data. UNIX provides for this in the form of the shared memory facility. Figure 22.4 shows how one shared memory region can be shared by three processes.

Figure 22.4. A memory region shared with three processes.

Although the concept of sharing memory is a simple one, a number of complications can occur. For example, in Figure 22.4, the shared region may be attached to each process'memory space at a different memory address. This means that if memory addresses are used within the shared table, they will not be usable in all processes. Memory offsets must be used ...

Get Advanced UNIX Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.