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
JPH0528867B2 - - Google Patents
[go: Go Back, main page]

JPH0528867B2 - - Google Patents

Info

Publication number
JPH0528867B2
JPH0528867B2 JP62276391A JP27639187A JPH0528867B2 JP H0528867 B2 JPH0528867 B2 JP H0528867B2 JP 62276391 A JP62276391 A JP 62276391A JP 27639187 A JP27639187 A JP 27639187A JP H0528867 B2 JPH0528867 B2 JP H0528867B2
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
JP62276391A
Other languages
Japanese (ja)
Other versions
JPH01116862A (en
Inventor
Satoshi Hasegawa
Shoichiro Nakai
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
Nippon Electric Co Ltd
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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP62276391A priority Critical patent/JPH01116862A/en
Publication of JPH01116862A publication Critical patent/JPH01116862A/en
Publication of JPH0528867B2 publication Critical patent/JPH0528867B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)
  • Small-Scale Networks (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、それぞれのプロセツサが共通にアク
セスできる共有メモリを持たないマルチプロセツ
サシステムにおいて、各々のプロセツサが時刻を
示すために有するクロツクを互いに調整するため
のクロツク同期方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention provides a multiprocessor system in which processors do not have a shared memory that can be accessed in common, so that the clocks that each processor has for indicating time can be shared with each other. This invention relates to a clock synchronization method for adjustment.

(従来の技術) マルチプロセツサシステムにおいては、システ
ムを構成する各プロセツサのクロツクをシステム
全体に共通な時刻を示すように同期させることが
必要となる。例えば、分散フアイリングシステム
において、各フアイルに記録された作成および編
集時刻に基づきフアイルのバージヨンを識別する
ためには、各プロセツサ間に共通な時刻が必要と
なる。また、各プロセツサが、システムに共通な
時刻に基づき自己の履歴情報を蓄積しておけば、
障害発生時にどのような順番で障害が検出された
かを知ることができ、障害の発生箇所を特定する
ための有力な情報を得ることができる。
(Prior Art) In a multiprocessor system, it is necessary to synchronize the clocks of each processor making up the system so that they indicate a common time for the entire system. For example, in a distributed filing system, a common time between processors is required to identify versions of files based on the creation and editing 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 failures were detected when they occur, and useful information for identifying the location where the failure has occurred can be obtained.

共有メモリを持たないマルチプロセツサシステ
ムの一例である、通信ネツトワークシステムにお
いても、各通信ノードのクロツクが共通な時刻を
示すようにする同期方式が必要である。例えば、
1986年5月に開催された第6回インターナシヨナ
ル・コンフアランス・オン・デイストリビユーテ
ツド・コンピユーテイング・システムズ
(International Conference on DISTRIBUTED
COMPUTING SYSTEMS)の予稿集p.364−
371に記載されている論文「アン・エレクシヨ
ン・アルゴリズム・フオー・デイストリビユーテ
ツド・クロツク・シンクロナイゼーシヨン・プロ
グラム(An Election Algorithm for a
Distributed Clock Synchronization
Program)」(文献1)で紹介されているクロツ
ク同期方式TEMPOは、UNIXオペレーテイング
システム4.3BSDで動作するネツトワークにイン
プリメントされているものである。上述のシステ
ムにおいては、マスタとなる1つのノードが、定
められた時間毎にすべてのノードに時刻の問い合
せを行い、求められた各ノードの時刻をもとに平
均時刻を計算する。この後すべてのノードに対し
てクロツクの調整指示を行い、各ノードはこの指
示に従いクロツクの調整を行う。
Even in a communication network system, which is an example of a multiprocessor system without a shared memory, a synchronization method is required so that the clocks of each communication node indicate a common time. for example,
The 6th International Conference on Distributed Computing Systems was held in May 1986.
COMPUTING SYSTEMS) Proceedings p.364−
371, ``An Election Algorithm for a Distributed Clocks Synchronization Program''
Distributed Clock Synchronization
The clock synchronization method TEMPO introduced in ``Program'' (Reference 1) is implemented in a network running on the UNIX operating system 4.3BSD. In the above-mentioned system, one node serving as a master queries all nodes about the time at predetermined intervals, and calculates an average time based on the determined times of each node. Thereafter, a clock adjustment instruction is given to all nodes, and each node adjusts its clock according to this instruction.

また、1986年に開催された第16回アニユアル・
インターナシヨナル・シンポジウム・オン・フオ
ールトトレラント・コンピユーテイング
(Annual International Symposium on
FAULT−TOLERANT COMPUTING)のダ
イジエストペーパーp.218−223に記載されている
論文「クロツク・シンクロナイゼーシヨン・イ
ン・ザ・プレゼンス・オブ・オミツシヨン・アン
ド・パフオーマンス・フオールツ・アンド・プロ
セツサ・ジヨインズ(CLOCK
SYNCHRONIZATION IN THE PRESENCE
OF OMISSION AND PERFORMANCE
FAULTS,AND PROCESSOR JOINS)」(文
献2)で紹介されているクロツク同期方式は、上
で説明した“TEMPO”のようにマスタ・スレー
ブ型の制御ではなく分散型の制御を用いている。
同方式において、プロセツサはシステム内で定期
的に同報される同期メツセージの中で、最も速い
時刻を示す同期メツセージに従いクロツクの時刻
合せを行なう。このため、結果として最も速く進
むクロツクがシステム内の時刻を支配することに
なる。
Also, the 16th Annual Exhibition held in 1986
Annual International Symposium on Fault Tolerant Computing
FAULT-TOLERANT COMPUTING) Digest Paper p.218-223 CLOCK
SYNCHRONIZATION IN THE PRESENCE
OF OMISSION AND PERFORMANCE
The clock synchronization method introduced in ``FAULTS, AND PROCESSOR JOINS'' (Reference 2) uses distributed control rather than master-slave type control like ``TEMPO'' explained above.
In this system, the processor adjusts the clock according to the synchronization message indicating the earliest time among the synchronization messages broadcast periodically within the system. As a result, the fastest running clock will control the time in the system.

さらに、ジヤーナル・オブ・アソシエーシヨ
ン・フオー・コンピユーテイング・マシナリー
(Journal of Association for Computing
Machinery),Vol.32,No.1,January 1985,
p.52−78に記載されている論文「シンクロナイジ
ング・クロツクス・イン・ザ・プレゼンス・オ
ブ・フオールツ(Synchronizing Clocks in the
Presence of Faults)」(文献3)で紹介されてい
るクロツク同期方式は、すべてのプロセツサが定
期的に互いのプロセツサの時刻を通信しあう完全
分散制御による同期方式である。
In addition, the Journal of Association for Computing Machinery
Machinery), Vol.32, No.1, January 1985,
The paper “Synchronizing Clocks in the Presence of Faults” on p.52-78
The clock synchronization method introduced in "Presence of Faults" (Reference 3) is a synchronization method using completely distributed control in which all processors periodically communicate the time of each other's processors.

(発明が解決しようとする問題点) 上述のUNIXオペレーテイングシステム
4.3BSDのTEMPOの同期方法においては、マス
タノードが必要不可欠である。このため、マスタ
ノードの障害時には、他のノードがマスタノード
の機能を果すように、マスタノードの代行の方法
が必要となる。また、すべてのノードのクロツク
の問い合せ等を1つのマスタノードが行うため
に、ノードの数が増えると、マスタノードへの通
信量が増加するとともに、すべてのノードの時刻
の平均を求める作業が増大する。
(Problem to be solved by the invention) The UNIX operating system mentioned above
A master node is essential for the 4.3BSD TEMPO synchronization method. Therefore, in the event of a failure of the master node, a method of acting as a master node is required so that another node can perform the function of the master node. In addition, since one master node queries the clocks of all nodes, as the number of nodes increases, the amount of communication to the master node increases, and the task of calculating the average time of all nodes increases. do.

これに対し、分散型の制御を採用している文献
2記載の方式では、分散型ではあるものの、最も
速いクロツクをもつ1つのプロセツサがシステム
内の時刻を支配する結果となる。また、文献3の
方式は、すべてのプロセツサが互いにすべてのプ
ロセツサと通信を行なうために、実際のシステム
に適用する場合に通信のオーバヘツドが問題とな
る。
On the other hand, in the method described in Reference 2 which employs distributed control, although it is distributed, one processor with the fastest clock controls the time within the system. Furthermore, in the method of Reference 3, since all processors communicate with each other, communication overhead becomes a problem when applied to an actual system.

本発明においては、集中制御を行なうプロセツ
サを設ける必要がなく、よつて一つのプロセツサ
がシステム内の時刻を支配することがなく、シス
テム内のプロセツサ数が増加した場合にも、通信
のメツセージ数が極端に増加して処理オーバヘツ
ドが増加することがなく、システム内の総メツセ
ージ数を従来方式より削減することが可能な分散
制御型のマルチプロセツサシステムにおけるクロ
ツク同期方式を提供することにある。
In the present invention, there is no need to provide a processor for centralized control, so 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 can be reduced. An object of the present invention is to provide a clock synchronization method in a distributed control multiprocessor system, which can reduce the total number of messages in the system compared to the conventional method without causing an excessive increase in processing overhead.

(問題点を解決するための手段) 本発明によれば、n個のプロセツサからなるマ
ルチプロセツサシステムのクロツク同期方式にお
いて、前記各プロセツサは時刻を示すクロツクと
ランダム時間を計測するタイマと第1の時刻割込
みと第2の時刻割込みを発生する手段とを具備
し、該タイマはあらかじめ定められた時間範囲内
でのランダムな時間を計測後タイムアウトし、各
プロセツサでは、第1の時刻割込みは生起する毎
に前記タイマを起動し、タイムアウトが発生した
時刻が第1の時刻割込みと第2の時刻割込みの間
に入つていれば、前記タイムアウトが発生した時
刻に全てのプロセツサに対して自己のクロツクを
送出し、また各プロセツサでは第1および第2の
時刻割込みを含む時間窓を設けて、該時間窓の間
に到着した全てのクロツク情報に基づき各自のク
ロツクを制御することを特徴とするマルチプロセ
ツサシステムにおけるクロツク同期方式が得られ
る。
(Means for Solving the Problems) According to the present invention, in a clock synchronization method for a multiprocessor system consisting of n processors, each processor has a clock that indicates the time, a timer that measures random time, and a first and means for generating a second time interrupt, the timer times out after measuring a random time within a predetermined time range, and in each processor, the first time interrupt is generated. If the time when the timeout occurs is between the first time interrupt and the second time interrupt, the timer is activated every time the A clock is sent out, and each processor has a time window including the first and second time interrupts, and controls its own clock based on all clock information arriving during the time window. A clock synchronization scheme in a multiprocessor system is obtained.

(作用) 互いのプロセツサが共通にアクセスできる共有
メモリを持たないマルチプロセツサシステムにお
いては、システムが初期状態の時に、各プロセツ
サのクロツクは同一の時刻を示してはいない。し
かも同じ値からスタートしたクロツクも、凡そ同
じ割合で時刻を測定するものの、時刻の経過にと
もない徐々にずれて行く。従つて、各プロセツサ
は以下に説明する本同期方式に従い、メツセージ
通信により互いにクロツクの調整を行う必要があ
る。この結果、すべてのプロセツサのクロツクが
ある同期精度の範囲内で同一の時刻を指すように
制御される。
(Operation) In a multiprocessor system that does not have a shared memory that can be commonly accessed by both processors, the clocks of each processor do not indicate the same time when the system is in its initial state. Moreover, although clocks that start from the same value measure time at roughly the same rate, they gradually shift as time passes. Therefore, it is necessary for each processor to mutually adjust their clocks through message communication according to this synchronization method described below. As a result, the clocks of all processors are controlled to point to the same time within a certain synchronization accuracy.

本発明の原理について、第2図、第3図を参照
して説明する。第3図は、マルチプロセツサシス
テムの具体例を示す。各プロセツサ301,30
2,303,304,305は、自己の時刻を示
すクロツクを備えており、各自のクロツクに基づ
き2つの時刻割り込みを発生する。さらに各プロ
セツサは任意のプロセツサのクロツク情報を読み
出せるよう、相互に論理的な通信路により接続さ
れている。例えば、プロセツサ303とプロセツ
サ304の間は通信路306により接続されてい
る。また、各プロセツサにはランダム時間を計測
できるタイマが具備されており、予め定められた
時間範囲内でランダムな時間を計測することがで
きる。第2図は、あるプロセツサiでのタイミン
グチヤートを示し、上記時刻割込みおよびランダ
ムタイマの動作を説明しながら本発明のクロツク
同期方式の原理を述べる。第2図において、第2
の割込みから次の第2の割込みまでの時間がクロ
ツク同期の制御期間であり、例えばこの例では1
時間となつている。いま図に示すように、k番目
のクロツク同期制御期間の開始を示す第2の時刻
割込みを0:00、k番目のクロツク同期制御期間
の第1の時刻割込みを0:55、k番目のクロツク
同期期間の終わりを示すとともに(k+1)番目
のクロツク同期期間の開始を示す第2の時刻割込
みを1:00とする。プロセツサiでは、0:55の
第1の時刻割込みを検出すると、タイマの起動を
かける。例えば、タイマを30分間の間のランダム
な時刻にタイムアウトが発生するように設定して
おくものとする。このようにすると、0:55の第
1の時刻割込みから1:00の第2の時刻割込みの
間にタイムアウトが生起する確率は1/6となる。
ネツトワーク内の全てのプロセツサが独立に同じ
タイマ起動およびランダムタイムアウトの発生処
理を行なうので、ネツトワーク中の全プロセツサ
数をnとすると、上記の例では平均的にn/6のプ
ロセツサが第1および第2の時刻割込みの間にタ
イムアウトを起こすことになる。第2図において
タイムアウト例1で示しているのが第1および第
2の時刻割込みの間にタイムアウトを起こした例
であり、タイムアウト例2で示しているのが第2
の時刻割込みの後にタイムアウトを起こした例で
ある。本発明の方式では、上記タイムアウト例1
に示したように、第1および第2の時刻割込みの
間にタイムアウトを起こした場合のみに、タイム
アウトを起こした時刻にその時刻のクロツク情報
を全てのプロセツサに送出するものである。一
方、各プロセツサでは第2図に示すようにクロツ
ク情報受信処理のために、クロツク受信時間窓を
設けている。これは、第1および第2の時刻割り
込みを含む時間領域で設定されるものであり、こ
の時間窓内に到着したクロツク情報に対してのみ
受信処理がなされる。
The principle of the present invention will be explained with reference to FIGS. 2 and 3. FIG. 3 shows a specific example of a multiprocessor system. Each processor 301, 30
2, 303, 304, and 305 each have a clock indicating its own time, and generate two time interrupts based on its own clock. Furthermore, each processor is connected to each other by a logical communication path so that clock information of any processor can be read out. For example, processor 303 and processor 304 are connected by a communication path 306. Furthermore, each processor is equipped with a timer capable of measuring random time, and can measure random time within a predetermined time range. FIG. 2 shows a timing chart for a certain processor i, and describes the principle of the clock synchronization system of the present invention while explaining the operations of the time interrupt and random timer. In Figure 2, the second
The time from the second interrupt to the next second interrupt is the clock synchronization control period, and for example, in this example,
It's time. As shown in the figure, the second time interrupt indicating the start of the k-th clock synchronization control period is set at 0:00, the first time interrupt of the k-th clock synchronization control period is set at 0:55, and the k-th clock is set at 0:55. A second time interrupt indicating the end of the synchronization period and the start of the (k+1)th clock synchronization period is set at 1:00. When processor i detects the first time interrupt at 0:55, it starts the timer. For example, suppose a timer is set to time out at a random time within 30 minutes. In this way, the probability that a timeout will occur between the first time interrupt at 0:55 and the second time interrupt at 1:00 is 1/6.
All processors in the network independently perform the same timer activation and random timeout generation processing, so if the total number of processors in the network is n, then on average n/6 processors will be the first processor in the above example. and a timeout will occur during the second time interrupt. In FIG. 2, timeout example 1 is an example in which a timeout occurs between the first and second time interrupts, and timeout example 2 is an example in which a timeout occurs between the first and second time interrupts.
This is an example of a timeout occurring after a time interrupt. In the method of the present invention, the above timeout example 1
As shown in FIG. 3, only when a timeout occurs between the first and second time interrupts, clock information at that time is sent to all processors at the time when the timeout occurs. On the other hand, each processor is provided with a clock reception time window for clock information reception processing, as shown in FIG. This is set in a time domain that includes the first and second time interrupts, and reception processing is performed only on clock information that arrives within this time window.

本同期方式を、第3図のネツトワーク例を用い
て説明する。説明において、各プロセツサでの第
1の時刻割込みは0:55、第2の時刻割込みは
1:00とし、受信時間窓は0:45から1:10とす
る。各プロセツサは、自プロセツサの第1の時刻
割込みを検出するとタイマを起動し、タイムアウ
ト時が自己のクロツクで測定して1:00以前なら
ばタイムアウトを起こした時刻を刻印したクロツ
ク情報を全プロセツサに通知する。また受信時間
窓内でクロツクを受信したプロセツサでは受信し
た全てのクロツク値とクロツク値を受信した自プ
ロセツサの時刻との差分をとり、その差分の平均
値Δによりクロツクの調整を行なうものである。
即ち、Δが正ならば自クロツク値にΔを加算し、
Δが負ならば自クロツクをΔだけ停止させる。先
程述べたタイムアウト分布に従つて各プロセツサ
がタイムアウトを生起させるものとすると、全プ
ロセツサ数nに対して1回の制御あたり平均n/6
個のプロセツサが自己のクロツクを全プロセツサ
に送出することになる。各プロセツサではこの平
均n/6個のプロセツサからのクロツク値の平均値
に自分のクロツク値をあわせることになる。例え
ば、本発明によるクロツク制御がかけられる前
に、第3図(a)に示すようなクロツク値を各プロセ
ツサがとつているものとする。いま、プロセツサ
301とプロセツサ302が第1と第2の時刻割
込み間でタイムアウトを引き起こしたものとし、
プロセツサ301のタイムアウト時刻をプロセツ
サ301のクロツクで見て0:58、プロセツサ3
02のタイムアウト時刻をプロセツサ302のク
ロツクで見て0:56とする。通信遅延および各プ
ロセツサのクロツクの傾きに起因するクロツクず
れを無視すると、まずプロセツサ301のクロツ
ク値が0:58に到達し、そのクロツク値(0:
58)をすべてのプロセツサに送出する。プロセツ
サ301がそのクロツク値を送出したときの各プ
ロセツサの示す時刻を第3図bに示す。第3図b
でわかるように、各プロセツサの示す時刻は全て
受信時間窓内に入つているので、全プロセツサは
プロセツサ301からのクロツク情報を受信す
る。各プロセツサではプロセツサ301のクロツ
ク値を受信すると自己のクロツク値との差分をと
る。差分値は、プロセツサ301では0、プロセ
ツサ302では+6、プロセツサ303では+
4、プロセツサ304では+8、プロセツサ30
5では+2となる。続いてプロセツサ302のク
ロツク値が0:56に達したときにクロツク値を送
出し、そのクロツク値を全てのプロセツサが受信
するわけである。このときの各プロセツサの示す
時刻を第3図(c)に示しておく。この場合も同様に
各プロセツサの示す時刻は全て受信時間窓内に入
つているので、全プロセツサはプロセツサ302
からのクロツク情報を受信する。各プロセツサで
の差分値は、プロセツサ301では−6、プロセ
ツサ302では0、プロセツサ303では−2、
プロセツサ304では+2、プロセツサ305で
は−4となる。よつて、各プロセツサは上記の差
分値の平均値をとり、その値はプロセツサ301
では−3、プロセツサ302では+3、プロセツ
サ303では+1、プロセツサ304では+5、
プロセツサ305では−1となる。この差分値の
平均値に基づき、先に示したクロツク値の調整を
行なうこととすると、各プロセツサにて受信時間
窓が終了したときに、プロセツサ301のクロツ
クは3分遅らされ、プロセツサ302のクロツク
は3分進められ、プロセツサ303のクロツクは
1分進められ、プロセツサ304のクロツクは5
分進められ、プロセツサ305のクロツクは1分
遅らされ、全てのプロセツサのクロツク値が同一
の値となるように調整されることがわかる。以上
の制御はすべてのプロセツサが、自分のもつクロ
ツクに基づく時刻割込みや受信時間窓に従つて繰
り返し行われるものである。勿論、タイムアウト
時刻は各クロツク同期期間毎に各プロセツサでラ
ンダムであるので、クロツク同期期間毎に自己の
クロツクを送出するプロセツサおよびプロセツサ
数は結果としてランダムとなる。
This synchronization method will be explained using the network example shown in FIG. In the description, it is assumed that the first time interrupt in each processor is 0:55, the second time interrupt is 1:00, and the reception time window is 0:45 to 1:10. When each processor detects its own processor's first time interrupt, it starts a timer, and if the timeout is before 1:00 as measured by its own clock, it sends clock information stamping the time at which the timeout occurred to all processors. Notice. A processor that receives a clock within the reception time window calculates the differences between all the received clock values and the time of its own processor that received the clock value, and adjusts the clock using the average value Δ of the differences.
That is, if Δ is positive, add Δ to the own clock value,
If Δ is negative, the own clock is stopped by Δ. Assuming that each processor causes a timeout according to the timeout distribution mentioned earlier, the average per control for the total number of processors n is n/6.
Each processor will send its clock to all processors. Each processor adjusts its own clock value to the average value of the clock values from n/6 processors. For example, it is assumed that each processor has a clock value as shown in FIG. 3(a) before the clock control according to the present invention is applied. Assume now that the processors 301 and 302 have caused a timeout between the first and second time interrupts.
Checking the processor 301 timeout time using the processor 301 clock, it is 0:58.
The timeout time of 02 is checked by the clock of the processor 302 and is set to 0:56. Ignoring communication delays and clock shifts caused by the clock slope of each processor, the clock value of processor 301 reaches 0:58, and the clock value (0:
58) to all processors. The time indicated by each processor when processor 301 sends out its clock value is shown in FIG. 3b. Figure 3b
As can be seen, all the times indicated by each processor are within the reception time window, so all processors receive clock information from processor 301. When each processor receives the clock value of processor 301, it calculates the difference between it and its own clock value. The difference value is 0 for processor 301, +6 for processor 302, and +6 for processor 303.
4.+8 for processor 304, processor 30
5 becomes +2. Subsequently, when the clock value of processor 302 reaches 0:56, a clock value is sent out, and all processors receive that clock value. The times indicated by each processor at this time are shown in FIG. 3(c). In this case as well, all the times indicated by each processor are within the reception time window, so all processors
Receive clock information from. The difference value for each processor is -6 for processor 301, 0 for processor 302, -2 for processor 303,
In the processor 304, it is +2, and in the processor 305, it is -4. Therefore, each processor takes the average value of the above-mentioned difference values, and that value is calculated by the processor 301.
-3 for processor 302, +3 for processor 303, +1 for processor 304, +5 for processor 304,
In the processor 305, it becomes -1. If the clock value shown above is adjusted based on the average value of the difference values, when the reception time window ends in each processor, the clock of processor 301 will be delayed by 3 minutes, and the clock of processor 302 will be delayed by 3 minutes. The clock of processor 303 is advanced by 3 minutes, the clock of processor 303 is advanced by 1 minute, and the clock of processor 304 is advanced by 5 minutes.
It can be seen that the processor 305 clock is advanced by one minute, and the clock of processor 305 is delayed by one minute, so that the clock values of all processors are adjusted to the same value. The above control is repeatedly performed by all processors according to time interrupts based on their own clocks and reception time windows. Of course, since the timeout times are random for each processor for each clock synchronization period, the processors and number of processors that send out their own clocks for each clock synchronization period are random as a result.

このようにすべてのプロセツサは、完全対等な
立場にあり全く同一のアルゴリズムを実施する。
この時、ランダムに選択されたプロセツサのみが
そのクロツク値を送出するので、従来に比べて通
信量を削減することができる。また、1つのプロ
セツサのみがシステムの時刻を制御するのではな
く、複数のプロセツサの平均時刻でシステム時刻
を制御することにより、耐障害性のある時刻制御
が可能となる。さらに、耐障害性の度合いは、タ
イムアウトを時刻割込み間で起こす確率を変える
ことで柔軟に制御することができる。また、クロ
ツク情報を送出する時刻がある範囲内(第1の時
刻割込みと第2の時刻割込みの間)でランダムで
あるから、複数のプロセツサが送出するクロツク
情報にてネツトワークが輻そう状態となる可能性
を軽減できる。
In this way, all processors are on completely equal footing and execute exactly the same algorithm.
At this time, only the randomly selected processor sends out its clock value, so the amount of communication can be reduced compared to the conventional method. Moreover, by controlling the system time based on the average time of a plurality of processors, rather than using only one processor to control the system time, fault-tolerant time control becomes possible. Furthermore, the degree of fault tolerance can be flexibly controlled by changing the probability that a timeout will occur between time-of-day interrupts. In addition, since the times at which clock information is sent are random within a certain range (between the first time interrupt and the second time interrupt), the network is likely to be congested due to clock information sent by multiple processors. It can reduce the possibility of

