



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




February 12, 2001 Steven P. Reiss
**1. Multiple threads within a single process
**1. But it depends on specialized machines
**1. Multiple processes on one or more machines
1. Communications between the processes a) How to do it b) When to do it c) Cost of doing it 2. Synchronization among the processes a) Signaling one from another (notify, notifyAll) b) Waiting for things to happen c) Starting and stopping processes
3. Detecting and dealing with failure a) This is something new -- didn’t occur in multithreaded (1) Perhaps it should have (exceptions in a thread) b) Types of failure (1) A process can fail (seg fault, ...) (2) A process can run very slowly (debugging, ...) (3) A communications link can fail
III.Interprocess Communication
**1. Model of doing things in small cooperating units
**1. Simple model of IPC
**1. Basic socket is a 2-way pipe (can read/write)
(3) Writes can send partial message b) Implementing messages is non-trivial in general
1. Peer-to-peer a) Similar to pipes 2. Client-server a) Server sets up master socket b) Clients connect to set up their own sockets c) Server reads/writes from each of the clients as needed d) Problem: how to find the server 3. Central message server a) Clients send to central server b) Central server resends to appropriate other clients 4. Central switchboard, local connections
1. Accessing the central server a) Single versus multiple servers b) Known host/port versus locating host/port 2. What format to send data in a) Text versus binary b) Binary: byte order, size, etc. problems arise c) How to send more complex objects (strings, structs, ...) 3. How to manage references a) Pointers in one address space aren’t valid in another
V. The FIELD Message Server
1. Want to build integrated programming environment for UNIX a) Without recreating all the existing tools b) Make it feel like the a single environment (VS) 2. Have the tools communicate via messages a) Examples: debugger <-> editor
b) Messages can either be commands or informative
3. Want to allow arbitrary tools to run a) Tools might not know who they are sending messages to
1. Provide a central message server a) Tools register with message server when they start (1) Provide patterns describing the mssages they are interested in (2) Provide callbacks for handling those patterns b) Tools send messages to the server (1) It resends them to all other tools that have matching patterns 2. Message formats a) All messages are text strings (1) Patterns are string patterns (2) Patterns indicate argument types which are decoded before the callback occurs. b) Messages are stylized (1) Who from/to; command; arguments; ... (2) Standard form for argument types -- e.g. file names 3. Message types a) Asynchronous messages (informative) (1) Sent out; no wait for receiver, etc.; no reply, no ack b) Synchronous messages (command) (1) Sent out; sender gets first non-null reply (2) This allows anonymous receivers (3) Generally only one reply is relevant c) Synchronous -- return value vs. callback
1. Notes: a) Time to send a message b) Ability to stream messages (Heapview)