Data Shared Memory

Hi,

I have data shared memory which i am using as lookup space.I have key and its associated data which i am storing in DSM(data shared memory)In certain cases
when i am trying to retrieve the data the look up fails although there is a data in memory of that key.
I think this could be the issue due to the key size(in this it is 70 bytes).
Anyone face the similar issue can help me on this.
highly appreciate the help.

Thanks
Mind reading costs extra: Please post your code.
Thank you for your reply.
The code base is large and includes library code as well.So not possible to share the entire code.

You have to post something: Perhaps a small snippet of code could suffice?

Even pseudo code.

Somethin' ...
It's just a guess, but does your shared memory contain any pointers? There is usually no guarantee that the shared memory will be put at the same location in the memory space of the two processes. Thus you can't have any pointers in it. You have to use offsets instead.

@dhayden -- Yes from invocation to invocation; however, once you have the starting address, pointers could be used, no?
You said it's in shared memory, which means it's shared between processes, right? My point is that process A and process B might have the shared memory mapped to different addresses. You are correct that in one invocation of one process, the address won't move, but two different processes running at the same time could see the shared memory in different places.

This is all thanks to the magic of virtual memory.
Topic archived. No new replies allowed.