&扇 分布计算 UNIVE 16 0 How? a理想主义:Distributed Operating System 口现实主义: ■操作系统提供网络通信功能 ■(中间件) ■分布应用程序 Institute of Computer Software 2022-2-27 Nanjing University
分布计算 How? 理想主义:Distributed Operating System 现实主义: 操作系统提供网络通信功能 (中间件) 分布应用程序 2022-2-27 Institute of Computer Software Nanjing University 16
分布计算 17 Socket programming in Java /listen to port 5000 on the local host for socket connection requests ServerSocket s new ServerSocket (5000); while(true){ /wait for connection request from client Socket clientConn s.accept(); Inputstream in clientConn.getInputstream(); Outputstream out clientConn.getoutputstream(); /now Io streams are connected to client;do something with them... Institute of Computer Software Nanjing University 2022-2-217
分布计算 Socket programming in Java 2022-2-27 Institute of Computer Software Nanjing University 17 17 // listen to port 5000 on the local host for socket connection requests ServerSocket s = new ServerSocket(5000); while (true) { // wait for connection request from client Socket clientConn = s.accept(); InputStream in = clientConn.getInputStream(); OutputStream out = clientConn.getOutputStream(); // now IO streams are connected to client; do something with them
校条 分布计算 1002 18 /create the socket InetAddress addr InetAddress.getByName (Wour.remote.host"); Socket s new Socket (addr,5000); Inputstream in =s.getInputstream(); Outputstream out =s.getOutputstream(); /now we have Io streams to remote process; do something with them... Institute of Computer Software Nanjing University 2022-2-218
分布计算 2022-2-27 Institute of Computer Software Nanjing University 18 18 // create the socket InetAddress addr = InetAddress.getByName(“our.remote.host”); Socket s = new Socket(addr, 5000); InputStream in = s.getInputStream(); OutputStream out = s.getOutputStream(); // now we have IO streams to remote process; do something with them
&扇 分布计算 19 Message Passing Libraries PVM(Parallel Virtual Machine),MPI(Message Passing Interface) Send/Recv,Multicast Virtual Shared Memory ▣OpenMP Institute of Computer Software 2022-2-27 Nanjing University
分布计算 Message Passing Libraries PVM (Parallel Virtual Machine), MPI (Message Passing Interface) Send/Recv, Multicast Virtual Shared Memory OpenMP 2022-2-27 Institute of Computer Software Nanjing University 19
分布计算 02 20 口远程过程调用(RPC,Remote Procedure Call) 口让应用程序开发者可以 ■象调用本地过程一样调用分布在远程节点上的过程 ■将结构化方法用于分布环境 口实现上 ■Request-Response消息传递模式 provides a function-oriented interface to socket-level communications(sits on top of the TCP/IP transport layer) Institute of Computer Software 2022-2-27 Nanjing University
分布计算 远程过程调用(RPC,Remote Procedure Call) 让应用程序开发者可以 象调用本地过程一样调用分布在远程节点上的过程 将结构化方法用于分布环境 实现上 Request – Response 消息传递模式 provides a function-oriented interface to socket-level communications (sits on top of the TCP/IP transport layer) 2022-2-27 Institute of Computer Software Nanjing University 20