Open In App
Related Articles

Message based Communication in IPC (inter process communication)

Like Article
Save Article
Report issue

Prerequisites – Cloud computing, Load balancing in Cloud Computing, Inter-process Communication In the development of models and technologies, message abstraction is a necessary aspect that enables distributed computing. Distributed system is defined as a system in which components reside at networked communication and synchronise its functions only by movement of messages. In this, message recognizes any discrete data that is moved from one entity to another. It includes any kind of data representation having restriction of size and time, whereas it invokes a remote procedure or a sequence of object instance or a common message. This is the reason that “message-based communication model” can be beneficial to refer various model for inter-process communication, which is based on the data streaming abstraction. Various distributed programming model use this type of communication despite of the abstraction which is shown to developers for programming the co-ordination of shared components. Below are some major distributed programming models that uses “message-based communication model”.

  • Message Passing – In this model, the concept of message as the major abstraction of model is introduced. The units which inter-change the data and information that is explicitly encode, in the form of message. According to then model, the schema and content of message changes or varies. Message Passing Interface and OpenMP are major example of this type of model.
  • Remote Procedure Call This model explores the keys of procedure call beyond the restrictions of a single process, thus pointing the execution of program in remote processes. In this, primary client-server is implied. A remote process maintains a server component, thus enabling client processes to invoke the approaches and returns the output of the execution. Messages, created by the Remote Procedure Call (RPC) implementation, retrieve the information of the procedure itself and that procedure is to execute having necessary arguments and also returns the values. The use of messages regarding this referred as marshal-ling of the arguments and return values.
  • Distributed Objects – It is an implementation of Remote Procedure Call (RPC) model for the Object-oriented model, and contextualizes this for the remote invocation of methods extended by objects. Every process assigns a set of interfaces which are accessible remotely. Client process can demand a reference to these interfaces and invoke the methods available through them. The basic runtime infrastructure is in transformation the local method calls into a request to a remote process and collecting the result of the execution. The interaction within the caller and the remote process is done trough messages. This model is stateless by design, distributed object models introduce the complexity of object state management and lifetime. Common Object Request Broker Architecture (CORBA), Component Object Model (COM, DCOM and COM+), Java Remote Method Invocation (RMI), and .NET Remoting are some major examples which falls under Distributed object infrastructure.
  • Active objects – Programming models based on active objects comprise by definition the presence of instances, whether they are agent of objects, despite the availability of requests. It means, that objects having particular control thread, which enables them to convey their activity. These models sometime make manual use of messages to encounter the execution of functions and a more complex and a more complex semantics is attached to the messages.
  • Web Services – Web service technology delivers an approach of the RPC concept over the HTTP, thus enabling the communication of components that are evolved with numerous technologies. A web service is revealed as a remote object maintained on a Web server, and method invocations are transformed in HTTP requests wrapped with the help of specific protocol. It is necessary to observe that the concept of message is a basic abstraction of inter-process communication and it is utilized either implicitly or explicitly.

Message-based communication is a type of IPC (Inter-Process Communication) mechanism in which processes or threads communicate with each other by sending messages. In this approach, a process sends a message to another process using a message queue, and the receiving process reads the message from the queue. Message-based communication has several advantages and disadvantages, which are outlined below:

Advantages of message-based communication:

  1. Simplicity: Message-based communication is a simple and straightforward approach to IPC, as messages can be easily sent and received between processes.
    Asynchronous communication: Message-based communication allows for asynchronous communication, as the sender and receiver do not have to be active at the same time.
    Reliability: Message-based communication can ensure reliable delivery of messages, as messages can be re-sent until they are received by the receiver.
    Scalability: Message-based communication can be used to implement large-scale distributed systems, as messages can be routed between multiple computers or networks.

Disadvantages of message-based communication:

  1. Overhead: Message-based communication can introduce overhead, as the creation and management of message queues can consume system resources.
  2. Complexity: Implementing message-based communication requires careful design and management of message queues, which can be complex and time-consuming.
  3. Latency: Message-based communication can introduce latency, as messages may have to wait in the queue until they are received by the receiver.
  4. Limited data size: Message-based communication is typically limited in the size of data that can be sent in a message, which can be a disadvantage for some types of applications.
    Overall, message-based communication is a useful mechanism for IPC that can be used to implement a wide variety of distributed systems. However, it is important to carefully consider the advantages and disadvantages of message-based communication, and to design and implement message queues with care, in order to ensure that the system performs well and meets the needs of the application.

Last Updated : 24 Mar, 2023
Like Article
Save Article
Share your thoughts in the comments
Similar Reads