interprocess - Inter process communication -


What are the professional and cons of using file for Interprocess Communication? Give me some background in this context, I am asking this question.

The problem is the classical manufacturer consumer problem with some obstacles, manufacturers have a set of cooperative processes running on the cluster of machines and communicating with each other using broadcast. In each process, there are local users who are aware of this, along with other processes that are aware of them by the above diffusion mechanism. So far the information of the state is being broadcasted / shared, but now it is not being released.

This system is now running on the production of people supporting many thousands of users and people understand that the dependency in addition to adding support for any firmness is the path we have chosen in the current process. To create a new thread that writes local traffic in a file on the file system that is read from a new process (this is called consumer) from this point of view They are looking at the advantages they are:

  1. We get firmness for free if there are problems in the new process, then we are not losing any local traffic because we have it in the file system Writing. As long as the consumer knows where it came from, it can start processing data whenever it comes up.
  2. An analogy to use the queued libraries is not the old Unix file Io.
  3. The biggest support is that we do not affect the current manufacturer process, except for the new thread to write the file, at all.

There are some concerns from this approach:

  1. File locking and dispute and impact on its performance.
  2. Writing buffers are flavored and manufacturers only release file lock, once the full event is written in the file. The consumer should read incomplete records.

Thoughts? Is this approach simple and should we use the shelf continuous queue library to pay the initial cost only for ramps? The main point is that we want the minimum possible impact on the current process and do not want to add any dependencies for it.

I had recently encountered this choice and about its line of queue about Berkeley DB It was considered sufficient to learn to use. But in the end I have decided to use the Unix file system and using write your own atomic queue archive if all the processes are on one machine then it is very easy. There is a dozen line code about the nuclear putting function; Atoms are found, because the queue has to wait, it is about three times the size.

My advice is that you will hide an atom-queue API design (these classic examples of Parnas's advice to use the interface to hide details of the design Example.) You can do the first version of the API using plain UNIX file I / O. So you can try variations such as Locking, Berkeley DB, or Safafor - with "minimal impact on the current process".

Unless you try to do something, file locking on the real file system is very good; File locking on NFS is a bear.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -