Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH07117940B2 - Clock synchronization method in multiprocessor system - Google Patents
[go: Go Back, main page]

JPH07117940B2 - Clock synchronization method in multiprocessor system - Google Patents

Clock synchronization method in multiprocessor system

Info

Publication number
JPH07117940B2
JPH07117940B2 JP63268622A JP26862288A JPH07117940B2 JP H07117940 B2 JPH07117940 B2 JP H07117940B2 JP 63268622 A JP63268622 A JP 63268622A JP 26862288 A JP26862288 A JP 26862288A JP H07117940 B2 JPH07117940 B2 JP H07117940B2
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
Application number
JP63268622A
Other languages
Japanese (ja)
Other versions
JPH02114360A (en
Inventor
正一郎 中井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP63268622A priority Critical patent/JPH07117940B2/en
Publication of JPH02114360A publication Critical patent/JPH02114360A/en
Publication of JPH07117940B2 publication Critical patent/JPH07117940B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

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.

〔従来の技術〕[Conventional technology]

マルチプロセッサシステムにおいては、システムを構成
する各プロセッサのクロックをシステム全体に共通な時
刻を示すように同期させることが必要となる。例えば、
分散ファイリングシステムにおいて、各ファイルに記録
された作成および編集時刻に基づきファイルのバージョ
ンを識別するためには、各プロセッサ間に共通な時刻が
必要となる。また、各プロセッサが、システムに共通な
時刻に基づき自己の履歴情報を蓄積しておけば、障害発
生時にどのような順番で障害が検出されたかを知ること
ができ、障害の発生箇所を特定するための有力な情報を
得ることができる。
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 "An Election Algorithm for Distributed Clock Synchronization Program (An Election Algorithm for a Distributed Cl
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 above-mentioned system, one master node inquires of all the nodes about the time every predetermined time, and calculates the average time 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.

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

上述した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 the document 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.

本発明の目的は、集中制御を行なうプロセッサを設ける
必要がなく、よって一つのプロセッサがシステム内の時
刻を支配することがなく、システム内のプロセッサ数が
増大した場合にも、通信のメッセージ数が極端に増加し
て処理オーバヘッドが増加することがなく、システム内
の総メッセージ数を従来方式より削減することが可能な
分散制御型のマルチプロセッサシステムにおけるクロッ
ク同期方法を提供することにある。
An object of the present invention is that it is not necessary to provide a processor that performs centralized control, so that one processor does not control the time in the system, and the number of messages for communication increases even when the number of processors in the system increases. It is an object of the present invention to provide 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 extremely.

〔課題を解決するための手段〕[Means for Solving the Problems]

第1の発明は、n個のプロセッサからなるマルチプロセ
ッサシステムのクロック同期方法において、前記各プロ
セッサは時刻を示すクロックとランダムは時間間隔を計
測するタイマと予め定められた間隔で時刻割込みを発生
する手段とを具備し、該タイマはあらかじめ定められた
時間範囲内でのランダムな時間間隔を計測後タイムアウ
トし、前記各プロセッサでは、前記時刻割込みが生起す
ると前記タイマを起動し、前記タイムアウトが発生した
時刻が前記時刻割込み前であれば、前記タイムアウトが
発生した時刻が全てのプロセッサに対して自己のクロッ
クが示す時刻を送出し、さらに、前記各プロセッサは、
前記時刻割込みが生起する毎に他のプロセッサから到着
した全ての時刻に基づき各自のクロックの時刻を制御す
ることを特徴とする。また、第2の発明は、第1の発明
における、前記各プロセッサのクロックの時刻制御に
て、前記他のプロセッサから受信した全ての時刻の平均
時刻が、自分のクロックの示す時刻よりもΔ進んでいる
場合は自分のクロックの時刻にΔを加算し、前記平均時
刻が自分のクロックの示す時刻よりもΔ遅れている場合
は、前記タイマが時間Δの経過を通知するまで自分のク
ロックを停止させることを特徴とする。
According to a first aspect of the present invention, in a clock synchronization method for a multiprocessor system including n processors, each processor generates a clock indicating a time, a timer for randomly measuring a time interval, and a time interrupt at a predetermined interval. The timer times out after measuring a random time interval within a predetermined time range, and in each of the processors, the timer is activated when the time interrupt occurs, and the timeout occurs. If the time is before the time interrupt, the time when the timeout occurs sends out the time indicated by its own clock to all the processors, and further, each processor
Each time the time interrupt occurs, the time of its own clock is controlled based on all the times arriving from other processors. In a second aspect of the invention, in the time control of the clock of each processor in the first aspect, the average time of all the times received from the other processors is advanced by Δ from the time indicated by the own clock. If it is, add Δ to the time of its own clock, and if the average time is delayed from the time indicated by its own clock by Δ, stop its own clock until the timer notifies the passage of time Δ It is characterized by

〔作用〕[Action]

互いのプロセッサが共通にアクセスできる共有メモリを
持たないマルチプロセッサシステムにおいては、システ
ムが初期状態の時に、各プロセッサのクロックは同一の
時刻を示してはいない。しかも同じ値からスタートした
クロックも、凡そ同じ割合で時刻を測定するものの、時
刻の経過にともない徐々にずれて行く。従って、各プロ
セッサは、以下に説明する本同期方法に従い、メッセー
ジ通信により互いにクロックの調整を行う必要がある。
この結果、すべてのプロセッサのクロックがある同期精
度の範囲内で同一の時刻を指すように制御される。
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, each processor must 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 own clock of any processor can be notified. 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)番目のクロック同期期間の開始を示す時刻
割込みを1:00とする。プロセッサiでは、0:00の時刻割
込みを検出すると、タイマの起動をかける。例えば、タ
イマを360分間のランダムな時刻にタイムアウトが発生
するように設定しておくものとする。このようにする
と、0:00の時刻割込みから1:00の時刻割込みの間にタイ
ムアウトが生起する確率が1/6となる。ネットワーク内
の全てのプロセッサが独立に同じタイマ起動およびタイ
ムアウトの発生処理を行なうので、ネットワーク中の全
プスセッサ数をnとすると、上記の例では平均的にn/6
のプロセッサがクロック同期制御期間の間にタイムアウ
トを起こすことになる。第2図においてタイムアウト例
1で示しているのがクロック同期制御期間にタイムアウ
トを起こした例であり、タイムアウト例2で示している
のが(k+1)回目の時刻割込みの後にタイムアウトを
起こして例である。しかしながら、実際には1:00になる
とタイマは再起動されるために、0:00に起動されたタイ
マが1:00以降にタイムアウトすることはない。
In FIG. 2, the time from one time interrupt to the next time interrupt is a clock synchronization control period, which is, for example, 1 hour in this example. Now, as shown in the figure, k
A time interrupt indicating the start of the th clock synchronization control period
At 0:00, the time interrupt indicating the end of the clock synchronization period at address k and the start of the (k + 1) th clock synchronization period is set to 1:00. In the processor i, when the time interrupt of 0:00 is detected, the timer is activated. For example, assume that a timer is set so that a timeout occurs at a random time of 360 minutes. In this way, the probability that a timeout will occur between the 0:00 time interrupt and the 1:00 time interrupt becomes 1/6. Since all the processors in the network independently perform the same timer activation and timeout generation processing, assuming that the number of all processors in the network is n, in the above example, n / 6 on average.
Processor will time out during the clock synchronization control period. In FIG. 2, a timeout example 1 is an example in which a timeout occurs during the clock synchronization control period, and a timeout example 2 is an example in which a timeout occurs after the (k + 1) th time interrupt. is there. However, since the timer is actually restarted at 1:00, the timer started at 0:00 does not time out after 1:00.

