Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good alternative to shared memory IPC for Java/C++ apps on Linux

I'm currently using shared memory for IPC between Java and C++ apps, but looking for a more convenient alternative.

Can someone advise a better method with same performance and speed?

Thanks!

like image 412
SyRenity Avatar asked May 24 '09 19:05

SyRenity


1 Answers

It depends on how you plan to have your apps interact. In the POSIX environment, you have pipes, shared memory, sockets, semaphores and message queues. See this question: Comparing unix linux IPC for more information.

What is the interaction model for your processes (i.e. client/server, producer-consumer, etc)?

From personal experience, I would suggest your best bet would be pipes (since they are just files to read and write bytes) or sockets (since both languages support them).

like image 112
mikelong Avatar answered Sep 18 '22 21:09

mikelong