SynchronizationPart 1.ppt
《SynchronizationPart 1.ppt》由会员分享,可在线阅读,更多相关《SynchronizationPart 1.ppt(25页珍藏版)》请在麦多课文档分享上搜索。
1、1,Synchronization Part 1,REKs adaptation of Claypools adaptation of Tanenbaums Distributed Systems Chapter 5,Distributed Computing Systems,2,Outline,Clock Synchronization Clock Synchronization Algorithms Logical Clocks Election Algorithms Mutual Exclusion Distributed Transactions Concurrency Control
2、,Distributed Computing Systems,3,Clock Synchronization make example,When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.,Same holds when using NFS mount Can all clocks in a distributed system be synchronized?,Distributed Comput
3、ing Systems,4,Physical Clocks,It is impossible to guarantee that crystals in different computers all run at exactly the same frequency. This difference in time values is clock skew. “Exact” time was computed by astronomers The difference between two transits of the sun is termed a solar day. Divide
4、a solar day by 24*60*60 yields a solar second. However, the earth is slowing! (35 days less in a year over 300 million years) There are also short-term variations caused by turbulence deep in the earths core. A large number of days (n) were used used to the average day length, then dividing by 86,40
5、0 to determine the mean solar second.,Distributed Computing Systems,5,Physical Clocks,Computation of the mean solar day.,Distributed Computing Systems,6,Physical Clocks,Physicists take over from astronomers and count the transitions of cesium 133 atom 9,192,631,770 cesium transitions = 1 solar secon
6、d 50 International labs have cesium 133 clocks. The Bureau Internationale de lHeure (BIH) averages reported clock ticks to produce the International Atomic Time (TAI). The TAI is mean number of ticks of cesium 133 clocks since midnight on January 1, 1958 divided by 9,192,631,770 .,Distributed Comput
7、ing Systems,7,Physical Clocks,To adjust for lengthening of mean solar day, leap seconds are used to translate TAI into Universal Coordinated Time (UTC). UTC is broadcast by NIST from Fort Collins, Colorado over shortwave radio station WWV. WWV broadcasts a short pulses at the start of each UTC secon
8、d. accuracy 10 msec. GEOS (Geostationary Environment Operational Satellite) also offer UTC service. accuracy 0.5 msec.,Distributed Computing Systems,8,Outline,Clock Synchronization Clock Synchronization Algorithms Logical Clocks Election Algorithms Mutual Exclusion Distributed Transactions Concurren
9、cy Control,Distributed Computing Systems,9,Clock Synchronization Algorithms,Computer timers go off H times/sec, and increment the count of ticks (interrupts) since an agreed upon time in the past. This clock value is C. Using UTC time, the value of clock on machine p is Cp(t). For a perfect time, Cp
10、(t) = t and dC/dt = 1. For an ideal timer, H =60, should generate 216,000 ticks per hour.,Distributed Computing Systems,10,Clock Synchronization Algorithms,But typical errors, 105, so the range of ticks per second will vary from 215,998 to 216,002. Manufacturer specs can give you the maximum drift r
11、ate (). Every t seconds, the worst case drift between two clocks will be at most 2t. To guarantee two clocks never differ by more than , the clocks must re-synchronize every /2 seconds using one of the various clock synchronization algorithms.,Distributed Computing Systems,11,Centralized Algorithms
12、Cristians Algorithm (1989) Berkeley Algorithm (1989) Decentralized Algorithms Averaging Algorithms (e.g. NTP) Multiple External Time Sources,Clock Synchronization Algorithms,Distributed Computing Systems,12,Cristians Algorithm,Assume one machine (the time server) has a WWV receiver and all other mac
13、hines are to stay synchronized with it. Every /2 seconds, each machine sends a message to the time server asking for the current time. Time server responds with message containing current time, CUTC.,Distributed Computing Systems,13,Cristians Algorithm,Getting the current time from a time server,Dis
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SYNCHRONIZATIONPART1PPT