本発明の方式では、上記タイムアウト例1に示したよう
に、クロック制御期間にタイムアウトを起こした場合の
みに、タイムアウトを起した時点のクロックが示す時刻
を全てのプロセッサに送出するものである。一方、各プ
ロセッサでは、各時刻割込が発生するまでに到着した他
のプロセッサからの時刻に対して受信処理がなされる。
In the system of the present invention, as shown in the time-out example 1, the time indicated by the clock at the time when the time-out occurs is sent to all the processors only when the time-out occurs in the clock control period. On the other hand, in each processor, reception processing is performed with respect to the time from another processor that has arrived by the time each time interrupt occurs.

本同期方式を、第3図のネットワーク例を用いて説明す
る。説明において、各プロセッサでの時刻割込みは1:00
とする。各プロセッサは、自プロセッサの時刻割込みを
検出するとタイマを起動し、タイムアウト時が自己のク
ロックで測定して1:00以前ならば、タイムアウトを起こ
した時点のクロックが示す時刻を全プロセッサに通知す
る。また、1:00以前に時刻を受信したプロセッサでは、
受信した全ての時刻と、この時刻を受信した時の自プロ
セッサのクロックが示す時刻との差分をとり、その差分
の平均値Δによりクロックの調整を行なうものである。
即ち、Δが正ならば自クロックが示す時刻にΔを加算
し、Δが負ならば自クロックをΔだけ停止させる。先程
述べたタイムアウト分布に従って各プロセッサがタイム
アウトを生起させるものとすると、各プロセッサ数nに
対して1回の制御あたり平均n/6個のプロセッサが自己
のクロックを全プロセッサに送出することになる。各プ
ロセッサでは、この平均n/6個のプロセッサからの時刻
の平均値に自分のクロックの時刻をあわせることにな
る。
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, and if the time-out time is measured by its own clock before 1:00, it notifies all the processors of the time indicated by the clock at the time of the time-out. . Also, for processors that received the time before 1:00,
The difference between all the received times and the time indicated by the clock of the own processor at the time of receiving this time is taken, and the clock is adjusted by 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, an average of n / 6 processors per control for each number of processors n sends its own clock to all the processors. Each processor will adjust its clock time to the average value of the times from this average of n / 6 processors.

