Wednesday 30 April 2014

Inter-process communication

 

Inter-process communication (IPC) is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared  memory, and remote procedure calls (RPC). The method of IPC used may vary based on the bandwidth and latency of communication between the threads, and the type of data being communicated.

 

Typically, applications can use IPC categorized as clients or servers. A client is an application or a process that requests a service from some other application or process. A server is an application or a process that responds to a client request. Many applications act as both a client and a server, depending on the situation.

 

There are two types of IPCs:

 

·         LPC (local procedure call)    LPCs are used in multitasking operating systems to allow concurrently running tasks to talk to one another. They can share memory spaces, synchronize tasks, and send messages to one another.

 

·         RPC (remote procedure call)    RPCs are similar to the LPC but work over networks. RPCs provide mechanisms that clients use to communicate requests for services to another network-attached system such as a server. If you think of a client/server application as a program that has been split between front-end and back-end systems, the RPC can be viewed as the component that reintegrates them over the network. RPCs are sometimes called coupling mechanisms.

 

Various methods for inter-process communication used in most processors

 

        ·         Signals:

They are used to signal asynchronous events to one or more processes. A signal could be generated by a keyboard interrupt or an error condition such as the process attempting to access a non-existent location in its virtual memory. 

        ·         Sockets

Sockets are end points of inter-process communication flow across a network. Since communication between most computers is based on internet protocol, therefore most network sockets are internet sockets.

 

  • Shared memory    Processes can exchange values in shared memory. The memory becomes a sort of bulletin board where processes can post status information and data that needs to be shared.

 

  • Queues    A queue IPC is a structured and ordered list of memory segments where processes store or retrieve data.

 

  • Semaphores    A semaphore provides a synchronizing mechanism for processes that are accessing the same resource. No data is passed with a semaphore-it simply coordinates access to shared resources.

 

  • Pipes    A pipe provides a way for processes to communicate with one another by exchanging messages. Named pipes provide a way for processes running on different computer systems to communicate over the network. Mail slots is a store-and-forward messaging system that doesn't require stations to synchronize with one another.

 

Sources: http://en.wikipedia.org/wiki/Inter-process_communication

http://www.linktionary.com/i/ipc.html


By- Tarun Kumar

 :

No comments:

Post a Comment