 Hello everyone. As we already started discussion about inter-process communication in last video, today we are going to learn more about inter-process communication. The learning outcome of this session are at the end of this session student will be able to explore inter-process communication using message passing and interpret the synchronization between cooperating processes. Now recall from last video that we studied shared memory using common buffer pool, which is one of the method for inter-process communication. We studied producer-consumer problem using shared memory. Another way of inter-process communication is message passing. The message passing uses two primitives that is send message and receive message. Using these two primitives, two processes can communicate with each other by sending message with each other. There must exist communication link between the process to send and receive a message. One of the example of inter-process communication that we studied is direct communication. In under direct communication, the processes which wish to communicate with each other must name the recipient and the sender, means indirect communication of message passing system sender and receiver must know each other. Now let us see the next type of message passing communication that is inter-process indirect communication. In indirect communication, the messages are sent to and receive from mailboxes, which is also referred as port. In indirect communication, each mailbox has a unique ID. That mailbox is created as an object, where messages can be queued by the processes and the messages can be removed by the processes. So the mailbox has a unique identification number. The processes can communicate with each other only if they share a mailbox. The two processes can communicate if they have a common mailbox shared with them. In indirect communication, send and receive primitives are used. The send primitive is send a comma message, means send a message to mailbox A and receive a comma message means receive a message from mailbox A. So mailbox sharing takes place like sender process, here sender process sends a message to particular mailbox A or port A and receiver process receive a message from that mailbox or port A. This is indirect communication. Now properties of communication link in indirect communication are link is established only if processes share a common mailbox. A link may be associated with many processes. Between each pair of communicating process, a number of different links may exist with each link corresponding to one mailbox. So though there are multiple pairs of communicating processes, but each two process must share common mailbox. Link may be either unidirectional or bidirectional. Bidirectional means sometimes we get mail from no reply. So there are some mailboxes which allow to send only message. They do not accept message from any other receiver that is unidirectional. Bidirectional means we can receive a message from particular mailbox or we can send a message to that mailbox. So unidirectional means we get a message as a no reply. So the mailbox sharing, here suppose we have an example of three processes P1, P2 and P3 which share a common mailbox A. P1 sends a message to mailbox A and P2 and P3 executes receive from A. Then who will get the message? We know that both processes P2 and P3 both will get the message, but this depends on the method used by the operating system. So operating system may allow a link to be associated with at most two processes so that the message can be sent to two process. It allow only one process at a time to execute a receive operation. Means though there are multiple processes in the system which wish to receive a message but OS will allow only one process at a time to receive a operation or allow the system to select arbitrarily the receiver or system may select a receiver process randomly and sender is notified who the receiver was and it sends the notification to the receiver to the sender to whom the message was sent. Now just pause the video and think that in our daily life where we use this inter-process communication pause the video and just think on it. The most important thing which we use is WhatsApp. Using WhatsApp we share messages with each other. We share message with group or we can share a message personally also. The second example is email, we have a mailbox and we get the message from different mailboxes. There are many examples of this inter-process communication which we use in our daily life but WhatsApp and email are the most commonly used inter-process communication technique or application. Now let us see the synchronization. Now in inter-process communication the processes communicate with each other using send and receive primitives. So that send and receive primitives can be implemented in different ways. So message passing using send and receive may be either blocking or non-blocking. So blocking is considered as a synchronous and blocking has two types. Blocking send means the sender is blocked until receiver receives the message and blocking receive means the receiver is blocked until a message is available. The next type is non-blocking. Blocking is considered as a synchronous. Non-blocking send means sender sends message but it does not wait. It continues with its own operation. It does not wait whether receiver receives an operation or not. Non-blocking receive means here the receiver receives a message but that message may be a valid message or it may be a null message. Now blocking send, blocking receive, non-blocking send and non-blocking receive these four types exist. Blocking is called as synchronous because here sender wait till receiver receives a message. While this is called as a synchronous, why? Because sender sends a message and it does not wait. So this may have different combinations. So different combinations may be possible using these four. So if anyone selects both sender and receiver as a blocking then the system may be rendersious. Means here suppose a producer and consumer if we select producer process also blocking and consumer process also blocking producer will wait till consumer consumes an atom and consumer will wait till producer produces an atom. So in this case both may go in waiting state and system may result in rendersious situation. Next is buffering. Now in buffering the communication may be direct or indirect. The message exchanged by communicating process reside in temporary queue. So queue can be implemented in three ways. First is zero capacity. In zero capacity queue has maximum length zero. Link cannot have any message waiting in it. Sender blocks until the recipient receives the message. So here blocking send is used. So the application of this zero capacity is used in handshaking. Here suppose process P1 send a message to process P2, P2 receive a message from process P1. Here when process P1 send a message it will block till P2 receives a message. Once P2 receive a message P2 send a message to process P1 and when P2 send a message it wait till P1 receive a message. So in this case both sender and receiver are blocking. This type of operation is used in handshaking where one to one communication takes place. Next type is bounded capacity. In bounded capacity queue has finite length. At most n number of messages can reside in queue. Sender can continue execution without waiting. So example of this is producer consumer process with bounded buffer. Now buffer has some fixed size, producer produces an item if space is available in buffer and consumer consumes an item if item is available in buffer. Producer will wait only when buffer is full and consumer will wait only when buffer is empty. So this is one example of bounded capacity producer consumer problem. Second example is sender process send a message to mailbox A and receiver receive a message from mailbox A. These two are examples of bounded capacity. Third type is unbounded capacity. In unbounded capacity queue has infinite length. Any number of messages may reside in queue and sender never block. Sender will continually send message to the queue. Example of this there may be only one producer and n number of consumers may present there. There may be n number of producers and only one consumer will be there and n number of producers may be there and n number of consumers may exist. So these are three types of buffering for inter process communication technique of message passing where zero capacity is also called as no buffering while bounded capacity and unbounded capacity is called as automatic buffering. So in this video we studied how message passing is used for indirect communication using mailbox and how buffering technique takes place, how buffering technique is used for implementing this message passing system for indirect communication. These are the references. Thank you.