例えば、本発明によるクロック制御がかけられる前に、
各プロセッサのクロックが第3図(a)に示すような時
刻を各プロセッサがもっているものとする。いま、プロ
セッサ301とプロセッサ302が次のクロック同期制御期間
の1:00以前にタイムアウトを引き起こしたものとし、プ
ロセッサ301のタイムアウト時刻をプロセッサ301のクロ
ックで見て0:38、プロセッサ302のタイムアウト時刻を
プロセッサ302のクロックで見て0:46とする。通信遅延
および各プロセッサのクロックの傾きに起因するクロッ
クずれを無視すると、まず、プロセッサ301の時刻が0:3
8に到達し、その時刻(0:38)をすべてのプロセッサに
送出する。
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. 3 (a). Now, assuming that the processor 301 and the processor 302 caused a timeout before 1:00 of the next clock synchronization control period, the timeout time of the processor 301 is 0:38, the timeout time of the processor 302 is determined by looking at the clock of the processor 301. The clock of the processor 302 is set to 0:46. Neglecting the clock delay caused by the communication delay and the clock inclination of each processor, first the time of the processor 301 is 0: 3.
Reach 8 and send its time (0:38) to all processors.

プロセッサ301がそのクロックが示す時刻を、送出した
ときの各プロセッサの示す時刻を第3図(b)に示す。
第3図(b)でわかるように、各プロセッサのクロック
が示す時刻をは全て1:00以前であり、全プスセッサはプ
ロセッサ301からの時刻を受信する。各プロセッサで
は、プロセッサ301の時刻を受信すると、自己のクロッ
クが示す時刻との差分をとる、差分値は、プロセッサ30
1では0、プロセッサ302では+6、プロセッサ303では
+4、プロセッサ304では+8、プロセッサ305では+2
となる。続いて、プロセッサ302のクロックの示す時刻
が0:46に達したときにこのクロックが示す時刻を送出
し、その時刻を全てのプロセッサが受信するわけであ
る。このときの各プロセッサのクロックが示す時刻を第
3図(c)に示しておく。この場合も同様に、各プロセ
ッサのクロックが示す時刻は全て1:00以前であり、各プ
ロセッサはプロセッサ302からの時刻を受信する。各プ
ロセッサでの差分値は、プロセッサ301では−6、プロ
セッサ302では0、プロセッサ303では−2、プロセッサ
304では+2、プロセッサ305では−4となる。よって、
各プロセッサは上記の差分値の平均値をとり、その値は
プロセッサ301では−3、プロセッサ302では+3、プロ
セッサ303では+1、プロセッサ304では+5、プロセッ
サ305では−1となる。この差分値の平均値に基づき、
先に示したクロックの時刻の調整を行なうこととする
と、各プロセッサにて1:00の時刻割込みが生起したとき
に、プロセッサ301のクロックは3分遅らされ、プロセ
ッサ302のクロックは3分進められ、プロセッサ303のク
ロックは1分進められ、プロセッサ304のクロックは5
分進められ、全てのプロセッサの時刻が同一の値となる
ように調整されることがわかる。
The time indicated by each processor when the processor 301 sends out the time indicated by the clock is shown in FIG.
As can be seen from FIG. 3B, the clocks of the respective processors all indicate the time before 1:00, and all the processors receive the time from the processor 301. When each processor receives the time of the processor 301, it takes the difference from the time indicated by its own clock.
1 for 0, processor 302 for +6, processor 303 for +4, processor 304 for +8, processor 305 for +2
Becomes Then, when the time indicated by the clock of the processor 302 reaches 0:46, the time indicated by this clock is transmitted, and all the processors receive the time. The time indicated by the clock of each processor at this time is shown in FIG. 3 (c). Also in this case, similarly, the clocks of the respective processors all show the time before 1:00, and the respective processors receive the time from the processor 302. The difference value in each processor is −6 in the processor 301, 0 in the processor 302, −2 in the processor 303,
It is +2 for 304 and -4 for processor 305. Therefore,
Each processor takes the average value of the above difference values, and the values are -3 in the processor 301, +3 in the processor 302, +1 in the processor 303, +5 in the processor 304, and -1 in the processor 305. Based on the average value of this difference value,
If the clock time shown above is adjusted, the clock of the processor 301 is delayed by 3 minutes and the clock of the processor 302 is advanced by 3 minutes when the time interrupt of 1:00 occurs in each processor. The clock of processor 303 is advanced by 1 minute and the clock of processor 304 is 5
It can be seen that the time is advanced by minutes and the times of all the processors are adjusted to have the same value.

