Question

To let a set of processes communicate, what are the advantages and disadvantages between:

  1. RAM-disk
  2. Boost interprocess communication

A RAM-disk allows to communicate with programs that only use files.

How big is the performance penalty of a RAM-disk due to the file system interface to be replicated?

Was it helpful?

Solution

It's a false dichotomy.

If you're sharing via

  • files on RAM-disk - you're still using memory-mapped files (implemented Boost Interprocess)
  • named pipes (FIFO's on a unix) you're still using IPC (because pipes or socketpairs are IPC primitives).

You can't /avoid/ IPC by using a RAM disk.

In fact, it sends alarm signals because it sounds like you're assuming it will somehow be "simpler" using a RAM disk. In practice, it's only simpler if you don't do proper locking. This is just a source of bugs, though.

OTHER TIPS

If you want to know the performance penalty, I think you could do some tests because I do not think your solution is common.

Anyway, if you want two processes to get communicated using some type of interprocess communication infrastructure, use the provided by boost, because it is designed to do what you want to do, it does not requires extra infrastructure and it is actually too portable across platforms.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top