shmat() system call?

Christopher R Volpe volpe at underdog.crd.ge.com
Fri Aug 17 03:47:23 AEST 1990


In article <THOMAS.90Aug16123252 at uplog.uplog.se>, thomas at uplog.se
(Thomas Tornblom) writes:
|>
|>If you must have the same addresses between the processes (which is nice for
|>pointers and stuff) I'd pick some high constant address, say 0x[48c]0000000
|>or so that isn't likely to map onto anything on the architectures
you're using.
|>

I was working on a project with a couple of people last summer where we
had to use shared memory segments and processes had to exchange pointers.
We decided is just wasn't worth it to take chances on a hardcoded address
that might fail on any particular run because the kernel couldn't attach
the segment at the address specified. So we just did all the pointer
exchanging in terms of offsets from the base address of the segment
and let each individual process convert between offsets and virtual 
addresses.  It's a little tedious at most (like when you're sharing
linked lists), but the added flexibility and reliability is worth
the effort, IMHO.
                                    
==================
Chris Volpe
G.E. Corporate R&D
volpecr at crd.ge.com



More information about the Comp.unix.wizards mailing list