Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Computing. Distributed Computation Using Files Part 1 Part 2 f1 = open(toPart2, …); while(…){ write(f1. …); } close(f1); … f2 = open(toPart1,

Similar presentations


Presentation on theme: "Distributed Computing. Distributed Computation Using Files Part 1 Part 2 f1 = open(toPart2, …); while(…){ write(f1. …); } close(f1); … f2 = open(toPart1,"— Presentation transcript:

1 Distributed Computing

2 Distributed Computation Using Files Part 1 Part 2 f1 = open(toPart2, …); while(…){ write(f1. …); } close(f1); … f2 = open(toPart1, …); while(…){ write(f2. …); } close(f2); f2 = open(toPart2, …); while(…){ read(f1, …); } close(f1); f2 = open(toPart1, …); while(…){ read(f2, …); } close(f2);

3 Finer Grained Sharing (1) Distributed computing can be for: –Speed up (simultaneous execution) –Simplify data management (consistency) Last Generation: programming languages (and programmers) do serial computation –Want to share global data –Speed up is a specialist’s domain Procedure is basic unit of abstraction –Abstract data type behavior

4 Finer Grained Sharing (2) Newer computing model –Partition into processes/threads –Message passing communication New OS & language support –Remote procedures –Remote objects with remote method invocation –Distributed process management –Shared memory –Distributed virtual memory … but first, how to partition the computations?

5 Data Partition Serial Form while(…){…} Distribute Data Serial Form Execute all data streams simultaneously

6 Functional Partition (1) Serial Form A Partition The Parts

7 Functional Partition (2) Software is composed from procedures All programmers are familiar with procedural abstraction – exploit procedure model Allow each function to be a blob Implement each blob as a process OS provide network IPC mechanism for serial use of distributed functions –TCP/IP –Messages –Serial “procedure call” protocol between client and server

8 Record Sharing Part 1 Part 2 … while(…){ writeSharedRecord(…); readSharedRecord(…); } … while(…){ readSharedRecord(…); writeSharedRecord(…); } …

9 Message Passing Application buffer Kernel buffer Network packet DL Frame

10 Remote Procedure Call int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } Conventional Procedure Call Remote Procedure Call

11 Conceptual RPC Implementation int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } … pack(a1, msg); pack(a2, msg); … pack(an, msg); send(rpcServer, msg); // waiting... result = receive(rpcServer);... // Initialize the server while(TRUE) { msg = receive(anyClient); unpack(msg, t1); unpack(msg, t2); … unpack(msg, tn); func(t1, t2, …, tn); pack(a1, rtnMsg); pack(a2, rtnMsg); … pack(an, rtnMsg); send(rpcServer, rtnMsg); }

12 Remote Procedure Call int main(…) { … func(a1, a2, …, an); … } void func(p1, p2, …, pn) { … } … pack(a1, msg); pack(a2, msg); … pack(an, msg); send(rpcServer, msg); // waiting... result = receive(rpcServer);... // Initialize the server while(TRUE) { msg = receive(anyClient); unpack(msg, t1); unpack(msg, t2); … unpack(msg, tn); func(t1, t2, …, tn); pack(a1, rtnMsg); pack(a2, rtnMsg); … pack(an, rtnMsg); send(rpcServer, rtnMsg); }

13 Implementing RPC Syntax of an RPC should look as much like a local procedure call as possible Semantics are impossible to duplicate, but they should also be as close as possible The remote procedure’s execution environment will not be the same as a local procedure’s environment –Global variables –Call-by-reference –Side effects –Environment variables

14 Implementing RPC int main(…) { … localF(…); … remoteF(…); … } void localF(…) { … return; } lookup(remote); pack(…); send(rpcServer, msg); receive(rpcServer); unpack(…); return; register(remoteF); while(1) { receive(msg); unpack(msg); remoteF(…); pack(rtnMsg); send(theClient,rtnMsg); } clientStub main theClient void remoteF(…) { … return; } void register(…) { … } void lookup(…) { … } Name Server rpcServer

15 Compiling an RPC callRemote(remoteF, …); remoteF(…); –Compile time –Link time –Dynamic binding

16 A Partitioned Computation Serial Form A Partition The Parts

17 Supporting the Computation Each blob might be a process, thread, or object Blobs should be able to run on distinct, interconnected machines OS must provide mechanisms for: –Process Management Control Scheduling Synchronization IPC –Memory Management Shared memory –File Management – remote files Distributed OS or cooperating Network OSes?

18 Control Remote process/thread create/destroy Managing descriptors Deadlock

19 Scheduling Threads and processes Explicit scheduling Transparent scheduling Migration & load balancing Objects –Active vs passive –Address spaces

20 Synchronization Distributed synchronization –No shared memory  no semaphores –New approaches use logical clocks & event ordering Transactions –Became a mature technology in DBMS –Multiple operations with a commit or abort Concurrency control –Two-phase locking

21 Traditional Memory Interfaces Process Virtual Memory Virtual Memory File Management File Management Physical Memory Physical Memory Storage Devices Storage Devices Device Interface Secondary Memory InterfacePrimary Memory Interface

22 Remote File Services Process Virtual Memory Virtual Memory File Management File Management Physical Memory Physical Memory Storage Devices Storage Devices Secondary Memory InterfacePrimary Memory Interface Remote Disk Client Remote Disk Client Remote Disk Server Remote Disk Server Remote File Client Remote File Client Remote File Server Remote File Server

23 Distributed Shared Memory Process File Management File Management Remote Memory Interface Remote Memory Client Remote Memory Client Remote Memory Server Remote Memory Server Static memory  New language Dynamic memory  New OS interface Low level interface Binding across address spaces Shared memory malloc High level interface Tuples Objects

24 Distributed Virtual Memory Process Virtual Memory Virtual Memory Physical Memory Physical Memory Storage Devices Storage Devices Primary Memory Interface Remote Paging Client Remote Paging Client Remote Paging Server Remote Paging Server Storage Devices Storage Devices

25 Distributed Objects Process Object Interface Remote Object Client Remote Object Client Remote Object Server Remote Object Server Local Objects Process Remote Object Interface Remote Object Client Remote Object Client Remote Object Server Remote Object Server Local Objects Local Object Interface Performance e.g. Corba, DCOM, SOAP, …


Download ppt "Distributed Computing. Distributed Computation Using Files Part 1 Part 2 f1 = open(toPart2, …); while(…){ write(f1. …); } close(f1); … f2 = open(toPart1,"

Similar presentations


Ads by Google