Pointers in Shared Memory

Clifford C. Skolnick cliffs at gaffa.East.Sun.COM
Thu Apr 18 04:26:25 AEST 1991


In article <2417 at taurus.BITNET> <flibedin%math.tau.ac.il at TAUNIVM.TAU.AC.IL> writes:
>I have some doubts concerning the use of pointers inside shared memory
>obtained with SysV IPC functions.
>
>However, it is possible to store pointers INSIDE the shared memory,
>and also to another shared memory segment.

Careful here too.  Store the pointers as offsetts from the address where
teh segment is attached.  This will allow a different process who has not
attached the segment at the same address (by choice, or just can't do it) to
still use the data.  You will experience a slight performance hit, but a slow
working program is better than a fast one that does not work.
--
Cliff Skolnick | "When routine life's hard, and inhibitions are low, and
cliffs at sun.com | resentment lies hide, but emotions run through, and we're
(716) 385-5049 | changing our ways, taking different roads.  Love, love
I think. I am. | will tear us apart, again." -- Joy Division



More information about the Comp.unix.wizards mailing list