Assume I use a C++ program to maintain a queue in Linux, and do some things with the data in the queue, and now I want to run it in the background and provide a function, therefore other programs could simply call it to pull a data into my queue.
What’s the best way to do this?
Assume I use a C++ program to maintain a queue in Linux, and do
Share
If your programs are running as two separate processes, You cannot just call functions in other process directly, you will need a Interprocess communication Mechanism(IPC) to communicate between the two processes.
Usually, this is done as follows:
The process which you want to communicate to provides a client side library, The process or application which wants to communicate with the process links to this client side library. This client side library provides simple function calls which your calling process/application can call directly. The client side library implements the necessary IPC mechanism to communicate with the remote process.