台北科技大学:《计算机网络》(英文版) NP04 23(comer)

Distributed Program Generation(rpcgen Example) Chuan-Ming liu CSIE NTUT Spring 04, TAIWAN
1 Distributed Program Generation (rpcgen Example) Chuan-Ming Liu CSIE, NTUT Spring ’04, TAIWAN

Introduction )Presents the sequence of steps a programmer takes to first create a conventional program and then divide the program into local and remote components O Uses an example application to show the output from rpcgen and additional code required to create the client and server components of a distributed program that uses rpc
2 Introduction Presents the sequence of steps a programmer takes to first create a conventional program and then divide the program into local and remote components Uses an example application to show the output from rpcgen and additional code required to create the client and server components of a distributed program that uses RPC

An Example to Illustrate Rpcgen D An example will clarify how rpcgen works and will illustrate most of the details )To explain how rpcgen works, we have selected an extremely simple application
3 An Example to Illustrate Rpcgen An example will clarify how rpcgen works and will illustrate most of the details To explain how rpcgen works, we have selected an extremely simple application

Dictionary operations D Consider an application that implements a simple database that offer 4 basic operations: initialize, insert, delete, and lookup ASsume that input to the application is a text file. where each line contains a one letter command followed by a word DFig. 23. 1 lists the commands, and gives the meaning of each
4 Dictionary Operations Consider an application that implements a simple database that offer 4 basic operations: initialize, insert, delete, and lookup Assume that input to the application is a text file, where each line contains a oneletter command followed by a word Fig. 23.1 lists the commands, and gives the meaning of each

Steps to Distributed Application )Fig.22.6 1. Build a conventional application 22. Divide the program into two parts 03. Create an rpcgen specification 24. Run rpcgen to generate 4 source code files 05. Write stub interface procedures 26. Compile and link the client program 27. Compile and link the server program D 8. Start the server and execute the client
6 Steps to Distributed Application Fig. 22.6 1. Build a conventional application 2. Divide the program into two parts 3. Create an rpcgen specification 4. Run rpcgen to generate 4 source code files 5. Write stub interface procedures 6. Compile and link the client program 7. Compile and link the server program 8. Start the server and execute the client

Step 1: Build a Conventional Application Program DAn application program(dict. c) for the dictionary problem written in C )To produce an executable binary for the application, the programmer invokes the C compiler to produce an executable file named dict Dcc -o dict dict. c
8 Step 1: Build a Conventional Application Program An application program (dict.c) for the dictionary problem written in C To produce an executable binary for the application, the programmer invokes the C compiler to produce an executable file named dict: cc –o dict dict.c

Step 2: Divide the Program into Two Parts DFig 23.2 shows the procedure call graph for the original conventional programs that solves the dictionary problem DA call graph represents a program's procedural organizations D When considering which procedures can be moved to a remote machine the programmer must consider the facilities that each procedure needs
9 Step 2: Divide the Program into Two Parts Fig. 23.2 shows the procedure call graph for the original, conventional programs that solves the dictionary problem A call graph represents a program’s procedural organizations When considering which procedures can be moved to a remote machine, the programmer must consider the facilities that each procedure needs

Step 2: Divide the Program into Two Parts(cont) otherwise access file descriptors cannot be D Procedures that perform 1/0, e.g., nestin moved to a remote machine easil D Procedures should execute on the same machine as the data they access passing large data structures as arguments to remote procedures is inefficient THus, procedures initw, insert, delete and lookup belong on the same machine as the dictionary itself
11 Step 2: Divide the Program into Two Parts (cont.) Procedures that perform I/O, e.g., nextin, or otherwise access file descriptors cannot be moved to a remote machine easily Procedures should execute on the same machine as the data they access; passing large data structures as arguments to remote procedures is inefficient Thus, procedures initw, insertw, deletew, and lookup belong on the same machine as the dictionary itself

Step 2: Divide the Program into Two Parts(cont) )Fig. 23. 3 illustrates the new structure of the dictionary application with the data for the dictionary and access procedures moved to a remote machine OThe programmer must consider the arguments that each remote procedure will require along with the cost of passing that information across a network OThe diagram helps the programmer assess how network delays will affect program performance
12 Step 2: Divide the Program into Two Parts (cont.) Fig. 23.3 illustrates the new structure of the dictionary application with the data for the dictionary and access procedures moved to a remote machine The programmer must consider the arguments that each remote procedure will require along with the cost of passing that information across a network The diagram helps the programmer assess how network delays will affect program performance

Step 2: Divide the Program into Two Parts(cont) )The compiler checks for problems like symbolic constant referenced by both parts and the linker checks to see that all data structures have been collected together with the procedures that reference them D Catching such problems early (i. e, before additional code has been inserted) makes them easier to repair 15
15 Step 2: Divide the Program into Two Parts (cont.) The compiler checks for problems like symbolic constant referenced by both parts, and the linker checks to see that all data structures have been collected together with the procedures that reference them Catching such problems early (i.e., before additional code has been inserted) makes them easier to repair
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 台北科技大学:《计算机网络》(英文版) NP04 22(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 21(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 20.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 20(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 2 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 18.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex con.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server ex.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 server.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi services.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 multi proto.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 Client Software Design.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 16 Socket API.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 15 Client Server model.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 12 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 11 Introduction.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 1 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 0 Network Programming.ppt
- 哈尔滨工业大学:《网络应用开发》英文版 网络开发与应用实验指导书.pdf
- 哈尔滨工业大学:《网络应用开发》英文版 NAD-chapter7.pdf
- 台北科技大学:《计算机网络》(英文版) NP04 24(comer).ppt
- 台北科技大学:《计算机网络》(英文版) NP04 27 Mobile ip discussion overview.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 28 Real-Time Transport protocol.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 3 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 4 CONTENTS.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 5 Subnetting.ppt
- 台北科技大学:《计算机网络》(英文版) NP04 8 Internet Protocol (IP).ppt
- 《计算机图形学》课程教学资源:第3章 图形的基本运算.ppt
- 《计算机图形学》课程教学资源:第4章 图形的观察运算.ppt
- 《计算机图形学》课程教学资源:第6章(6-1)图形的数据结构.ppt
- 《计算机图形学》课程教学资源:第6章 图形的数据结构.ppt
- 《计算机图形学》课程教学资源:第7章 三维图形显示基础.ppt
- 《计算机图形学》课程教学资源:第10章 光照物体的显示.ppt
- 《计算机图形学》课程教学资源:颜色.ppt
- 《计算机图形学》课程教学资源:2003-2004计算机图形学试卷(A).doc
- 《数学与应用数学》2003-2004数学与应用数学试卷(A).doc
- 《计算机图形学》课程教学资源:2003-2004计算机图形学试卷(B).doc
- 《计算机图形学》课程教学资源:2003-2004计算机图形学试卷(B)答案.doc
- 《计算机图形学》课程教学资源:计算机图形学(A).doc
- 《计算机图形学》课程教学资源:计算机图形学(A)答案.doc