Can processes in two containers communicate with ipc::channel?
Closed this issue · 3 comments
I used ipc::channel in two docker containers, with flag "--ipc host". However, the communication failed with
fail condition broadcast[35]
fail condition broadcast[35]
...
fail condition broadcast[35]
fail: send, there is no receiver on this connection.
The two processes worked fine on the host, but fails to communicate inside containers. I checked /dev/shm, there are several __IPC_SHM__xxx existing.
I was wondering if the library is able to work across containers, or if I missed to mount some other volumes except for /dev/shm.
I found that if I change the implementation of conditional variable and mutex from linux syscall to posix, i.e., replace #include "libipc/platform/linux/mutex.h"
with #include "libipc/platform/posix/mutex.h"
, the library can then work on cross-container communication.
Is it safe to change the impl to posix on linux?
Yes, it's safe. The reason why the linux implementation is done separately is for efficiency reasons and for exception handling in some corner cases.
Got it! Thank you so much for your instant reply!