分布式系统与管理chapter_Synchronization.pptVIP

  • 12
  • 0
  • 约4.37万字
  • 约 130页
  • 2015-08-15 发布于湖北
  • 举报
分布式系统与管理chapter_Synchronization.ppt

Distributed Systems Synchronization Yingchi Mao Outline Clock Synchronization Mutual Exclusion Election Algorithms Clock Synchronization Physical Clocks Logical Clocks Vector timestamps Why is it important ? Need to measure accurately E.g., auditing in e-commerce Algorithms depending on E.g., consistency, make Correctness of distributed systems frequently hinges upon the satisfaction of global system invariants. E.g., Absence of deadlocks Write access to a distributed database never granted to more than one process the sum of all account debits and ATM payments in an electronic cash system is zero Objects are only subject to garbage collection when no further reference to them exists E.g., UNIX make program When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time. Physical Clocks Time Synchronization Algorithms Cristian’s method The Berkeley Algorithm The Network Time Protocol 时间简史 人类生活有紧密联系的太阳的运动是比较均匀 地球自传是一天,公转是一年 天文计量,自从17世纪机械钟表发明. GMT (Greenwich Mean Time) 太阳到达天空中它出现的最高点时称为中天 两次连续的太阳中天之间的时间称为一个太阳日 每天有24小时,每小时有3600秒, 1/86400个太阳日是太阳秒 物理计量,20世纪40年代 1秒是铯133原子作9,192,631,770次跃迁所用的时间 BIH (Bureau International de l’Heure)将这些值平均起来产生国际原子时间,简称为TAI (International Atomic Time) TAI和太阳秒计时之间的差增加到800毫秒时使用一次闰秒,修正后的时间系统称作统一协调时间,简称UTC (Universal Coordinated Time) Physical Clocks A high-frequency oscillator, counter, and holding register Counter decrements on each oscillation, generates a “tick” and is reset from the holding register when it goes to 0. On a network, clocks will differ: “skew”. Two problems: How do we synchronize multiple clocks to the “real” time? How do we synchronize with each other? Measuring Time How long is a second? How long is a day? One solar day is 86,400 solar seconds. Some variation in the rotational speed of the earth: mean solar second. A Solar Day Computation of the mean solar day. Changes Big problem: the earth’s rotation is slowing. Seconds are getting longer. Is this acceptable f

文档评论(0)

1亿VIP精品文档

相关文档