[TriLUG] anybody use pointers and shared memory?

John F Davis johndavi at us.ibm.com
Wed May 15 15:30:08 EDT 2002


Hello

I know how to use shared memory between processes via shmget and shmat, but
I'm not an expert on their use.  (I've used it for simple flat structures.)
Anybody have any experience using them with something similar to malloc'd
pointers?  For instance, if I want to dynamically allocate data that is
shared, do I have to use shmget/shmat in lieu of malloc?

Yes, I realize each process has their own heap so malloced pointers shared
between process's are meaningless, but is their some simple technique for
dynamic  shared memory?

I realize I'm not very clear on this.  Its easier to describe the problem
more concisely with code, but I don't have any code written at this point
because I am just thinking out loud.
JD




More information about the TriLUG mailing list