以上の制御は、すべてのプロセッサが、自分の持つクロ
ックに基づく時刻割込みに従って繰り返し行われるもの
である。勿論、タイムアウト時刻は、各クロック同期期
間毎に各プロセッサでランダムであるので、クロック同
期期間毎に自己のクロックが示す時刻を送出するプロセ
ッサおよびプロセッサ数は結果としてランダムとなる。
The above control is repeatedly performed by all the processors according to the time interrupt based on the own clock. Of course, the time-out time is random in each processor for each clock synchronization period, so that the processors and the number of processors that send out the time indicated by their own clocks for each clock synchronization period will be 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, only the randomly selected processor sends the time, so that 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 probability of occurrence of timeout between time interrupts. In addition, since the time of the clock to be transmitted is random within a certain range (clock synchronization control period),
It is possible to reduce the possibility that the network will be in a congestion state depending on the times sent by the plurality of processors.

〔実施例〕〔Example〕

第1図(a),(b)に本発明の方式を実現するために
各プロセッサにて実行される制御の一フローチャート例
を示す。第1図(a)はクロックが示す時刻の送信制御
を示すフローチャート例であり、第1図(b)はクロッ
ク情報の受信制御を示すフローチャート例である。
FIGS. 1 (a) and 1 (b) show an example of a flowchart of control executed by each processor to realize the system 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 of clock information.

まず、第1図(a)の送信制御フローチャートの説明を
行なう。各プロセッサでは、ブロック100にて時刻割込
みを検出すると、ブロック101にてタイマを起動する。1
02のブロックでは時刻割込みの発生を検出し、もし、時
刻割込みを検出すれば、この同期制御期間での送信制御
を終了し(即ち、この期間では時刻を送出するプロセッ
サにはならなかった)、ブロック100に戻り、再びタイ
マの起動を行なう。もし、ブロック102にて時刻割込み
を検出しなかったら、ブロック103に進み、セットした
タイマがタイムアウトしたかどうかを検出する。もし、
タイムアウトしていなければ、再びブロック102に戻り
時刻割込みの検出判定を行なう。
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 a time interrupt is detected, and if a time interrupt is detected, the transmission control in this synchronous control period is terminated (that is, the processor did not output the time during this period), Returning to block 100, the timer is started again. If block 102 does not detect a time-of-day interrupt, block 103 is entered to detect if the timer set has timed out. if,
If the time-out has not occurred, the process returns to the block 102 and the time interrupt detection is determined.

即ち、ブロック102とブロック103のループは、時刻割込
みかタイムアウトのどちらかを検出するまで続き、ブロ
ック103にてタイムアウトを検出すると(このとき、時
刻割込みが発生する前にタイムアウトを検出したことに
なる)、ブロック104にてタイムアウトが発生した時点
のクロックの時刻が全てのプロセッサに送出され(即
ち、このクロック同期制御期間で時刻を送出するプスセ
ッサとなった)、この同期制御期間での送信制御を終了
し、ブロック100に戻り、次の同期制御期間の開始を示
す時刻割込みを待つ。
That is, the loop of block 102 and block 103 continues until either a time interrupt or a time-out is detected, and when a time-out is detected in block 103 (at this time, the time-out is detected before the time-of-day interrupt occurs. ), The time of the clock at the time when the timeout occurs in block 104 is sent to all the processors (that is, it becomes a processor that sends the time in this clock synchronization control period), and transmission control in this synchronization control period is performed. When finished, return to block 100 to wait for a time interrupt indicating the start of the next synchronization control period.

第1図(b)の受信制御では、ブロック111において、
他のプロセッサが送信する時刻の受信を行なう。続くブ
ロック112にて、受信した時刻と自クロックが示す時刻
との差分を算出し格納する。ブロック113では、時刻割
込みが生起したかどうかの判定を行ない、時刻割込みが
生起していなければ、再び時刻の受信を行ない、このル
ープは受信時間窓が終了するまで繰り返し行なわれる。
ブロック113にて時刻割込が生起したことを検出する
と、ブロック114に行き、受信した全ての時刻と自己の
クロックが示す時刻との差分(ブロック112にて求まっ
ている)の平均値を算出する。
In the reception control of FIG. 1 (b), in block 111,
Receives the time sent by 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. At block 113, it is determined whether a time interrupt has occurred, and if the time interrupt has not occurred, the time is received again, and this loop is repeated until the reception time window ends.
When it is detected in block 113 that a time interrupt has occurred, the process proceeds to block 114, and the average value of the differences (obtained in block 112) between all the received times and the time indicated by the own clock is calculated. .

続くブロック115では、算出されたΔの正負により制御
のスイチを行ない、もし、Δが正ならばブロック116に
て、クロックが示す時刻にΔを加算して自クロックの調
整を行なう。もし、Δが負ならば、ブロック117にて、
自クロックをΔだけ停止させて自クロックの調整を行な
う。ブロック116あるいは117の処理が終了すると、この
周期制御期間での受信処理を終了してブロック110に戻
り、次のクロック周期制御期間での受信制御を開始す
る。
In the following block 115, 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 clock. If Δ is negative, at block 117,
The own clock is stopped by Δ and the own clock is adjusted. When the processing of block 116 or 117 is completed, the reception processing in this cycle control period is completed and the process returns to block 110 to start reception control in the next clock cycle control period.

〔発明の効果〕〔The invention's effect〕

このように、本発明のクロック同期方法を用いることに
より、マルチプロセッサシステムにおいて、集中制御を
行なうプロセッサを設けることなく、すべてのプロセッ
サを対等に動作させて、各プロセッサのクロックを共通
な時刻を指すように制御することができる。クロック同
期制御を行なうプロセッサは、同期制御期間ごとにラン
ダムに選択されることになり、特定のプロセッサの障害
がシステムの致命的な障害を与えることがなく高い信頼
性が確保できる。また、この信頼性の度合いは、タイム
アウトがクロック同期制御区間に入る確率を制御するこ
とで柔軟に変えることが可能である。
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. A processor that performs clock synchronization control is randomly selected for each synchronization control period, and high reliability can be secured without causing a fatal failure of the system due to a failure of a specific processor. Further, the degree of reliability can be flexibly changed by controlling the probability that the timeout enters the clock synchronization control section.

さらに、固定の数のプロセッサが、各同期制御期間毎に
選択されるのではなく、同期制御用に時刻を送出するプ
ロセッサ数もランダムであり、各同期制御期間毎に平均
値として与えられるので、制御にともなうデッドロック
状態を回避することは容易である。また、全てのプロセ
ッサのクロックが示す時刻を用いて同期制御を行なうも
のではなく、部分プロセッサ集合のクロックが示す時刻
を用いて制御がなされるので、プロセッサ数が増えた場
合にも、同期制御に要する処理時間が極端に増大するこ
とはない。
Furthermore, a fixed number of processors are not selected for each synchronization control period, but the number of processors that send time for synchronization control is also random, and is given as an average value for each synchronization control period. It is easy to avoid a deadlock condition associated with control. Further, since the synchronous control is not performed using the time indicated by the clocks of all the processors, but the control is performed using the time indicated by the clock of the partial processor set, the synchronous control is performed even when the number of processors increases. The processing time required does not increase extremely.

さらには、時刻を送出するタイミングがクロック同期制
御期間の間でランダムに分布することになるので、時刻
送出にともなうネットワークの輻そう状態を避けること
が可能となる。
Furthermore, since the timing for transmitting the time is randomly distributed during the clock synchronization 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.

【図面の簡単な説明】[Brief description of drawings]

第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)

