I have 2 processes, and I would like one of the processes to talk to the other one with a high data throughput. I have tried IPC(boost::iterprocess specifically) and sockets but their performance/throughput is too slow to use.
My fallback option is to launch the 2nd process as an attached child of the first(load its dll, create the ‘tool’, etc), which has the best performance, as they are technically the same process at that point, and passing data is just calling the interface functions with the DLL.
I’m looking for ways to avoid doing it like this but still have that degree of performance. Is it possible to set up a DLL that 2 processes can load and somehow share memory space between? Are IPC and sockets the only options here?
What is “IPC” in your question? Sockets, pipes, shared memory are all ways to do IPC. And yes, you can use shared memory on Windows, Linux and other general-purpose systems. In C++ you can just declare a memory block as shared (at least on Windows) or you can call Memory Mapped File (MMF) functions. On Linux and BSD you use Memory Mapped File functions as well.
MMFs are the fastest possible way besides transforming a second process into the DLL. Named pipes and anything else is slower.