(発明の詳細な説明) 第1図a,bに本発明の方式を実現するために
各プロセツサにて実行される制御の一フローチヤ
ート例を示す。第1図(a)はクロツク情報の送信制
御を示すフローチヤート例であり、第1図bはク
ロツク情報の受信制御を示すフローチヤート例で
ある。まず第1図aの送信制御フローチヤートの
説明を行なう。各プロセツサでは、ブロツク10
0にて第1の時刻割込みを検出すると、ブロツク
101にてタイマを起動する。102のブロツク
では第2の時刻割込みの発生を検出し、もし時刻
割込みを検出すればこの同期制御期間での送信制
御を終了し(即ちこの期間ではクロツク情報送出
プロセツサにはならなかつた。)、ブロツク100
に戻り次の同期制御期間での第1の時刻割込みを
待つ。もしブロツク102にて第2の時刻割込み
を検出しなかつたら、ブロツク103に進みセツ
トしたタイマがタイムアウトしたかどうかを検出
する。もしタイムアウトしていなければ再びブロ
ツク102に戻り第2の時刻割込みの検出判定を
行なう。即ち、ブロツク102とブロツク103
のループは、第2の時刻割込みかタイムアウトの
どちらかを検出するまで続き、ブロツク103に
てタイムアウトを検出すると(このとき、第2の
時刻割込みが発生する前にタイムアウトを検出し
たことになる)、ブロツク104にてタイムアウ
トが発生した時刻を刻印したクロツク情報が全て
のプロセツサに送出され(即ちこのクロツク同期
制御期間でクロツク情報送出プロセツサとなつ
た。)、この同期制御期間での送信制御を修了し、
ブロツク100に戻り次の同期制御期間での第1
の時刻割込みを待つ。第1図bの受信制御では、
各プロセツサにてブロツク110で受信時間窓開
始を検出すると、ブロツク111のクロツク情報
の受信を行なう。続くブロツク112にて受信し
たクロツク値と自クロツク値との差分を算出し格
納する。ブロツク113では受信時間窓が終了し
たかどうかの判定を行ない、終了していなければ
再びクロツク情報の受信を行ない、このループは
受信時間窓が終了するまで繰り返し行なわれる。
ブロツク113にて受信時間窓が終了したことを
検出すると、ブロツク114に行き、受信時間窓
が開いているときに受信した全てのクロツク情報
と自己のクロツク値との差分(ブロツク112に
て求まつている。)の平均値を算出する。続くブ
ロツク115では、算出されたΔの正負により制
御のスイツチを行ない、もしΔが正ならばブロツ
ク116にて自クロツク値にΔを加算して自クロ
ツクの調整を行なう。もしΔが負ならば、ブロツ
ク117にて自クロツクをΔだけ停止させて自ク
ロツクの調整を行なう。ブロツク116あるいは
117の処理が終了すると、この同期制御期間で
の受信処理を終了し、ブロツク110に戻り次の
クロツク同期制御期間での受信制御を開始するた
めの受信時間窓開始を待つ。
(Detailed Description of the Invention) FIGS. 1a and 1b show an example of a flowchart of control executed by each processor to implement the method of the present invention. FIG. 1(a) is an example of a flowchart showing control of transmission of clock information, and FIG. 1b is an example of a flowchart showing control of reception of clock information. First, the transmission control flowchart shown in FIG. 1a will be explained. In each processor, block 10
When the first time interrupt is detected at time 0, a timer is started at block 101. The block 102 detects the occurrence of a second time interrupt, and if a time interrupt is detected, ends the transmission control during this synchronous control period (that is, it does not become a clock information sending processor during this period). block 100
The process returns to and waits for the first time interrupt in the next synchronous control period. If the second time interrupt is not detected in block 102, the process proceeds to block 103 to detect whether the set timer has timed out. If the timeout has not occurred, the process returns to block 102 to determine if a second time interrupt has been detected. That is, block 102 and block 103
This loop continues until either the second time interrupt or a timeout is detected, and when the timeout is detected in block 103 (at this time, the timeout is detected before the second time interrupt occurs). , in block 104, clock information stamped with the time when the timeout occurred is sent to all processors (that is, they became clock information sending processors during this clock synchronization control period), and the transmission control during this synchronization control period is completed. death,
Returning to block 100, the first
Wait for the time interrupt. In the reception control shown in Fig. 1b,
In each processor, when block 110 detects the start of the reception time window, block 111 receives clock information. In the subsequent block 112, the difference between the received clock value and the own clock value is calculated and stored. In block 113, it is determined whether the reception time window has expired or not. If not, the clock information is received again, and this loop is repeated until the reception time window has expired.
When block 113 detects that the receiving time window has ended, the block 114 goes to block 114 and calculates the difference between all the clock information received when the receiving time window was open and its own clock value (calculated in block 112). Calculate the average value of In the subsequent block 115, the control is switched depending on the sign of the calculated Δ. If Δ is positive, in block 116, Δ is added to the own clock value to adjust the own clock. If Δ is negative, in block 117 the own clock is stopped by Δ and the own clock is adjusted. When the processing in block 116 or 117 is completed, the reception processing in this synchronization control period is completed, and the process returns to block 110 to wait for the start of the reception time window for starting reception control in the next clock synchronization control period.

(発明の効果) このように、本発明のクロツク同期方式を用い
ることにより、マルチプロセツサシステムにおい
て、集中制御を行なうプロセツサを設けることな
く、すべてのプロセツサを対等に動作させて、各
プロセツサのクロツクを共通な時刻を指すように
制御することができる。クロツク同期制御を行な
うプロセツサは、同期制御期間ごとにランダムに
選択されることになり、特定のプロセツサの障害
がシステムの致命的な障害を与えることがなく高
い信頼性が確保できる。また、この信頼性の度合
いはタイムアウトが第1と第2の時刻割込みの間
に入る確率を制御することで柔軟に変えることが
可能である。さらに、固定の数のプロセツサが各
同期制御期間毎に選択されるのではなく、同期制
御用にクロツクを送出するプロセツサ数もランダ
ムであり、各同期制御期間毎に平均値として与え
られるので、制御にともなうデツドロツク状態を
回避することが容易である。また、全てのプロセ
ツサのクロツク値を用いて同期制御を行なうもの
ではなく、部分プロセツサ集合のクロツク値を用
いて制御がなされるので、プロセツサが増えた場
合にも同期制御に要する処理時間が極端に増大す
ることはない。さらには、クロツク情報を送出す
るタイミングが第1および第2の時刻割込みの間
でランダムに分布することになるので、クロツク
情報送出にともなうネツトワークの輻そう状態を
避けることが可能となる。
(Effects of the Invention) As described above, by using the clock synchronization method of the present invention, in a multiprocessor system, all processors can be operated equally, and each processor's clock can be synchronized. can be controlled to point to a common time. The processors that perform clock synchronization control are randomly selected for each synchronization control period, and a failure in a particular processor will not cause a fatal failure of the system, ensuring high reliability. Furthermore, the degree of reliability can be flexibly changed by controlling the probability that a timeout will occur between the first and second time interrupts. Furthermore, instead of a fixed number of processors being selected for each synchronous control period, the number of processors that send out clocks for synchronous control is also random and given as an average value for each synchronous control period. It is easy to avoid the resulting deadlock situation. Furthermore, since synchronous control is not performed using the clock values of all processors, but is performed using the clock values of a partial processor set, the processing time required for synchronous control becomes extremely large even when the number of processors increases. It will not increase. Furthermore, since the timing of transmitting clock information is randomly distributed between the first and second time interrupts, it is possible to avoid network congestion caused by transmitting clock information.

以上のように本発明により得られる効果は大き
い。
As described above, the effects obtained by the present invention are significant.

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

第1図a,bは、本発明によるクロツク同期方
式の一実施例を示すフローチヤート、第2図は、
本発明によるクロツク同期方式の制御タイミング
チヤート、第3図a,b,cは発明の原理を説明
するためのマルチプロセツサシステムの一例およ
び各プロセツサの時刻例を示す図である。 図において、100〜104,110〜117
は制御ブロツク、301〜305はプロセツサ、
306はプロセツサ303とプロセツサ304間
の論理的な通信路を示す。
1a and 1b are flowcharts showing an embodiment of the clock synchronization method according to the present invention, and FIG.
Control timing charts of the clock synchronization system according to the present invention, FIGS. 3a, 3b, and 3c are diagrams showing an example of a multiprocessor system and an example of the time of each processor for explaining the principle of the invention. In the figure, 100-104, 110-117
is a control block, 301 to 305 are processors,
306 indicates a logical communication path between the processor 303 and the processor 304.

Claims (1)