【特許請求の範囲】[Claims] 【請求項1】n個のプロセッサからなるマルチプロセッ
サシステムのクロック同期方法において、前記各プロセ
ッサは時刻を示すクロックとランダムな時間間隔を計測
するタイマと予め定められた間隔で時刻割込みを発生す
る手段とを具備し、該タイマはあらかじめ定められた時
間範囲内でのランダムな時間間隔を計測後タイムアウト
し、前記各プロセッサでは、前記時刻割込みが生起する
と前記タイマを起動し、前記タイムアウトが発生した時
刻が前記時刻割込み前であれば、前記タイムアウトが発
生した時刻に全てのプロセッサに対して自己のクロック
が示す時刻を送出し、さらに、前記各プロセッサは、前
記時刻割込みが生起する毎に他のプロセッサから到着し
た全ての時刻に基づき各自のクロックの時刻を制御する
ことを特徴とするマルチプロセッサシステムにおけるク
ロック同期方法。
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. The timer times out after measuring a random time interval within a predetermined time range, and in each processor, when the time interrupt occurs, the timer is started, and the time when the time out occurs. Is before the time interrupt, the time indicated by its own clock is sent to all the processors at the time when the time-out occurs, and further, each processor causes another processor to execute each time the time interrupt occurs. It is characterized by controlling the time of its own clock based on all the times arrived from Clock synchronization method in a multiprocessor system.
【請求項2】前記各プロセッサのクロックの時刻制御に
て、前記他のプロセッサから受信した全ての時刻の平均
時刻が、自分のクロックの示す時刻よりもΔ進んでいる
場合は自分のクロックの時刻にΔを加算し、前記平均時
刻が自分のクロックの示す時刻よりもΔ遅れている場合
は、前記タイマが時間Δの経過を通知するまで自分のク
ロックを停止させることを特徴とする特許請求の範囲第
1項記載のマルチプロセッサシステムにおけるクロック
同期方法。
2. In the time control of the clock of each processor, when the average time of all the times received from the other processors is advanced by Δ from the time indicated by the own clock, the time of the own clock Is added to Δ, 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 clock synchronization method in a multiprocessor system according to claim 1.
JP63268622A 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system Expired - Lifetime JPH07117940B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63268622A JPH07117940B2 (en) 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63268622A JPH07117940B2 (en) 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system

Publications (2)

Publication Number Publication Date
JPH02114360A JPH02114360A (en) 1990-04-26
JPH07117940B2 true JPH07117940B2 (en) 1995-12-18

Family

ID=17461102

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63268622A Expired - Lifetime JPH07117940B2 (en) 1988-10-24 1988-10-24 Clock synchronization method in multiprocessor system

Country Status (1)

Country Link
JP (1) JPH07117940B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165792A (en) * 1991-12-16 1993-07-02 Fujitsu Ltd Timer synchronization method
JP5835245B2 (en) * 2013-02-21 2015-12-24 日本電気株式会社 Time supply device, time supply method and program

Also Published As

Publication number Publication date
JPH02114360A (en) 1990-04-26

Similar Documents

Publication Publication Date Title
Arvind Probabilistic clock synchronization in distributed systems
Cristian et al. Clock synchronization in the presence of omission and performance failures, and processor joins
US4937741A (en) Synchronization of fault-tolerant parallel processing systems
US7334014B2 (en) Consistent time service for fault-tolerant distributed systems
US6199169B1 (en) System and method for synchronizing time across a computer cluster
US8169856B2 (en) Time synchronization in cluster systems
US8601165B2 (en) Method for synchronization in networks
JPH07117940B2 (en) Clock synchronization method in multiprocessor system
Daliot et al. Self-stabilizing byzantine agreement
Gupta et al. A low-overhead non-block checkpointing algorithm for mobile computing environment
JPH0528867B2 (en)
JPH07117939B2 (en) Clock synchronization method in multiprocessor system
Chang et al. Affordable fault tolerance through adaptation
JPH0528866B2 (en)
Li et al. A high-accuracy clock synchronization method in distributed real-time system
JPH0528864B2 (en)
Mishra et al. The timewheel group membership protocol
EP0223031A2 (en) Clock synchronisation in a distributed processing system
JPH01270119A (en) Clock synchronizing system in multiprocessor system
Delporte-Gallet et al. Real-time fault-tolerant atomic broadcast
de Azevedo et al. Fault-tolerant clock synchronization for distributed systems with high message delay variation
JPH0528863B2 (en)
Baldoni et al. A fault-tolerant sequencer for timed asynchronous systems
JPH0528865B2 (en)
Garofalakis et al. Tentative and definite distributed computations: an optimistic approach to network synchronization