Inter Process Communication Presentation[1]

16,340 views

Published on

Published in: Education, Technology
4 Comments
32 Likes
Statistics
Notes
No Downloads
Views
Total views
16,340
On SlideShare
0
From Embeds
0
Number of Embeds
24
Actions
Shares
0
Downloads
0
Comments
4
Likes
32
Embeds 0
No embeds

No notes for slide

Inter Process Communication Presentation[1]

  1. 1. Inter-Process Communication (IPC)<br />Process A<br />Process B<br />By <br />RavindraRajuKolahalam<br />
  2. 2. What is IPC<br /><ul><li>Processes within a system may be independent or cooperating
  3. 3. Mechanism whereby one process can communicate or exchange data, with another process
  4. 4. Set of techniques for the exchange of data among multiple threads in one or more process
  5. 5. Processes may be running on one or more computers connected by a network</li></li></ul><li>Why Should I listen to You?<br /><ul><li>Familiarity with the different mechanisms that are available for communicating between two or more processes
  6. 6. Even quite small applications can benefit from this approach particularly where there could be many users accessing a common resource, such as a database.
  7. 7. Client/Server computing always uses IPC.
  8. 8. Net work programming can be easy </li></li></ul><li>Why IPC<br /><ul><li>Information sharing
  9. 9. Resource sharing
  10. 10. Computation speedup
  11. 11. Synchronization
  12. 12. Modularity
  13. 13. Convenience</li></li></ul><li>IPC Mechanisms<br />Message passing: Send messages to other processes or receive messages from them.<br />Share a memory area with other processes.<br />Synchronize itself with other processes by means of &apos;Semaphores&apos;.<br />
  14. 14. Message Passing Mechanism<br /><ul><li>Establish a communication link</li></ul>physical<br />logical<br />Exchange messages two primitive operations for fixed or variable sized message passing<br />Send<br />Receive<br />
  15. 15. Message Passing Systems<br />Direct or Indirect communications <br />Symmetric or Asymmetric communications<br />Automatic or Explicit buffering<br />
  16. 16. Synchronizing Messages<br />Message passing may be either blocking or non-blocking.<br />blocking send: sender blocked until message received by mailbox or process<br />Non blocking send: sender resumes operation immediately after sending<br />blocking receive: receiver blocks until a message is available<br />Non blocking receive: receiver returns immediately with either a valid or null message.<br />
  17. 17. Synchronizing Messages<br />Message passing may be either blocking or non-blocking.<br />blocking send: sender blocked until message received by mailbox or process<br />Non blocking send: sender resumes operation immediately after sending<br />blocking receive: receiver blocks until a message is available<br />Non blocking receive: receiver returns immediately with either a valid or null message.<br />
  18. 18. Buffering <br />All messaging system require framework to temporarily buffer messages. These queues are implemented in one of three ways:<br />Zero capacity – No messages may be queued within the link, requires sender to block until receives retrieves message.<br />Bounded capacity – Link has finite number of message buffers. If no buffers are available then sender must block until one is freed up.<br />Unbounded capacity – Link has unlimited buffer space, consequently send never needs to block.<br />
  19. 19. IPC Methods<br />File<br />Signal<br />Socket<br />Message queue<br />Pipe<br />Semaphore<br />
  20. 20. File<br />A computer file is a block of arbitrary information, or resource for storing information.<br />A file is durable in the sense that it remains available for programs to use after the current program has finished. <br />
  21. 21. Signal<br />Signal is a limited form of IPC  used in Unix and Unix-like operating systems. <br />Essentially it is an asynchronous notification sent to a process in order to notify it of an event that occurred. <br />When a signal is sent to a process, the operating system interrupts the process&apos;s normal flow of execution. <br />Execution can be interrupted during any instruction.<br />
  22. 22. Socket<br />Sockets provide point-to-point, two-way communication between two processes. <br />Sockets are very versatile and are a basic component of inter process and intersystem communication. <br />A socket is an endpoint of communication to which a name can be bound. <br />It has a type and one or more associated processes.<br />Sockets exist in communication domains. <br />A socket domain is an abstraction that provides an addressing structure and a set of protocols. Sockets connect only with sockets in the same domain.<br />
  23. 23. Message Queues<br />Message queues provides an asynchronous communication protocol, meaning that the sender and receiver of the message do not need to interact with the message queue at the same time. <br />Messages placed onto the queue are stored until the recipient retrieves them.<br />Most message queues have set limits on the size of data that can be transmitted in a single message. <br />
  24. 24. What is PIPE<br />A pipeline is a set of processes chained by their standard streams, so that the output of each process (stdout) feeds directly as input (stdin) to the next one.<br />Each connection is implemented by an anonymous pipe. <br />
  25. 25. Resources<br />http://www.freenetpages.co.uk/hp/alan.gauld/tutipc.htm<br />http://linuxgazette.net/104/ramankutty.html<br />
  26. 26. Special Thanks To<br />Dr. Way<br />Google :P<br />All those intelligent guys who published their articles on the internet.<br />

×