【特許請求の範囲】 1 n個のプロセツサからなるマルチプロセツサ
システムのクロツク同期方式において、前記各プ
ロセツサは時刻を示すクロツクとランダム時間を
計測するタイマと第1の時刻割込みと第2の時刻
割込みを発生する手段とを具備し、該タイマはあ
らかじめ定められた時間範囲内でのランダムな時
間を計測後タイムアウトし、各プロセツサでは、
第1の時刻割込みが生起する毎に前記タイマを起
動し、タイムアウトが発生した時刻が第1の時刻
割込みと第2の時刻割込みの間に入つていれば、
前記タイムアウトが発生した時刻に全てのプロセ
ツサに対して自己のクロツクを送出し、また各プ
ロセツサでは第1および第2の時刻割込みを含む
時間窓を設けて、該時間窓の間に到着した全ての
クロツク情報に基づき各自のクロツクを制御する
ことを特徴とするマルチプロセツサシステムにお
けるクロツク同期方式。 2 前記各プロセツサのクロツク制御において、
前記受信した全てのクロツク情報の平均時刻が、
自分のクロツクの示す時刻よりもΔ進んでいる場
合は自分のクロツクにΔを加算し、前記平均時刻
が自分のクロツクの示す時刻よりもΔ遅れている
場合は、前記タイマが時間Δの経過を通知するま
で自分のクロツクを停止させることを特徴とする
特許請求の範囲第1項記載のマルチプロセツサシ
ステムにおけるクロツク同期方式。
[Claims] In a clock synchronization method for a multiprocessor system consisting of 1 n processors, each processor has a clock indicating time, a timer measuring random time, a first time interrupt, and a second time interrupt. , the timer times out after measuring a random time within a predetermined time range, and each processor has:
If the timer is started every time the first time interrupt occurs, and the time when the timeout occurs is between the first time interrupt and the second time interrupt,
It sends its own clock to all processors at the time when the timeout occurs, and each processor has a time window that includes the first and second time interrupts so that all processors that arrive during that time window A clock synchronization method in a multiprocessor system characterized by controlling each clock based on clock information. 2. In clock control of each processor,
The average time of all the received clock information is
If the average time is Δ ahead of the time indicated by your own clock, Δ is added to your clock; if the average time is Δ behind the time indicated by your own clock, the timer calculates the elapsed time Δ. A clock synchronization method in a multiprocessor system according to claim 1, characterized in that its own clock is stopped until notification is given.
JP62276391A 1987-10-30 1987-10-30 Clock synchronizing system for multiprocessor system Granted JPH01116862A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62276391A JPH01116862A (en) 1987-10-30 1987-10-30 Clock synchronizing system for multiprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62276391A JPH01116862A (en) 1987-10-30 1987-10-30 Clock synchronizing system for multiprocessor system

Publications (2)

Publication Number Publication Date
JPH01116862A JPH01116862A (en) 1989-05-09
JPH0528867B2 true JPH0528867B2 (en) 1993-04-27

Family

ID=17568758

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62276391A Granted JPH01116862A (en) 1987-10-30 1987-10-30 Clock synchronizing system for multiprocessor system

Country Status (1)

Country Link
JP (1) JPH01116862A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5068877A (en) * 1990-04-02 1991-11-26 At&T Bell Laboratories Method for synchronizing interconnected digital equipment
JP5441776B2 (en) * 2010-03-17 2014-03-12 三菱電機株式会社 Ring-shaped synchronous network system

Also Published As

Publication number Publication date
JPH01116862A (en) 1989-05-09

Similar Documents

Publication Publication Date Title
US8601165B2 (en) Method for synchronization in networks
US6199169B1 (en) System and method for synchronizing time across a computer cluster
Cristian et al. Clock synchronization in the presence of omission and performance failures, and processor joins
US4746920A (en) Method and apparatus for clock management
US4531185A (en) Centralized synchronization of clocks
Arvind Probabilistic clock synchronization in distributed systems
US4937741A (en) Synchronization of fault-tolerant parallel processing systems
EP0135764B1 (en) Synchronization of clocks in a distributed computing network
KR101109980B1 (en) Facilitating synchronization of servers in a coordinated timing network
EP2255264B1 (en) Synchronizing clocks in an asynchronous distributed system
Du et al. Clock-RSM: Low-latency inter-datacenter state machine replication using loosely synchronized physical clocks
Dunigan Hypercube clock synchronization
CN110492967A (en) A kind of method for synchronizing time, trunking and device
JPH0528867B2 (en)
JPH02114360A (en) Clock synchronizing method for multiprocessor system
de Azevedo et al. Multistep interactive convergence: An efficient approach to the fault-tolerant clock synchronization of large multicomputers
JPH02114359A (en) Clock synchronizing method for multiprocessor system
JPH0528866B2 (en)
JPH0528864B2 (en)
Li et al. A high-accuracy clock synchronization method in distributed real-time system
EP0223031A2 (en) Clock synchronisation in a distributed processing system
JPH0528863B2 (en)
Clément et al. Traces synchronization in distributed networks
Mishra et al. The timewheel group membership protocol
JPH01270119A (en) Clock synchronizing system in multiprocessor system