What you want to do is called IPC (Inter-process communication - Wikipedia). I’d suggest one of the following two solutions:
-
You can take a look at named pipes (basic OS functionality). They are usually implemented as file descriptors which allow writing to one side and reading from the other side. There should be a way to do this asynchronous easily.
-
Another possibility may be to create a socket and transfer the data using TCP/UDP on the loopback interface 127.0.0.1.
I’d probably prefer the second one.