Mankan <email@example.com> wrote:
Hi Qnx Gurus,
I have created a shared memory object between two process and
one process will write into the shared memory and other process will
read from the shared memory.
The issue I am facing is that when I am writing NEW data which is less than
the data written BEFORE in length, the part of the OLD data is also being
Well, of course it is still there.
Shared memory is just like any other memory access – if you don’t
overwrite it with new content, the old content is still there.
Of course, I’ll bet you’re dealing with strings, and what you’re
writing to the shared memory is strlen() of your new string, and
that does NOT write the ‘\0’ at the end of the new string, so
you’re actually written bad data to the shared memory, then read
it back thinking it would be a properly nul-terminated string.
QNX Training Services
Please followup in this newsgroup if you have further questions.