Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inter-process Communication

Similar presentations


Presentation on theme: "Inter-process Communication"— Presentation transcript:

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

2 Overview Inter-process Communication (IPC) Shared Memory Messaging
Concept Associated Linux Commands Messaging 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)
Master Process Problem Solver Process Processor 1 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
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
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


Download ppt "Inter-process Communication"

Similar presentations


Ads by Google