Search code examples
c++boostinterprocessboost-interprocessramdisk

RAM-disk vs Boost interprocess communication


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?


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.