Accessing an Object From Another Process

On modern operating systems, a process consists of an executable file that the OS loads into the system’s memory and executes. A process normally has an entry point and one or more exit points. The OS allocates a distinct heap, address space, and process id for every running process. An application can have one or more processes running together. For example, a Web browser may invoke an HTML editor and an email client as separate processes. This process model is very similar to a C/C++ program, whereby main() is the entry point and the main thread of execution. It’s important to note that given this process model, distinct programs can’t access each other’s data and code. For example, trying to pass an address of an object from one process to another is likely to cause a runtime crash because the object’s address is valid only within its process’s address space. To be able to access an object from a different process, you have to use one of the interprocess communication mechanisms supported by your OS, such as shared memory, sockets, and pipes.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: