分布式计算原理与应用(Distributed Computing)第二章课件

上传人:油条 文档编号:26855492 上传时间:2018-01-02 格式:PPT 页数:37 大小:208.50KB
返回 下载 相关 举报
分布式计算原理与应用(Distributed Computing)第二章课件_第1页
第1页 / 共37页
分布式计算原理与应用(Distributed Computing)第二章课件_第2页
第2页 / 共37页
分布式计算原理与应用(Distributed Computing)第二章课件_第3页
第3页 / 共37页
分布式计算原理与应用(Distributed Computing)第二章课件_第4页
第4页 / 共37页
分布式计算原理与应用(Distributed Computing)第二章课件_第5页
第5页 / 共37页
点击查看更多>>
资源描述

《分布式计算原理与应用(Distributed Computing)第二章课件》由会员分享,可在线阅读,更多相关《分布式计算原理与应用(Distributed Computing)第二章课件(37页珍藏版)》请在金锄头文库上搜索。

1、Distributed Computing, M. L. Liu,1,Interprocess Communications,Mei-Ling L. Liu,Distributed Computing, M. L. Liu,2,Interprocess Communications,Operating systems provide facilities for interprocess communications (IPC), such as message queues, semaphores, and shared memory.Distributed computing system

2、s make use of these facilities to provide application programming interface which allows IPC to be programmed at a higher level of abstraction.Distributed computing requires information to be exchanged among independent processes.,Distributed Computing, M. L. Liu,3,IPC unicast and multicast,In distr

3、ibuted computing, two or more processes engage in IPC in a protocol agreed upon by the processes. A process may be a sender at some points during a protocol, a receiver at other points. When communication is from one process to a single other process, the IPC is said to be a unicast. When communicat

4、ion is from one process to a group of processes, the IPC is said to be a multicast, a topic that we will explore in a later chapter.,Distributed Computing, M. L. Liu,4,Unicast vs. Multicast,Distributed Computing, M. L. Liu,5,Interprocess Communications in Distributed Computing,Distributed Computing,

5、 M. L. Liu,6,Operations provided in an archetypal Interprocess Communications API,Receive ( sender, message storage object)Connect (sender address, receiver address), for connection-oriented communication.Send ( receiver, message)Disconnect (connection identifier), for connection-oriented communicat

6、ion.,Distributed Computing, M. L. Liu,7,Interprocess Communication in basic HTTP,Distributed Computing, M. L. Liu,8,Event Synchronization,Interprocess communication requires that the two processes synchronize their operations: one side sends, then the other receives until all data has been sent and

7、received.Ideally, the send operation starts before the receive operation commences.In practice, the synchronization requires system support.,Distributed Computing, M. L. Liu,9,Synchronous vs. Asynchronous Communication,The IPC operations may provide the synchronization necessary using blocking. A bl

8、ocking operation issued by a process will block further processing of the process until the operation is fulfilled.Alternatively, IPC operations may be asynchronous or nonblocking. An asynchronous operation issued by a process will not block further processing of the process. Instead, the process is

9、 free to proceed with its processing, and may optionally be notified by the system when the operation is fulfilled.,Distributed Computing, M. L. Liu,10,Synchronous send and receive,Distributed Computing, M. L. Liu,11,Asynchronous send and synchronous receive,Distributed Computing, M. L. Liu,12,Synch

10、ronous send and Async. Receive - 1,Distributed Computing, M. L. Liu,13,Synchronous send and Async. Receive - 2,Distributed Computing, M. L. Liu,14,Synchronous send and Async. Receive - 3,Distributed Computing, M. L. Liu,15,Asynchronous send and Asynchronous receive,Distributed Computing, M. L. Liu,1

11、6,Event diagram,Distributed Computing, M. L. Liu,17,Blocking, deadlock, and timeouts,Blocking operations issued in the wrong sequence can cause deadlocks.Deadlocks should be avoided. Alternatively, timeout can be used to detect deadlocks.,Distributed Computing, M. L. Liu,18,Using threads for asynchr

12、onous IPC,When using an IPC programming interface, it is important to note whether the operations are synchronous or asynchronous. If only blocking operation is provided for send and/or receive, then it is the programmers responsibility to using child processes or threads if asynchronous operations

13、are desired.,Distributed Computing, M. L. Liu,19,Deadlocks and Timeouts,Connect and receive operations can result in indefinite blockingFor example, a blocking connect request can result in the requesting process to be suspended indefinitely if the connection is unfulfilled or cannot be fulfilled, p

14、erhaps as a result of a breakdown in the network .It is generally unacceptable for a requesting process to “hang” indefinitely. Indefinite blocking can be avoided by using timeout. Indefinite blocking may also be caused by a deadlock,Distributed Computing, M. L. Liu,20,Indefinite blocking due to a d

15、eadlock,Distributed Computing, M. L. Liu,21,Data Representation,Data transmitted on the network is a binary stream.An interprocess communication system may provide the capability to allow data representation to be imposed on the raw data.Because different computers may have different internal storag

16、e format for the same data type, an external representation of data may be necessary.Data marshalling is the process of (I) flatterning a data structure, and (ii) converting the data to an external representation.Some well known external data representation schemes are: Sun XDR ASN.1 (Abstract Syntax Notation) XML (Extensible Markup Language),Distributed Computing, M. L. Liu,22,Data Encoding Protocols,Distributed Computing, M. L. Liu,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号