문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top