JPH07117939B2 - Clock synchronization method in multiprocessor system - Google Patents
Clock synchronization method in multiprocessor systemInfo
- Publication number
- JPH07117939B2 JPH07117939B2 JP63268620A JP26862088A JPH07117939B2 JP H07117939 B2 JPH07117939 B2 JP H07117939B2 JP 63268620 A JP63268620 A JP 63268620A JP 26862088 A JP26862088 A JP 26862088A JP H07117939 B2 JPH07117939 B2 JP H07117939B2
- Authority
- JP
- Japan
- Prior art keywords
- time
- clock
- processor
- processors
- interrupt
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000000034 method Methods 0.000 title claims description 23
- 230000003111 delayed effect Effects 0.000 claims description 2
- 238000004891 communication Methods 0.000 description 11
- 230000001360 synchronised effect Effects 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 4
- GDOPTJXRTPNYNR-UHFFFAOYSA-N methyl-cyclopentane Natural products CC1CCCC1 GDOPTJXRTPNYNR-UHFFFAOYSA-N 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 241001102334 Janua Species 0.000 description 1
- 241000212342 Sium Species 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
Landscapes
- Synchronisation In Digital Transmission Systems (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、それぞれのプロセッサが共通にアクセスでき
る共有メモリを持たないマルチプロセッサシステムにお
いて、各々のプロセッサが時刻を示すために有するクロ
ックを互いに調整するためのクロック同期方法に関す
る。DETAILED DESCRIPTION OF THE INVENTION [Industrial field of application] The present invention adjusts the clocks that each processor has to indicate the time in a multiprocessor system that does not have a shared memory that each processor can commonly access. The present invention relates to a clock synchronization method for performing.
マルチプロセッサシステムにおいては、システムを構成
する各プロセッサのクロックをシステム全体に共通な時
刻を示すように同期させることが必要となる。例えば、
分散ファイリングシステムにおいて、各ファイルに記録
された作成及び編集時刻に基づきファイルのバージョン
を識別するためには、各プロセッサ間に共通な時刻が必
要となる。また、各プロセッサが、システムに共通な時
刻に基づき自己の履歴情報を蓄積しておけば、障害発生
時にどのような順番で障害が検出されたかを知ることが
でき、障害の発生箇所を特定するための有力な情報を得
ることができる。In a multiprocessor system, it is necessary to synchronize the clocks of the processors that make up the system so as to indicate a time common to the entire system. For example,
In the distributed filing system, a common time is required among the processors in order to identify the version of the file based on the creation and edit times recorded in each file. Also, if each processor accumulates its own history information based on the time common to the system, it is possible to know in what order the faults were detected when the fault occurred, and identify the location of the fault. You can get powerful information for.
共有メモリを持たないマルチプロセッサシステムの一例
である通信ネットワークシステムにおいても、各通信ノ
ードのクロックが共通な時刻を示すようにする同期方式
が必要である。例えば、1986年5月に開催された第6回
インターナショナル・コンファランス・オン・ディスト
リビューテッド・コンピューティング・システムズ(In
ternational Conference on DISTRIBUTEDCOMPUTING SYS
TEMS)の予稿集p.364-371に記載されている論文「アン
・エレクション・アルゴリズム・フォー・ディストリビ
ューテッド・クロック・シンクロナイゼーション・プロ
グラム(An Election Algorithm for a Distributed Cl
ock Syncronization Program)」(文献1)で紹介され
ているクロック同期方式TEMPOは、UNIXオペレーティン
グシステム4.3BSDで動作するネットワークにインプリメ
ントされているものである。上述のシステムにおいて
は、マスタとなる1つのノードが定められた時間毎に、
すべてのノードに時刻の問い合せを行い、求められた各
ノードの時刻をもとに平均時刻を計算する。この後、す
べてのノードに対してクロックの調整指示を行い、各ノ
ードはこの指示に従いクロックの調整を行う。Even in a communication network system, which is an example of a multiprocessor system having no shared memory, a synchronization method is required so that clocks of respective communication nodes indicate a common time. For example, the 6th International Conference on Distributed Computing Systems (In
ternational Conference on DISTRIBUTEDCOMPUTING SYS
The paper entitled "An Election Algorithm for a Distributed Cl" (p.364-371) is published.
ock Syncronization Program) ”(Reference 1), the clock synchronization method TEMPO is implemented in a network operating on the UNIX operating system 4.3BSD. In the system described above, one node that is the master is
All nodes are inquired about the time, and the average time is calculated based on the obtained time of each node. Thereafter, the clock adjustment instruction is given to all the nodes, and each node adjusts the clock according to this instruction.
また、1986年に開催された第16回アニュアル・インター
ナショナル・シンポジウム・オン・フォールトトレラン
ト・コンピューティング(Annual International Sympo
sium on FAULT-TOLERANT COMPUTING)のダイジェストペ
ーパーp.218-223に記載されている論文「クロック・シ
ンクロナイゼーション・イン・ザ・プレゼンス・オブ・
オミッション・アンド・パフォーマンス・フォールツ・
アンド・プロセッサ・ジョインズ(CLOCK SYNCHRONIZAT
ION IN THE PRESENCE OF OMISSION AND PERFORMANCE FA
ULTS,AND PROCESSOR JOINS)」(文献2)で紹介されて
いるクロック同期方式は、上で説明した“TEMPO"のよう
にマスタ・スレーブ型の制御ではなく分散型の制御を用
いている。同方式において、プロセッサは、システム内
で定期的に同報される同期メッセージの中で、最も速い
時刻を示す同期メッセージに従いクロックの時刻合せを
行なう。このため、結果として最も速く進むクロックが
システム内の時刻を支配することになる。In addition, the 16th Annual International Symposium on Fault Tolerant Computing (Annual International Sympo
sium on FAULT-TOLERANT COMPUTING) digest paper, pages 218-223, "Clock Synchronization in the Presence of.
Omission and Performance Faults
And Processor Joins (CLOCK SYNCHRONIZAT
ION IN THE PRESENCE OF OMISSION AND PERFORMANCE FA
ULTS, AND PROCESSOR JOINS) ”(reference 2) uses distributed control rather than master-slave control as in“ TEMPO ”described above. In the same system, the processor adjusts the clock time according to the synchronization message that indicates the earliest time among the synchronization messages that are regularly broadcast in the system. As a result, the fastest running clock will dominate the time in the system.
さらに、ジャーナル・オブ・アソシェーション・フォー
・コンピューティング・マシナリー(Journal of Assoc
iation for Computing Machinery),Vol.32,No.1,Janua
ry 1985,p.52-78に記載されている論文「シンクロナイ
ジング・クロックス・イン・ザ・プレゼンス・オブ・フ
ォールツ(Synchronizing Clocks in the Presence of
Faults)」(文献3)で紹介されているクロック同期方
式は、すべてのプロセッサが定期的に互いのプロセッサ
の時刻を通信しあう完全分散制御による同期方式であ
る。In addition, the Journal of Assoc for Computing Machinery (Journal of Assoc
iation for Computing Machinery), Vol.32, No.1, Janua
RY 1985, p.52-78, "Synchronizing Clocks in the Presence of
Faults) ”(Reference 3) is a synchronization method based on complete distributed control in which all processors periodically communicate with each other's time.
上述したUNIXオペレーティングシステム4.3BSDのTEMPO
の同期方法においては、マスタノードが必要不可欠であ
る。このため、マスタノードの障害時には、他のノード
がマスタノードの機能を果すように、マスタノードの代
行の方法が必要となる。また、すべてのノードのクロッ
クの問い合せ等を1つのマスタノードが行うために、ノ
ードの数が増えると、マスタノードへの通信量が増加す
るとともに、すべてのノードの時刻の平均を求める作業
が増大する。UNIX operating system 4.3BSD TEMPO mentioned above
A master node is indispensable in the synchronization method of. Therefore, when the master node fails, a method of acting as the master node is required so that the other nodes can function as the master node. Also, since one master node inquires about the clocks of all the nodes, if the number of nodes increases, the communication volume to the master nodes increases and the work to find the average of the time of all nodes also increases. To do.
これに対し、分散型の制御を採用している文献2記載の
方式では、分散型ではあるものの、最も速いクロックを
持つ1つのプロセッサがシステム内の時刻を支配する結
果となる。また、文献3の方式は、すべてのプロセッサ
が互いにすべてのプロセッサと通信を行なうために、実
際のシステムに適用する場合に通信オーバヘッドが問題
となる。On the other hand, in the method described in Reference 2 which adopts the distributed control, although it is distributed, one processor having the fastest clock has the result of controlling the time in the system. Further, the method of Document 3 has a problem of communication overhead when applied to an actual system because all the processors communicate with each other.
本発明においては、集中制御を行なうプロセッサを設け
る必要がなく、よって一つのプロセッサがシステム内の
時刻を支配することがなく、システム内のプロセッサ数
が増大した場合にも、通信のメッセージ数が極端に増加
して処理オーバヘッドが増加することがなく、システム
内の総メッセージ数を従来方式より削減することが可能
な分散制御型のマルチプロセッサシステムにおけるクロ
ック同期方法を提供することにある。In the present invention, it is not necessary to provide a processor for performing centralized control, so that one processor does not control the time in the system, and even when the number of processors in the system increases, the number of communication messages is extremely large. (EN) Provided is a clock synchronization method in a distributed control type multiprocessor system capable of reducing the total number of messages in the system as compared with the conventional method without increasing the processing overhead due to the above.
第1の発明は、n個のプロセッサからなるマルチプロセ
ッサシステムのクロック同期方法において、前記各プロ
セッサは時刻を示すクロックとランダムな時間間隔を計
測するタイマと予め定められた間隔で時刻割込みを発生
する手段とを具備し、該タイマは前記時刻割込みの間隔
内でのランダムな時間間隔を計測後タイムアウトし、前
記各プロセッサでは、前記時刻割込みが生起すると前記
タイマを起動し、前記タイムアウトが発生した時刻に前
記n個のプロセッサの中からm個のプロセッサをランダ
ムに選択して、該m個のプロセッサに対して自己のクロ
ックが示す時刻を送出し、さらに、各プロセッサは、前
記時刻割込みが生起する毎に到着した全ての時刻に基づ
き各自のクロックの時刻を制御することを特徴とする。
また、第2の発明は、第1の発明における、前記各プロ
セッサのクロックの時刻制御にて、前記受信した全ての
時刻の平均時刻が、自分のクロックの示す時刻よりもΔ
進んでいる場合は自分のクロックの示す時刻にΔを加算
し、前記平均時刻が自分のクロックの示す時刻よりもΔ
遅れている場合は、前記タイマが時間Δの経過を通知す
るまで自分のクロックを停止させることを特徴とする。According to a first aspect of the present invention, in a clock synchronization method for a multiprocessor system consisting of n processors, each processor generates a clock indicating a time, a timer for measuring a random time interval, and a time interrupt at a predetermined interval. The timer times out after measuring a random time interval within the time interrupt interval, each processor starts the timer when the time interrupt occurs, and the time when the time out occurs. , Randomly select m processors from the n processors, and send the time indicated by its own clock to the m processors. Further, each processor generates the time interrupt. It is characterized in that the time of each clock is controlled based on all the times of arrival at each time.
Also, in the second invention, in the time control of the clocks of the respective processors in the first invention, the average time of all the received times is Δ more than the time indicated by the own clock.
If you are moving forward, add Δ to the time indicated by your own clock, and the average time is Δ than the time indicated by your own clock.
If it is delayed, it is characterized in that its clock is stopped until the timer notifies the elapse of the time Δ.
互いのプロセッサが共通にアクセスできる共有メモリを
持たないマルチプロセッサシステムにおいては、システ
ムが初期状態の時に、各プロセッサのクロックは同一の
時刻を示してはいない。しかも同じ値からスタートした
クロックも、凡そ同じ割合で時刻を測定するものの、時
刻の経過にともない徐々にずれて行く。従って、各プロ
セッサは、以下に説明する本同期方式に従い、メッセー
ジ通信により互いにクロックの調整を行う必要がある。
この結果、すべてのプロセッサのクロックがある同期精
度の範囲内で同一の時刻を指すように制御される。In a multiprocessor system that does not have a shared memory that can be commonly accessed by the processors, the clocks of the processors do not show the same time when the system is in the initial state. Moreover, the clocks started from the same value measure time at about the same rate, but they gradually shift with the passage of time. Therefore, it is necessary for each processor to adjust the clocks by message communication with each other according to the present synchronization method described below.
As a result, the clocks of all the processors are controlled to point to the same time within a certain synchronization accuracy range.
本発明の原理について、第2図,第3図を参照して説明
する。第3図は、マルチプロセッサシステムの具体例を
示す。各プロセッサ301,302,303,304,305は、自己の時
刻を示すクロックを備えており、各自のクロックに基づ
き時刻割り込みを発生する。さらに、各プロセッサは任
意のプロセッサのクロックが示す時刻を読み出せるよ
う、相互に論理的な通信路により接続されている。例え
ば、プロセッサ303とプロセッサ304の間は通信路306に
より接続されている。また、各プロセッサにはランダム
な時間間隔を計測できるタイマが具備されており、予め
定められた時間範囲内でランダムな時間間隔を計測する
ことができる。第2図は、あるプロセッサiでのタイミ
ングチャートを示し、上記時刻割込みおよびタイマの動
作を説明しながら本発明のクロック同期方法の原理を述
べる。The principle of the present invention will be described with reference to FIGS. FIG. 3 shows a specific example of the multiprocessor system. Each of the processors 301, 302, 303, 304, 305 has a clock indicating its own time, and generates a time interrupt based on its own clock. Further, the processors are mutually connected by a logical communication path so that the time indicated by the clock of any processor can be read. For example, the processor 303 and the processor 304 are connected by a communication path 306. Further, each processor is provided with a timer capable of measuring a random time interval, and can measure the random time interval within a predetermined time range. FIG. 2 shows a timing chart in a certain processor i, and the principle of the clock synchronization method of the present invention will be described while explaining the operations of the time interrupt and the timer.
第2図において、ある割込みから次の割込みまでの時間
がクロック同期の制御期間であり、例えばこの例では1
時間となっている。いま、図に示すように、k番目のク
ロック同期制御期間の開始を示す時刻割込みを0:00、K
番地のクロック同期期間の終わりを示すとともに(k+
1)番目のクロック同期期間の開始を示す第2の時刻割
込みを1:00とする。プロセッサiでは、0:00の時刻割込
みを検出すると、タイマの起動をかける。タイマは前記
同期制御期間である1時間の間のランダムな時刻にタイ
ムアウトが発生するように設定しておくものとする。In FIG. 2, the time from one interrupt to the next is the clock synchronization control period, for example, 1 in this example.
It's time. Now, as shown in the figure, the time interrupt indicating the start of the k-th clock synchronization control period is 0:00, K
Indicates the end of the clock synchronization period of the address and (k +
1) The second time interrupt indicating the start of the 1st clock synchronization period is 1:00. In the processor i, when the time interrupt of 0:00 is detected, the timer is activated. The timer is set so that a timeout occurs at a random time during the synchronous control period of one hour.
ネットワーク内の全てのプロセッサが独立に同じタイマ
起動およびタイマアウトの発生処理を行うので、ネット
ワーク中の全プロセッサ数をnとすると、これらn個の
プロセッサは、各同期制御期間の間にタイムアウトを起
こすことになる。第2図においてタイムアウト例で示し
ているのが同期制御期間にタイムアウトを起こした例で
ある。Since all processors in the network independently perform the same timer activation and timer out generation processing, assuming that the number of all processors in the network is n, these n processors cause a timeout during each synchronous control period. It will be. The time-out example shown in FIG. 2 is an example in which a time-out occurs during the synchronous control period.
本発明の方式では、タイムアウトを起こした時刻にシス
テム内のn個のプロセッサからランダムにm個のプロセ
ッサを選択し、該m個のプロセッサに対し、自プロセッ
サのクロックが示す時刻を送出するものである。一方、
各プロセッサでは、自分宛に到着した時刻を受信し、各
同期制御期間の終了時において、すでに受信された時刻
をもとに処理がなされる。According to the method of the present invention, m processors are randomly selected from n processors in the system at the time when a timeout occurs, and the time indicated by the clock of the own processor is sent to the m processors. is there. on the other hand,
Each processor receives the time when it arrives at itself, and at the end of each synchronization control period, the processing is performed based on the already received time.
本同期方式を、第3図のネットワーク例を用いて説明す
る。説明において、各プロセッサでの時刻割込みは1:00
とする。各プロセッサは、自プロセッサの時刻割込みを
検出するとタイマを起動し、タイムアウト時には、m個
のプロセッサをランダムに選択し、該プスセッサに対し
て、タイムアウトを起こした時点のクロックが示す時刻
を通知する。また、時刻を受信したプロセッサでは、受
信した全ての時刻とこの時刻を受信した自プロセッサの
時刻との差分をとり、その差分の平均値Δによりクロッ
クの調整を行なうものである。即ち、Δが正ならば自ク
ロックが示す時刻にΔを加算し、Δが負ならば自クロッ
クをΔだけ停止させる。先程述べたタイムアウト分布に
従って各プロセッサがタイムアウトを生起させるものと
すると、各プロセッサ1回の制御あたり、平均m個のプ
ロセッサから時刻を受信することになる。各プロセッサ
では、この平均m個のプロセッサからのクロック値の平
均値に自分のクロック値をあわせることになる。This synchronization method will be described using the network example of FIG. In the explanation, the time interrupt at each processor is 1:00
And When each processor detects a time interrupt of its own processor, it starts a timer, at the time of timeout, it randomly selects m processors and notifies the processor of the time indicated by the clock at the time of the timeout. Further, the processor that receives the time takes the difference between all the received times and the time of the own processor that received this time, and adjusts the clock based on the average value Δ of the difference. That is, if Δ is positive, Δ is added to the time indicated by the own clock, and if Δ is negative, the own clock is stopped by Δ. Assuming that each processor causes a time-out according to the time-out distribution described above, the time is received from an average of m processors per control of each processor. Each processor will adjust its own clock value to the average value of the clock values from the average m processors.
例えば、本発明によるクロック制御がかけられる前に、
第3図(a)に示すような時刻を各プロセッサのクロッ
クがもっているものとする。例えばプロセッサ301のタ
イムアウト時刻をプロセッサ301のクロックで見て0:5
8、プロセッサ302のタイムアウト時刻をプロセッサ302
のクロックで見て0:56とする。通信遅延および各プロセ
ッサのクロックの傾きに起因するクロックずれを無視す
ると、まずプロセッサ301のクロックが示す時刻が0:58
に到達する。5つのプロセッサの中から、例えば3つの
プロセッサをランダムに選択するものとし、プロセッサ
302,303,305を選択し、プロセッサ301のクロックが示す
時刻(0:58)を該3つのプロセッサに送出する。For example, before the clock control according to the present invention is applied,
It is assumed that the clock of each processor has a time as shown in FIG. For example, looking at the time-out time of processor 301 with the clock of processor 301, 0: 5
8, processor 302 timeout time processor 302
It is set to 0:56 based on the clock. Ignoring the clock delay caused by the communication delay and the clock inclination of each processor, the time indicated by the clock of the processor 301 is 0:58.
To reach. It is assumed that, for example, three processors are randomly selected from the five processors.
302, 303, 305 are selected, and the time (0:58) indicated by the clock of the processor 301 is sent to the three processors.
プロセッサ301がそのクロックが示す時刻を送出したと
きの各プロセッサのクロックが示す時刻を第3図(b)
に示す。The time indicated by the clock of each processor when the processor 301 transmits the time indicated by the clock is shown in FIG.
Shown in.
各プロセッサでは、プロセッサ301のクロックが示す時
刻を受信すると、自己のクロックが示す時刻との差分を
とる。差分値は、プロセッサ302では+6、プロセッサ3
03では+4、プロセッサ305では+3となる。続いて、
プロセッサ302のクロックが時刻0:56に達したときに、
同様にして、3つのプロセッサをランダムに選択する。
例えば、プロセッサ301,303,304を選択したとすると、
該3つのプロセッサに自己のクロックが示す時刻0:56を
通知する。Upon receiving the time indicated by the clock of the processor 301, each processor takes the difference from the time indicated by its own clock. The difference value is +6 for processor 302, processor 3
It is +4 for 03 and +3 for processor 305. continue,
When the processor 302 clock reaches time 0:56,
Similarly, three processors are randomly selected.
For example, if you select processors 301, 303, 304,
The three processors are notified of the time 0:56 indicated by their own clocks.
この時の各プロセッサのクロックが示す時刻を第3図
(c)に示しておく。各プロセッサでの差分値は、プロ
セッサ301では−6、プロセッサ303では−2、プロセッ
サ304では+2となる。各プロセッサは得られた差分値
の平均値に基づき、先に示したクロックの時刻の調整を
行なう。The time indicated by the clock of each processor at this time is shown in FIG. 3 (c). The difference value in each processor is −6 in the processor 301, −2 in the processor 303, and +2 in the processor 304. Each processor adjusts the clock time shown above based on the average value of the obtained difference values.
以上の説明では、プロセッサ301と302がタイムアウトし
た場合についてのみ詳細に各プロセッサのクロックを示
したが、他のプロセッサも同じようにタイムアウト発生
時に同期制御を行う。In the above description, the clock of each processor is shown in detail only when the processors 301 and 302 have timed out, but other processors similarly perform synchronization control when a time-out occurs.
従って、同期制御期間の終了までには、各プロセッサは
平均3つのプロセッサからの時刻を受信する。Therefore, by the end of the synchronous control period, each processor receives the time from an average of three processors.
以上の制御を各プロセッサが周期的に繰り返えすことに
より、全てのプロセッサのクロックが示す時刻が同一の
値となるように調整されることがわかる。It can be seen that the above control is periodically repeated by each processor so that the times indicated by the clocks of all the processors are adjusted to have the same value.
以上の制御はすべてのプロセッサが、自分のもつクロッ
クに基づく時刻割込みに従って繰り返し行われるもので
ある。勿論、タイムアウト時刻に各プロセッサが選択す
るm個のプロセッサはランダムに選択されるので、クロ
ック同期期間毎に受信される時刻の数は結果としてラン
ダムとなる。The above control is repeatedly performed by all the processors according to the time interrupt based on the own clock. Of course, since the m processors selected by each processor at the time-out time are randomly selected, the number of times received in each clock synchronization period becomes random as a result.
このようにすべてのプロセッサは、完全対等な立場にあ
り、全く同一のアルゴリズムを実施する。この時、ラン
ダムに選択されたプロセッサに対してのみ時刻を送出す
るので、従来に比べて通信量を削減することができる。
また、1つのプロセッサのみがシステムの時刻を制御す
るのではなく、複数のプロセッサの平均時刻でシステム
時刻を制御することにより、耐障害性のある時刻制御が
可能となる。さらに、耐障害性の度合いは、ランダムに
選択するプロセッサ数を変えることで柔軟に制御するこ
とができる。また、クロックが示す時刻を送出する時刻
がある範囲内(クロック同期制御期間の間)でランダム
であるから、複数のプロセッサが送出する時刻によって
ネットワークが輻そう状態となる可能性を軽減できる。In this way all processors are in a perfect peer position and implement the exact same algorithm. At this time, since the time is sent only to the randomly selected processor, the communication amount can be reduced as compared with the conventional case.
Further, not only one processor controls the system time, but the system time is controlled by the average time of a plurality of processors, so that time control with fault tolerance becomes possible. Further, the degree of fault tolerance can be flexibly controlled by changing the number of processors randomly selected. Further, since the time at which the time indicated by the clock is sent is random within a certain range (during the clock synchronization control period), it is possible to reduce the possibility that the network will be in a congestion state depending on the time sent by a plurality of processors.
第1図(a),(b)に、本発明の方式を実現するため
に各プロセッサにて実行される制御の一フローチャート
例を示す。第1図(a)はクロックが示す時刻の送信制
御を示すフローチャート例であり、第1図(b)は時刻
の受信制御を示すフローチャート例である。FIGS. 1 (a) and 1 (b) show an example of a flow chart of the control executed by each processor in order to realize the method of the present invention. FIG. 1A is an example of a flowchart showing transmission control at the time indicated by the clock, and FIG. 1B is an example of a flowchart showing reception control at the time.
まず、第1図(a)の送信制御フローチャートの説明を
行なう。各プロセッサでは、ブロック100にて時刻割込
みを検出すると、ブロック101にてタイマを起動する。1
02のブロックでは前記タイマのタイムアウトの発生を検
出し、もし、タイムアウトを検出すれば、ブロック103
に進み、システム内のn個のプロセッサの中から、m個
のプロセッサをランダムに選択する。First, the transmission control flowchart of FIG. 1A will be described. In each processor, when a time interrupt is detected in block 100, a timer is started in block 101. 1
In block 02, the occurrence of timeout of the timer is detected, and if timeout is detected, block 103
Proceed to and randomly select m processors from among n processors in the system.
この後、ブロック104にてタイムアウトが発生した時点
のクロックが示す時刻を前記ランダムに選択されたm個
のプロセッサに送出し、この同期制御期間での送信制御
を終了し、ブロック100に戻り、次の同期制御期間での
時刻割込みを待つ。第1図(b)の受信制御では、プロ
ック111にて、他のプロセッサから送られてくる時刻の
受信を行なう。続くブロック112にて、受信した時刻と
自クロックが示す時刻との差分を算出し格納する。ブロ
ック113では、次の同期制御周期の開始を示す時刻割込
みの検出を行ない、時刻割込みを検出していなければ、
再び時刻の受信を行なう。ブロック113にて時刻割込み
を検出すると、ブロック114に行き、受信した全ての時
刻と自己のクロックが示す時刻との差分(ブロック112
にて求まっている)の平均値を算出する。続くブロック
115では、算出されたΔの正負により制御のスイッチを
行ない、もし、Δが正ならばブロック116にて、自クロ
ックが示す時刻にΔを加算して自クロックの調整を行な
う。もし、Δが負ならば、ブロック117にて、自クロッ
クをΔだけ停止させて自クロックの調整を行なう。ブロ
ック116あるいは117の処理が終了すると、この周期制御
期間での受信処理が終了し、ブロック111に戻り次のク
ロック周期制御期間での受信制御の開始を示す時刻割込
みを待つ。After that, at block 104, the time indicated by the clock at the time when the timeout occurs is sent to the m randomly selected processors, the transmission control in this synchronous control period is completed, and the process returns to block 100, and Wait for the time interrupt in the synchronous control period of. In the reception control of FIG. 1B, the block 111 receives the time sent from another processor. In the following block 112, the difference between the received time and the time indicated by the own clock is calculated and stored. In block 113, the time interrupt indicating the start of the next synchronous control cycle is detected, and if the time interrupt is not detected,
The time is received again. When the time interrupt is detected in block 113, the process goes to block 114 and the difference between all the received time and the time indicated by the own clock (block 112).
Calculated in step 1). Following block
At 115, the control is switched depending on whether the calculated Δ is positive or negative. If Δ is positive, block 116 adjusts the own clock by adding Δ to the time indicated by the own clock. If Δ is negative, in block 117, the own clock is stopped by Δ and the own clock is adjusted. When the processing of block 116 or 117 ends, the reception processing in this cycle control period ends, and the process returns to block 111 to wait for a time interrupt indicating the start of reception control in the next clock cycle control period.
このように、本発明のクロック同期方法を用いることに
より、マルチプロセッサシステムにおいて、集中制御を
行なうプロセッサを設けることなく、すべてのプロセッ
サを対等に動作させて、各プロセッサのクロックを共通
な時刻を指すように制御することができる。各プロセッ
サは、同期制御期間ごとにランダムに選択したプロセッ
サに時刻を通知するため、特定のプロセッサの障害がシ
ステムの致命的な障害を与えることがなく、高い信頼性
が確保できる。また、この信頼性の度合いは、ランダム
に選択するプロセッサ数mを制御することで柔軟に変え
ることが可能である。また、全てのプロセッサのクロッ
クが示す時刻を用いて同期制御を行なうものではなく、
部分プロセッサ集合のクロックが示す時刻を用いて制御
がなされるので、プロセッサ数が増えた場合にも、同期
制御に要する処理時刻が極端に増大することはない。さ
らには、時刻を送出するタイミングが同期制御期間の間
でランダムに分布することになるので、時刻送出にとも
なうネットワークの輻そう状態を避けることが可能とな
る。As described above, by using the clock synchronization method of the present invention, in a multiprocessor system, all the processors are operated equally without providing a processor for centralized control, and the clocks of the processors point to a common time. Can be controlled. Since each processor reports the time to the processor randomly selected for each synchronization control period, the failure of a specific processor does not cause a fatal failure of the system, and high reliability can be secured. Further, the degree of reliability can be flexibly changed by controlling the number m of processors randomly selected. In addition, synchronization control is not performed using the time indicated by the clocks of all processors,
Since the control is performed using the time indicated by the clock of the partial processor set, the processing time required for the synchronous control does not extremely increase even when the number of processors increases. Furthermore, since the timing for transmitting the time is randomly distributed during the synchronous control period, it is possible to avoid the congestion state of the network accompanying the time transmission.
以上のように本発明により得られる効果は大きい。As described above, the effect obtained by the present invention is great.
第1図(a),(b)は本発明によるクロック同期方式
の一実施例を示すフローチャート、第2図は本発明によ
るクロック同期方式の制御タイミングチャート、第3図
(a),(b),(c)は本発明の原理を説明するため
のマルチプロセッサシステムの一例および各プロセッサ
の時刻例を示す図である。 100〜104,111〜117……制御ブロック、301〜305……プ
ロセッサ、306……プロセッサ303とプロセッサ304間の
論理的な通信路。1 (a) and 1 (b) are flowcharts showing an embodiment of the clock synchronization system according to the present invention, FIG. 2 is a control timing chart of the clock synchronization system according to the present invention, and FIGS. 3 (a) and 3 (b). , (C) are diagrams showing an example of a multiprocessor system and time examples of each processor for explaining the principle of the present invention. Control block, 301-305 ... Processor, 306 ... Logical communication path between processor 303 and processor 304.
Claims (2)
サシステムのクロック同期方法において、前記各プロセ
ッサは時刻を示すクロックとランダムな時間間隔を計測
するタイマと予め定められた間隔で時刻割込みを発生す
る手段とを具備し、該タイマは前記時刻割込みの間隔内
でのランダムな時間間隔を計測後タイムアウトし、前記
各プロセッサでは、前記時刻割込みが生起すると前記タ
イマを起動し、前記タイムアウトが発生した時刻に前記
n個のプロセッサの中からm個のプロセッサをランダム
に選択して、該m個のプロセッサに対して自己のクロッ
クが示す時刻を送出し、さらに、各プロセッサは、前記
時刻割込みが生起する毎に到着した全ての時刻に基づき
各自のクロックの時刻を制御することを特徴とするマル
チプロセッサシステムにおけるクロック同期方法。1. A clock synchronization method for a multiprocessor system comprising n processors, wherein each processor generates a clock indicating a time, a timer for measuring a random time interval, and means for generating a time interrupt at a predetermined interval. And the timer times out after measuring a random time interval within the time interrupt interval, and in each of the processors, the timer is started when the time interrupt occurs, and at the time when the time out occurs. At random, m processors are randomly selected from the n processors, and the time indicated by the own clock is sent to the m processors. Further, each processor receives the time interrupt every time the time interrupt occurs. Multiprocessor system characterized by controlling the time of its own clock based on all the times of arrival Clock synchronization method in the arm.
て、前記受信した全ての時刻の平均時刻が、自分のクロ
ックの示す時刻よりもΔ進んでいる場合は自分のクロッ
クの示す時刻にΔを加算し、前記平均時刻が自分のクロ
ックの示す時刻よりもΔ遅れている場合は、前記タイマ
が時間Δの経過を通知するまで自分のクロックを停止さ
せることを特徴とする特許請求の範囲第1項記載のマル
チプロセッサシステムにおけるクロック同期方法。2. In the time control of the clock of each processor, if the average time of all the received times is ahead of the time indicated by its own clock by Δ, Δ is added to the time indicated by its own clock. The addition, and when the average time is delayed from the time indicated by the own clock by Δ, the own clock is stopped until the timer notifies the elapse of the time Δ. A method for synchronizing a clock in a multiprocessor system according to the paragraph.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63268620A JPH07117939B2 (en) | 1988-10-24 | 1988-10-24 | Clock synchronization method in multiprocessor system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63268620A JPH07117939B2 (en) | 1988-10-24 | 1988-10-24 | Clock synchronization method in multiprocessor system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02114359A JPH02114359A (en) | 1990-04-26 |
| JPH07117939B2 true JPH07117939B2 (en) | 1995-12-18 |
Family
ID=17461078
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63268620A Expired - Lifetime JPH07117939B2 (en) | 1988-10-24 | 1988-10-24 | Clock synchronization method in multiprocessor system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07117939B2 (en) |
-
1988
- 1988-10-24 JP JP63268620A patent/JPH07117939B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02114359A (en) | 1990-04-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Aguilera et al. | On implementing omega with weak reliability and synchrony assumptions | |
| US6351821B1 (en) | System and method for synchronizing time across a computer cluster | |
| Arvind | Probabilistic clock synchronization in distributed systems | |
| Agarwal et al. | The Totem multiple-ring ordering and topology maintenance protocol | |
| US7334014B2 (en) | Consistent time service for fault-tolerant distributed systems | |
| CN113055430B (en) | A data synchronization method and related equipment | |
| CA2339783A1 (en) | Fault tolerant computer system | |
| US20050033862A1 (en) | Method for syncronization in networks | |
| RU93005211A (en) | FAULT-RESISTANT COMPUTING SYSTEM AND METHOD FOR ITS FORMATION | |
| Zhao et al. | Low latency fault tolerance system | |
| Jalote | Fault tolerant processes | |
| JPH07117939B2 (en) | Clock synchronization method in multiprocessor system | |
| JPH07117940B2 (en) | Clock synchronization method in multiprocessor system | |
| Törngren | A perspective to the design of distributed real-time control applications based on CAN | |
| Raja et al. | On the necessary real-time conditions for the producer-distributor-consumer model | |
| JP6446315B2 (en) | Multiplexing computer storage area matching device | |
| JPH0528867B2 (en) | ||
| JPH0528866B2 (en) | ||
| Baldoni et al. | A fault-tolerant sequencer for timed asynchronous systems | |
| Clegg et al. | A low-cost processor group membership protocol for a hard real-time distributed system | |
| Mishra et al. | The timewheel group membership protocol | |
| JPH0528864B2 (en) | ||
| Martins et al. | An Approach to the Synchronization of Backup Masters in Dynamic Master-Slave Systems | |
| JPH0528863B2 (en) | ||
| JPH01270119A (en) | Clock synchronizing system in multiprocessor system |