Interprocess Communication: ( 3.4-3.6) CPE 261403 - Operating Systems

Preview:

Citation preview

Interprocess Communication: (3.4-3.6)

CPE 261403 - Operating Systems

Producer – Consumer Model

Ex of Intra-machine communication

Editor

Compiler

PrintManager

Machine A

Producer – Consumer Model

Ex of Inter-machine communication

Browser

WebServer

Machine A

Machine B

Why IPC?

Information Sharing

Computation Speedup

Modularity

Convenience

IPC ModesMessage Passing Shared Memory

Figure 3.14

Shared Memory

The Good Simple and Easy to Use Fast

The Bad Simultaneous Access Problem Network Shared Memory is Difficult Multi-Processor Cache Problems

Simplest Method for Shared Memory

File

Process 1Process 1 Process 2Process 2

Shared File

Linux Kernel 2.6 and Later

/dev/shm

Process 1Process 1 Process 2Process 2

Shared Ram Disk

Shared Memory Demo

Multi-Processor Cache Problems

Inside Intel Core 2 Quad

Cache

Core Core

Cache

Core Core

Multi-Processor Cache Problems (cont)

Inside Intel Core i7

Multi-Processor Cache Problems (cont)

Core(Count++)

Cacheint CountCacheint Count

Shared Memint Count

Shared Memint Count

Core(Count++)

Cacheint CountCacheint Count

Message Passing Methods

Direct vs indirect communication(e.g. FTP vs Chat)

Synchronous vs asynchronous comm(Chat vs Bit Torrent)

Automatic vs explicit buffering(YouTube vs Telnet)

Examples of Message Passing Remote Procedure Call (RPC)

Remote Method Invocation (RMI)

Simple Object Access Protocol (SOAP)

Common Object Request Broker Architecture (CORBA)

Message Passing in Windows XP

(Mixed with Shared Memory)

Similar to Sockets but contains a shared object to increase speed

Recommended