What is the most efficient interprocess exchange method for high throughput data stream on Mac?

I have a C ++ program (runs on MacOS / X) that generates a high throughput data stream (about 27 megabytes per second). The second C ++ program receives this data and processes it in (soft) real-time mode. Low latency and high reliability are for this purpose. Due to circumstances beyond my control, the two processes must be separate - that is, I cannot convert them into two threads in the same process.

I am currently using UDP packets (sent by process A to UDP port at 127.0.0.1, which process B handles) to implement this data transfer, and that more or less work (modulo a randomly falling packet), but I wonder, no Is there a more efficient / suitable mechanism for this use case. Will Unix pipe () be significantly more efficient or reliable? Or should I write data to the mmap () 'd shared memory area and use pipe / socket / semaphore / etc to synchronize the two read and write operations? Or is the UDP-over-the-loopback device already efficient enough to get a small benefit by switching to another method?

+4
source share
1 answer

, , , . , . "" , - , .

+3

All Articles