html5-img
1 / 15

Inter-process Communication

Inter-process Communication. An Overview of Shared Memory and Messaging. Overview. Inter-process Communication (IPC) Shared Memory Concept Associated Linux Commands Messaging Concept Associated Linux Commands Summary of Concepts. Scope of Presentation. Impart General Concepts

dunn
Download Presentation

Inter-process Communication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Inter-process Communication An Overview of Shared Memory and Messaging

  2. Overview • Inter-process Communication (IPC) • Shared Memory • Concept • Associated Linux Commands • Messaging • Concept • Associated Linux Commands • Summary of Concepts

  3. Scope of Presentation • Impart General Concepts • Assumption Audience has General Programming Knowledge • Present Two of Many IPC Strategies • Recognition of Other IPC Methodologies

  4. Overview of IPC • Definition – Ability for processes to share information and resources , as well as provide critical notices of process status to other processes. • Coordination of Processes • Integrity of Data • Protection of Order of Operations • Complex problem solving • Non-linear Problems • Linear Problems

  5. Traditional Linear Problem Problem Solver Process Processor Master Process

  6. Linear Problem with Answer Caching(using IPC and multiple processors) Processor 1 Master Process Problem Solver Process Processor 2 Potential Problem Answer Cache Message Queue Cache Problem Solver Processes Processor 3

  7. Management of IPC • Operating System Level • Process Level • Two Common Techniques • Shared Memory • Messaging

  8. Shared Memory • Allow two or more processes access to the same address space for reading and writing. • What could go wrong! • Process Level Management of Access • Protecting Access with a Semaphore

  9. Semaphore • A semaphore is a global memory variable that processes use to manage access to memory and resources. • Analogy: Classroom Speaking Permission Card • No speaking unless card is in Student’s Possession • Student Must Get the Card and Return the Card • Simple Semaphore – Reading and Writing • Complex Semaphore – Bank of Printers

  10. Shared Memory Pros and Cons • Pros • Good speed once access is granted. • Simple implementation • Cons • Performance degradation as user access requests increase • Limited scalability and applicability to purpose

  11. Linux OS: Semaphore Commands(not inclusive) • semget() – Initializes or gains access to a semaphore. • semop() - Performs operations on a semaphore set. • semctl()- Changes permissions and other characteristics of existing semaphore sets.

  12. Messaging • Allow processes to communicate via messages that are managed by the OS. • Data Requests • Processing Requests • Process Control Through Message Forwarding • Direct Messaging • Synchronous (ex. Requesting data) • Asynchronous (ex. Print job) • Indirect Messaging • Mailbox Concept • OS Controlled Queue

  13. Messaging Pros and Cons • Pros • Strong ability to scale solutions and retain performance • Ability to queue requests and allow processes to continue • Flexibility to create complex dependent operations through message redirection • Cons • Complex implementation

  14. Linux OS: Messaging Commands(not inclusive) • msgget() - Initializes a new message queue. • msgsnd() – Used to send messages to a message queue. • msgrcv() – Used to receive messages from a message queue.

  15. Summary of Concepts • Inter-process Communication • Shared Memory • Messaging • Customized Operating Systems • Messaging Commands • Semaphore • ??? • Limits of IPC

More Related