Search code examples
c++linuxpointersubuntu-9.10

Is it possible to have a common pointer between 2 different programs on the same computer


I need 2 different programs to work on a single set of data. I have can set up a network (UDP) connection between them but I want to avoid the transfer of the whole data by any means.

It sounds a little absurd but is it possible to share some kind of pointer between these two programs so that when one updates it the other can simple get the pointer and start using it ??

I am using Ubuntu 9.10


Solution

  • You're talking about IPC - Interprocess Communication. There are many options.

    One is a memory-mapped file. It comes close to doing what you described. It may or may not be the optimal approach for your requirements, though. Read up on IPC to get some depth.