I have process A which has some structure type data_t and a pointer to that struct data_t. I want process B to also have access to the instance of data_t created in process A. What is the best way to do this? I have tried using shared memory, but does it make sense to share a pointer between too processes when they have there own address space? I know I asked similar question before and I was to told to use opaque types. can anyone post a sample code for opaque type approach to this?
Also when process A links shared library called foo.so and process B also links foo.so, do process A and B all get a seperate copy of variables declared in foo.so?
Ultimately what I am trying to figure out is, I have a struct type in foo.so which process A initializes after linking, but when process B links to foo.so, process B does not see the process A initialized struct values.
Thanks for your input.