DS-week6

Inter-Process Communication

  • the way processes on different machines can exchange information
  • low-level message passing, offered by the underlying network
  • Two models for communication:
    • Remote Procedure Call (RPC)
    • Message-Oriented Middleware (MOM)

Remote Procedure Call

  • aims at hiding most of the intricacies(复杂) of message passing
  • ideal for client-server applications

Example:

newlist = append(data, dblist)

Append is a RPC, client stub is offered to the calling client, the client send to server and client stub calls receive, blocking itself until reply comes back. When message arrive at server, server’s OS passes it to a server stub, unpack and call server procedure, the server perform and return the results to the server stub

Parameter Passing

  • parameter marshalling (transforming data from one representation or format to another)
  • not straightforward
  • solution is to transform data into a machine and network-independent format making sure that both communicating parties expect the same message data type

Asynchronous RPCS

  • client will continue without blocking as soon as the server receive the message

Message-Oriented Middleware

  • message-queuing
  • persistent asynchronous commuication
  • sender posts a message in the queue, receiver retrieves the message form the queue
  • apps communicate by inserting messages in specific queues