interprocess communication: ( 3.4-3.6) cpe 261403 - operating systems

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

Upload: delilah-hancock

Post on 31-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

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

Interprocess Communication: (3.4-3.6)

CPE 261403 - Operating Systems

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

Producer – Consumer Model

Ex of Intra-machine communication

Editor

Compiler

PrintManager

Machine A

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

Producer – Consumer Model

Ex of Inter-machine communication

Browser

WebServer

Machine A

Machine B

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

Why IPC?

Information Sharing

Computation Speedup

Modularity

Convenience

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

IPC ModesMessage Passing Shared Memory

Figure 3.14

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

Shared Memory

The Good Simple and Easy to Use Fast

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

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

Simplest Method for Shared Memory

File

Process 1Process 1 Process 2Process 2

Shared File

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

Linux Kernel 2.6 and Later

/dev/shm

Process 1Process 1 Process 2Process 2

Shared Ram Disk

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

Shared Memory Demo

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

Multi-Processor Cache Problems

Inside Intel Core 2 Quad

Cache

Core Core

Cache

Core Core

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

Multi-Processor Cache Problems (cont)

Inside Intel Core i7

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

Multi-Processor Cache Problems (cont)

Core(Count++)

Cacheint CountCacheint Count

Shared Memint Count

Shared Memint Count

Core(Count++)

Cacheint CountCacheint Count

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

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)

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

Examples of Message Passing Remote Procedure Call (RPC)

Remote Method Invocation (RMI)

Simple Object Access Protocol (SOAP)

Common Object Request Broker Architecture (CORBA)

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

Message Passing in Windows XP

(Mixed with Shared Memory)

Similar to Sockets but contains a shared object to increase speed