JPS6339038A - Process synchronizing method - Google Patents

Process synchronizing method

Info

Publication number
JPS6339038A
JPS6339038A JP18244686A JP18244686A JPS6339038A JP S6339038 A JPS6339038 A JP S6339038A JP 18244686 A JP18244686 A JP 18244686A JP 18244686 A JP18244686 A JP 18244686A JP S6339038 A JPS6339038 A JP S6339038A
Authority
JP
Japan
Prior art keywords
token
processes
ownership
time
state
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.)
Pending
Application number
JP18244686A
Other languages
Japanese (ja)
Inventor
Satoshi Hasegawa
聡 長谷川
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 JP18244686A priority Critical patent/JPS6339038A/en
Publication of JPS6339038A publication Critical patent/JPS6339038A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system

Abstract

PURPOSE:To decrease the past state value to be stored in a process by circulating the token ownership among plural processes that proceed their processings with mutual exchange of message and rolling back the ownership to a stage preceding by a single token cycle by detecting a fault in a single token cycle. CONSTITUTION:Each process receives a token T via a control block 100 and decides via a control block 101 whether its own process is equal or not to a process having the next token ownership. If so (YES), it is decided that the abnormality exists. In such a case, a token owner process turns the value of a time stamp into the value older by a single token cycle via a control block 107. Simultaneously, a system state variable is also set its past state to set a roll-back processing request for the request of a retrial.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、複数のプロセスがお互いにメツセージを交換
しながら処理を進めていくシステムにおけるプロセスの
同期方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a method for synchronizing processes in a system in which a plurality of processes proceed with processing while exchanging messages with each other.

〔従来技術とその問題点〕[Prior art and its problems]

複数のプロセスがお互いにメツセージを交換しながら処
理を進めていくシステムにおけるプロセス同期方法には
大きく分けて2通りある。1つはタイム・インデペンデ
ント(Tinge−Independent)型のプロ
セス同期方法、もう1つはタイム・デペンデント(Ti
me−Dependent)型のプロセス同期方法であ
る。ここでプロセスとは1つの実行中プログラム単位と
考えることにする。タイム・インデペンデント型のプロ
セス同期方法は、メツセージを送るとそれに対する送達
確認情報(ACK>を受けとることで送受間プロセスの
同期をとるものである。この方法はメツセージ交換型の
プロセス同期の典型的な方法として知られているが、障
害時の回復が困難となる点、また多プロセスでのコマン
ド実行に矛盾が生じることがある点などの問題点がある
。この矛盾が生じる場合に関しては、例えば次のような
例を考えればわかる。今、航空機の座席予約を行なうた
めの分散型データベースシステムを考える。プロセスA
(ユーザーA)とプロセスB(ユーザーB)とがほぼ同
時に分散データベースX、Yをアクセスし、座席予約を
行なおうとしている。ここで、分散データベースX、Y
には全く同じ座席予約状況を示す情報が格納されている
とする。この場合、伝送路遅延のバラつきあるいは処理
時間のバラつきからデータベースX、Yに到着するプロ
セスA、Bからのメツセージは順序関係が一意に決まら
ない。即ち、データベースXにはA、Bの順序で到着し
、データベースYにはB、Aの順序で到着することが起
こり得る。この時、座席が1席しか空いていないとする
と、データベースXではユーザーAに席を与え、データ
ベースYではユーザーBに席を与える状態となり、本来
同じ座席予約状況を示す情報が格納されている筈のデー
タベースに違う情報が入り矛盾を生じてしまう。
There are broadly two types of process synchronization methods in a system where multiple processes proceed with processing while exchanging messages with each other. One is a time-independent (Tinge-Independent) type process synchronization method, and the other is a time-independent (Tinge-Independent) type process synchronization method.
This is a process synchronization method of the me-Dependent type. Here, a process is considered to be one executing program unit. A time-independent process synchronization method synchronizes processes between the sender and receiver by sending a message and receiving acknowledgment information (ACK) for the message. This method is a typical message exchange type process synchronization method. However, there are problems such as difficulty in recovering from failures and inconsistencies in command execution in multiple processes.In cases where this inconsistency occurs, For example, consider the following example.Now consider a distributed database system for making airline seat reservations.Process A
(User A) and Process B (User B) are attempting to access distributed databases X and Y almost simultaneously and make seat reservations. Here, the distributed databases X, Y
Assume that information indicating exactly the same seat reservation status is stored in In this case, the order of messages from processes A and B arriving at databases X and Y cannot be uniquely determined due to variations in transmission path delay or processing time. That is, it may happen that the data arrives at database X in the order of A and B, and the data arrives at database Y in the order of B and A. At this time, if only one seat is available, database X will give a seat to user A, database Y will give a seat to user B, and information indicating the same seat reservation status should originally be stored. Different information is entered into the database, resulting in inconsistencies.

次に、タイム・デペンデント型のプロセス同期方法はニ
ーシーエム・トランズアクションズ・オン・プログラミ
ング・ラングエジズ・アンド・システムズ、ボリューム
6、ナンバー2.エイプリル1984 (A CM T
ransactions on Pro3ram+s5
−1n Languages and Systems
、Vol、6.Na2.April 1984)に記載
されているランボート・エル(Lampot。
Next, the time-dependent process synchronization method is described in NCM Transactions on Programming Languages and Systems, Volume 6, Number 2. April 1984 (A CM T
transactions on Pro3ram+s5
-1n Languages and Systems
, Vol. 6. Na2. Lampot (April 1984).

L〉著の“ユージング・タイム・インステッド・ブ・タ
イムアウト・フォー・フォールトトレラント・デイスト
リビューテッド・システムズ(Using Time 
In5tead of Timeout for Fa
ult−tolerant Distributed 
5yste+ms)にあるように、各プロセスがほとん
ど同じ時刻を指すクロックをそれぞれ有しており、プロ
セス間の送受信コマンド実行は、このクロックに基づい
て行なわれる。
“Using Time Instead of Timeout for Fault-Tolerant Distributed Systems” by L.
In5tead of Timeout for Fa
Ultimate-tolerant Distributed
5yste+ms), each process has a clock that points to almost the same time, and execution of commands to send and receive between processes is performed based on this clock.

即ち、一定時間間隔おきに、上記送受信あるいはコマン
ド実行の起動ががけられるわけである。この動作原理を
第5図を用いて説明する。図において、横軸は時間tを
示す。時刻T、T十Δ、T+2Δにて各プロセスのメツ
セージ送受信、コマンド実行の起動がかけられる。ここ
でΔはその時間内にメツセージの送受信が終了するに十
分なだけの時間で、あらかじめシステムに設定された値
である。図においては時刻TとT+Δの間にプロセス1
とプロセスnがそれぞれメツセージc1とメツセージC
nとを全てカプロセスに送信した例を示している。ここ
でプロセス2ではメツセージC1が先に受信され、次に
メツセージc、、が受信されている。しかし、プロセス
3ではメツセージCnが先に受信され、次にメツセージ
CIが受信されている。このような場合、タイム・イン
デペンデント型のプロセス同期方法であると、プロセス
2ではC,、C,の順に実行され、プロセス3ではC,
、C,の順に実行されて、先程述べたような処理矛盾が
生じる。しかし、タイム・デペンデントのプロセス同期
方法ではコマンド実行は次のタイミング、即ちT+Δの
時刻まで待ってからΔの間に受信された全てのメツセー
ジに対して一括して行なわれるので、例えばコマンドの
うち送信したプロセスの番号の若い方から実行するとい
う規則を全てのプロセスに持たせることで、全てのプロ
セスでC1,C,の順にコマンド実行させることが可能
となり、矛盾ない処理が実現できる。また、障害発生時
においてもタイム・デペンデン1〜型のプロセス同期方
法では同期のとれたクロックを全てのプロセスが有して
いるので、全てのプロセスをある絶対時刻の矛盾のない
状態に戻す制御が容易に行なえる。ここで6時間内に受
信できなかったメツセージ、即ち遅延メツセージは棄却
されるものとする。この遅延メツセージの検出は、メツ
セージにタイムスタンプを付加することで容易にできる
ものである。この際の現象は障害発生と等価となり回復
制御かなされる。ところで、このタイム・デペンデント
型のプロセス同期方法は、各プロセスが有しているクロ
ックを精密に調整し、各クロックが示す絶対時刻がほと
んど等しくなるようにする必要がある。即ち、Δに比較
して各クロックの差が十分小さくなるようにしなければ
ならない。この条件が満たされないとΔを非常に大きく
とる必要が生じ、システムの効率が大きく損われる。し
かし、このクロックの調整は伝送路の障害、遅延のバラ
つき等を考慮すると困難なものとなる。
That is, the above-mentioned transmission/reception or command execution is started at regular time intervals. The principle of this operation will be explained using FIG. In the figure, the horizontal axis indicates time t. At times T, T+Δ, and T+2Δ, each process starts sending and receiving messages and executes commands. Here, Δ is a value that is set in advance in the system and is sufficient time for message transmission and reception to be completed within that time. In the figure, process 1 is shown between time T and T+Δ.
and process n are message c1 and message C, respectively.
An example is shown in which all of Here, in process 2, message C1 is received first, followed by messages c, . However, in process 3, message Cn is received first, followed by message CI. In such a case, if the time-independent process synchronization method is used, process 2 executes C, , C, in the order, and process 3 executes C, , C,
, C, are executed in this order, resulting in a processing contradiction as described earlier. However, in the time-dependent process synchronization method, command execution waits until the next timing, that is, time T + Δ, and then executes all messages received during Δ at once. By providing all processes with a rule that commands are executed starting from the process with the lowest number, it is possible to have all processes execute commands in the order of C1 and C, and consistent processing can be achieved. In addition, even when a failure occurs, all processes have synchronized clocks in the time dependence 1~ type process synchronization method, so it is possible to control all processes to return to a consistent state at a certain absolute time. Easy to do. Here, messages that cannot be received within 6 hours, that is, delayed messages, are discarded. This delayed message can be easily detected by adding a time stamp to the message. The phenomenon at this time is equivalent to the occurrence of a failure, and recovery control is performed. By the way, in this time-dependent process synchronization method, it is necessary to precisely adjust the clocks possessed by each process so that the absolute times indicated by each clock are almost equal. That is, the difference between each clock must be made sufficiently small compared to Δ. If this condition is not met, it will be necessary to make Δ very large, and the efficiency of the system will be greatly impaired. However, adjusting this clock becomes difficult when taking into account failures in transmission paths, variations in delay, etc.

〔問題点を解決するための手段〕[Means for solving problems]

本発明によれば、お互いにメツセージを交換しながら処
理を進めていく複数のプロセスの中で唯一のプロセスが
トークン所有権を有し、該トークン所有権は前記複数の
プロセス内をある一定時間毎に受け渡されていき論理的
なトークン所有権の巡回ループを形成し、即ちトークン
所有権を有するプロセスは前記一定時間経過後にトーク
ンを全てのプロセスに送出すると共に前記トークン所有
権を次のプロセスに渡し、トークン所有権が第1のプロ
セスから順次骨は渡されていき再び該第1のプロセスに
戻ってくるまでの時間をトークン周期と呼び、各プロセ
スでは該トークンを受信するとただちにメツセージの送
信、受信メツセージ中のコマンドの実行を開始し、前記
トークン所有権を有するプロセスではシステムの状態が
正常か異常かを判断し、システム状態の異常を検出した
場合は全てのプロセスを1トークン周期前の状態に戻す
か、あるいは、システム状態の異常を検出しかつ過去1
トークン周期内にシステム状態の異常を検出していない
場合には全てのプロセスを1トークン周期前の状態に戻
し、システム状態の異常を検出しかつ過去を1トークン
周期内にシステム状態の異常を検出している場合は、前
の異常検出時に戻った状態に全てのプロセスを戻し、各
プロセスではメツセージの再送信、受信コマンドの再実
行をして障害回復を行なうことを特徴とするプロセス同
期方法を得ることができる。
According to the present invention, among a plurality of processes that proceed with processing while exchanging messages with each other, only one process has ownership of a token, and the ownership of the token is transmitted within the plurality of processes at a certain time interval. A logical token ownership circular loop is formed, that is, the process that has the token ownership sends the token to all processes after the specified period of time has elapsed, and transfers the token ownership to the next process. The time it takes for token ownership to be handed over from the first process and returned to the first process is called the token cycle, and each process immediately sends a message upon receiving the token. Starts execution of the command in the received message, and the process that owns the token determines whether the system status is normal or abnormal, and if an abnormality is detected in the system status, all processes are returned to the state from one token period ago. or detect an abnormality in the system status and
If no abnormality in the system state is detected within the token period, return all processes to the state one token period ago, detect an abnormality in the system state, and detect an abnormality in the system state within one token period. If so, use a process synchronization method that returns all processes to the state they were in when the previous error was detected, and each process performs failure recovery by retransmitting messages and re-executing received commands. Obtainable.

〔発明の原理〕[Principle of the invention]

第2図、第3図及び第4図を用いて、本発明の方法の原
理を説明する。第2図は、各プロセスでのメツセージ送
出のタイミング、および受信メツセージ中のコマンド実
行のタイミングを決定するトークンの受け渡し方法を示
している。前記トークンを所有するトークン所有プロセ
スは、図に示すように時間的に順次移動していく。図に
おいてプロセス200 (1)〜200 (6)が全プ
ロセスを構成し、矢印がトークン所有権の移動方向を示
し、黒丸を付したプロセスが、ある時刻でのトークン所
有プロセスである。トークン所有プロセスは前述したよ
うに、各プロセスの処理を起動するためにトークンを全
プロセスに発行し、トークン所有権を次プロセスに受け
渡す。このトークン所有権はある時刻で見ると、唯一つ
のプロセスが有している。本発明の動作のタイミングチ
ャートを第3図に示す。図において横軸は時間tを示す
The principle of the method of the present invention will be explained using FIGS. 2, 3, and 4. FIG. 2 shows a method of passing tokens that determines the timing of message transmission in each process and the timing of command execution in a received message. The token ownership process that owns the token moves sequentially in time as shown in the figure. In the figure, processes 200 (1) to 200 (6) constitute all processes, arrows indicate the direction of movement of token ownership, and processes with black circles are token ownership processes at a certain time. As described above, the token-owning process issues tokens to all processes in order to start the processing of each process, and transfers token ownership to the next process. This token ownership is held by only one process at a given time. A timing chart of the operation of the present invention is shown in FIG. In the figure, the horizontal axis indicates time t.

またトークンの受け渡し間隔Tpは、その時間内にトー
クンの送受信及びメツセージの送受信処理が終了するに
十分なだけの時間で、あらかじめのシステムに設定され
た値である。本図においては、第1周期でプロセス1が
トークン所有プロセスであり、第2周期の始まりを示す
トークンTK1を送信する。プロセス2からプロセスn
ではトークンTKIを受信するとメツセージ送出、受信
コマンド実行が起動される。本例では第2周期でプロセ
ス1とプロセスnとがそれぞれメツセージC1,Cnを
送信している。これらメツセージは間隔Tp内に全ての
プロセスに行きわたる。第2周期ではトークン所有権は
予め決められた順序に従がい、例えば本例ではプロセス
2に受け渡される。よって、第3周期の始まりを示すト
ークンTK2は図に示すようにプロセス2から送信され
、第3周期では各プロセスにトークンを受信すると、第
2周期で送出されたメツセージC1及びC,lが実行さ
れる。例えば、受信コマンドのうち送信したプロセス番
号の若い方から実行する、という規則を全てのプロセス
に持たせることで、全てのプロセスにてC,、C,の順
にコマンド実行させることが可能となり、いわゆるコン
カレンシイ(Concurrency)制御が簡単に実
現できる。各プロセスでトークンを受信すると、例えば
図の第3周期では第2周期で送出されたメツセージ中の
コマンドが実行され、第2周期より前に送出され、大き
な遅延の後に到着したメツセージ中のコマンドは、タイ
ムスタンプ値を見ることでチエツクされ、実行されずに
棄却される。このようにすることで上記のコンカレンシ
イ制御の無矛盾性は保たれるが、プロセス障害が発生す
ることになる。即ち、遅延メツセージに対するこの棄却
操作により、例えばメツセージが失なわれたりプロセス
に障害が生じたりしたことと等価な現象が生起されるわ
けである。次にこのようなプロセス障害に対する制御機
能を図を用いて説明する。
Further, the token delivery interval Tp is a value set in advance in the system, and is sufficient time for the token transmission/reception and message transmission/reception processing to be completed within that time. In this figure, process 1 is the token owning process in the first cycle, and transmits a token TK1 indicating the start of the second cycle. process 2 to process n
When the token TKI is received, message sending and receiving command execution are started. In this example, process 1 and process n transmit messages C1 and Cn, respectively, in the second period. These messages reach all processes within the interval Tp. In the second cycle, token ownership follows a predetermined order, eg, to process 2 in this example. Therefore, the token TK2 indicating the start of the third cycle is sent from process 2 as shown in the figure, and when each process receives the token in the third cycle, the messages C1 and C,l sent in the second cycle are executed. be done. For example, by setting a rule for all processes to execute received commands starting from the one with the lowest sent process number, it is possible to have all processes execute commands in the order of C, C, and so on. Concurrency control can be easily realized. When each process receives a token, for example, in the third period in the figure, the command in the message sent in the second period is executed, and the command in the message sent before the second period and arriving after a long delay is executed. , is checked by looking at the timestamp value, and is rejected without being executed. By doing this, the consistency of the concurrency control described above can be maintained, but process failures will occur. That is, this rejection operation for a delayed message causes a phenomenon equivalent to, for example, a message being lost or a failure occurring in a process. Next, a control function for such a process failure will be explained using a diagram.

トークン所有プロセスは、前述したようなトークンの送
出、受け渡しを行なう制御と共に、システムの障害検出
/回復制御機能を併せ有している。このシステム障害検
出/回復制御を第4図を用いて説明する。第4図(a>
はタイムスタンプt sの推移を示している。即ち本図
ではT1からT16まで、時間の推移と共にタイムスタ
ンプ値が増加していくわけである。
The token ownership process has a system failure detection/recovery control function as well as control for sending and receiving tokens as described above. This system failure detection/recovery control will be explained using FIG. 4. Figure 4 (a>
indicates the transition of the timestamp ts. That is, in this figure, the timestamp value increases with time from T1 to T16.

今、総プロセス数Nを5とし、ts=Tgの時刻にプロ
セス障害を検出したものとする。この時、1トークン周
期前の状態に戻るので、総プロセス数が5であることが
らtS=T4の状態にロールバック(roll−bac
k)する。なお、トークン周期とは、トークン所有権が
第1のプロセスから順次受け渡されていき再び第1のプ
ロセスに戻ってくるまでの時間である。また、このロー
ルバックとは、過去の状態にタイムスタンプ値、システ
ム状態を戻し再試行を行なわせることを意味する。
Now, it is assumed that the total number of processes N is 5 and that a process failure is detected at time ts=Tg. At this time, the state returns to the state one token period ago, so since the total number of processes is 5, the state is rolled back (roll-back) to the state of tS=T4.
k) Do. Note that the token cycle is the time it takes for token ownership to be sequentially transferred from the first process until it returns to the first process. Moreover, this rollback means returning the timestamp value and system state to the past state and causing a retry.

この状態で再びt、=T4から処理を再試行し、し5=
T7で再びプロセス障害を検出したとする。特許請求の
範囲(1)で記載した発明では、1トークン周期前の状
態にロールバックするので、ts=T2の状態に戻り、
特許請求の範囲(2)で記載された発明では、過去1ト
ークン周期内にロールバックを行なっているので、前に
ロールバックした状態、即ち本例ではts=T4の状態
に戻り、再試行がなされる。以上述べた障害発生例に関
し、第4図(b)には本発明の特許請求の範囲(1)に
対応する復旧状態推移を、第4図(c)には本発明の特
許請求の範囲(2)に対応する復旧状態推移を示す。本
発明の方法では、トークン所有権を全てのプロセス間で
巡回させることで、各プロセスは必ず1トークン周期内
で1回1ヘークン所有プロセスになることができる。ト
ークン所有プロセスがシステム状態をチエツクして障害
検出を行なうので、このトークン所有権の巡回は、障害
が発生してから確実に1トークン周期内で障害検出が可
能であることを意味しており、信頼性高いプロセス同期
方法を得ることが可能となる。
In this state, the process is retried from t,=T4, and then 5=
Assume that a process failure is detected again at T7. In the invention described in claim (1), since the state is rolled back to the state one token cycle ago, the state returns to ts=T2,
In the invention described in claim (2), since the rollback was performed within one token cycle in the past, the state returned to the previously rolled back state, that is, the state of ts=T4 in this example, and the retry is performed. It will be done. Regarding the failure occurrence example described above, FIG. 4(b) shows the recovery state transition corresponding to claim (1) of the present invention, and FIG. 4(c) shows the transition of the recovery state corresponding to claim (1) of the present invention. The recovery state transition corresponding to 2) is shown. In the method of the present invention, by circulating token ownership among all processes, each process can always become a uniquely owning process once within one token cycle. Since the token ownership process checks the system status to detect failures, this cycle of token ownership means that failures can be reliably detected within one token cycle after a failure occurs. It becomes possible to obtain a highly reliable process synchronization method.

〔実施例] 第1図に本発明の実施例を示す。第1図(a)は特許請
求の範囲<1)に記載された発明の実施例における、ト
ークン所有プロセスの処理アルゴリズムを示す。各プロ
セスでは制御ブロック100でトークンT (t s 
、 St 、 CNT)を受信すると、自プロセスが次
にトークン所有権を有するプロセスか否かを制御ブロッ
ク101で判定する。
[Example] FIG. 1 shows an example of the present invention. FIG. 1(a) shows the processing algorithm of the token ownership process in the embodiment of the invention described in claim <1). In each process, a token T (t s
, St, CNT), the control block 101 determines whether the own process is the next process to have ownership of the token.

ここで、トークンの中のタイムスタンプtsは、正常動
作時にはトークン所有権が受け渡される毎に1ずつ増加
していく。またStはシステム状態変数であり、CNT
は制御変数である。制御ブロック101での判定がYE
Sの場合にトークン所有権を有するプロセスの処理に入
るわけで、制御ブロック102にて前述したタイムスタ
ンプ及びシステム状態変数などをチエツクすることでシ
ステムの異常を検出する。もし、システムの異常がなけ
れば、即ち、制御ブロック102での判定結果がNoの
場合は、制御ブロック103でメツセージ送出コマンド
実行が起動され、また他プロセスからのメツセージの受
信を行なうと共にシステム状態変数が更新される。制御
ブロック103での一連の処理はトークン所有プロセス
も一般のプロセスも同じであり、これをトークン間隔の
処理と呼ぶ。これらのトークン間隔処理が終了すると、
トークン所有プロセスは制御ブロック104にてタイム
スタンプの値を1増加し、システム状態変数を新しい値
に更新し、またCNTにNULLなる値を入れる。制御
ブロック105で、次の1・−クン制御プロセスにトー
クンを受け渡すべき時刻になると、即ちトークンを前の
トークン所有プロセスから受けとり、間隔Tpの時間経
過すると、トークン所有プロセスは制御ブロック106
でこれらの値を変数として有するトークンを全てのプロ
セスに送出し、トークン所有権を放棄する。勿論トーク
ンには次のトークン所有プロセスのアドレスを示す変数
が入っているので、このトークンを受けた全てのプロセ
スの内、次1ヘークン所有プロセスと指定されたプロセ
スが、次のトークン間隔処理に対するトークン所有プロ
セスのアルゴリズムを実行するわけである。制御ブロッ
ク102にてシステム異常が検出された場合、即ち、検
出結果がYESの場合には、トークン所有プロセスは制
御ブロック107でタイムスタンプの値をN戻しくここ
でNは全てのプロセス数になるのでタイムスタンプをN
戻すことは1トークン周期過去のタイムスタンプ値にす
ることになる)、システム状態変数を1トークン周期過
去の値にすると共にCNTに、過去の状態に戻り再試行
を要請するための、即ちロールパック処理要求コマンド
をセットする。その後、制御ブロック105にてTpの
時間経過すると、これらの変数を有するトークンを全て
のプロセスに送出する。
Here, the time stamp ts in the token increases by 1 each time token ownership is transferred during normal operation. Also, St is a system state variable, and CNT
is the control variable. The determination in control block 101 is YE.
In the case of S, the processing of the process having the token ownership is started, and a system abnormality is detected by checking the above-mentioned timestamp and system state variables in the control block 102. If there is no abnormality in the system, that is, if the determination result in control block 102 is No, then message sending command execution is started in control block 103, messages are received from other processes, and system state variables are is updated. The series of processing in the control block 103 is the same for both the token possessing process and the general process, and is called token interval processing. Once these token interval operations are finished,
The token owning process increments the value of the timestamp by one at control block 104, updates the system state variable to the new value, and also places the value NULL in CNT. In control block 105, when it is time to transfer the token to the next 1-kun controlling process, i.e., after receiving the token from the previous token owning process and the interval Tp has elapsed, the token owning process transfers the token to control block 106.
sends a token with these values as variables to all processes and relinquishes ownership of the token. Of course, the token contains a variable that indicates the address of the next token-owning process, so of all the processes that received this token, the process designated as the next 1-hook-owning process receives the token for the next token interval process. It executes the algorithm of the owning process. If a system abnormality is detected in control block 102, that is, if the detection result is YES, the token owning process returns the timestamp value to N in control block 107, where N is the total number of processes. So the timestamp is N
(Reverting to a timestamp value that is one token cycle past), sets the system state variable to a value that is one token cycle past, and requests the CNT to return to the past state and retry, that is, roll pack. Set a processing request command. Thereafter, in control block 105, when the time Tp has elapsed, tokens having these variables are sent to all processes.

第1図(c)に特許請求の範囲(2)に記載された発明
の実施例におけるトークン所有プロセスの処理アルゴリ
ズムを示す。特許請求の範囲(1)及び(2)に記載さ
れた発明は、システム異常検出時の動作が異なるだけで
あるので、この動作についてのみ説明する。第1図(c
)に示すアルゴリズムの制御は、第1図(a>の制御ブ
ロック102でシステム異常が検出された場合、制御ブ
ロック107に代って処理されるものである。過去1ト
ークン周期内にシステム異常が検出され過去の状態に戻
り再試行がなされた否かのチエツクが制御ブロック12
0でなされる。もしなされていなければ第2図(a)の
制御ブロック107と同じ処理が行なわれ、もし過去を
1トークン周期内でロールパックがなされていると制御
ブロック121にて、タイムスタンプ値を前回ロールバ
ックした時点即ち現時点よりN′タイムスタンプ以前の
値にセットし、その時点の状態をシステム状態変数にセ
ットし、またCNTにN′ロールパックを入れる。以前
ロールバックした時点はシステム状態が正常である筈な
ので、この処理にても正常な過去の状態に戻ることが可
能である。
FIG. 1(c) shows a processing algorithm for the token ownership process in the embodiment of the invention set forth in claim (2). The inventions recited in claims (1) and (2) differ only in the operation upon detection of a system abnormality, so only this operation will be described. Figure 1 (c
) is executed in place of the control block 107 when a system abnormality is detected in the control block 102 of FIG. 1 (a). The control block 12 checks whether the detection has returned to the past state and a retry has been performed.
It is done with 0. If not, the same process as in control block 107 in FIG. The state at that time is set to a system state variable, and the N' roll pack is stored in CNT. Since the system state should have been normal at the time of the previous rollback, it is possible to return to the normal past state with this process as well.

第1図(b)にトークン所有プロセス以外のプロセスで
のトークン間隔処理を示す。制御ブロック101での判
定がNoの場合の処理として、まず制御ブロック110
にてトークンの中の変数CNTがNULLかロールパッ
クかをチエツクする。もしNULLであるならば、即ち
制御ブロック110の判定結果がYESの場合には制御
ブロック111にてメツセージ送出、コマンド実行が起
動され、他プロセスからの受信コマンドが実行され、シ
ステム状態変数の更新がなされる。その後、制御ブロッ
ク112でタイムスタンプの値を1増加し、制御ブロッ
ク100に移行し、次のトークン受信を待つ。また、制
御ブロック110の判定結果がNOの場合には制御ブロ
ック113にてタイムスタンプの値とシステム状態を、
トークン中の変数で示された過去の正常な状態の値に戻
すロールバック処理がなされる。
FIG. 1(b) shows token interval processing in a process other than the token owning process. As a process when the determination in the control block 101 is No, first the control block 110
Checks whether the variable CNT in the token is NULL or a role pack. If it is NULL, that is, if the determination result of control block 110 is YES, message sending and command execution are started in control block 111, commands received from other processes are executed, and system state variables are updated. It will be done. Thereafter, the control block 112 increments the time stamp value by 1, and the process moves to the control block 100 to wait for the next token to be received. Further, if the determination result of the control block 110 is NO, the control block 113 stores the time stamp value and the system state.
Rollback processing is performed to return to the past normal state value indicated by the variable in the token.

〔発明の効果〕〔Effect of the invention〕

本発明によれば従来のタイム・デペンデント型のプロセ
ス同期方法に必要なりロックの再同期をとる必要がなく
、現実的なプロセス同期方法が得られる。また、コンカ
レンシイ制御も容易に行なうことができる。更に、トー
クン所有権を巡回させていることから、障害が発生して
から確実に1トークン周期内で、この障害を検出するこ
とが可能であり、信頼性高いプロセス同期が可能である
。各プロセスに過去の状態を格納させておくことで、障
害検出時にロールバックさせることが可能となり、また
1トークン周期前の時点は、障害が発生してから1トー
クン周期内に検出が可能という性質より正常な状態であ
ることが保証されるので、この時点(1トークン周期前
)にロールバックさせ、処理の再試行を行なわせること
で障害の回復が可能となる。また、システム障害を検出
し、過去1 )−−クン周期内にロール−バックした場
合には、1トークン周期前に戻すのではなく、前にロー
ルバックした時点に戻すことで、各プロセスが格納すべ
き過去の状態の量を減らすことも可能である。
According to the present invention, there is no need to resynchronize locks, which is necessary in conventional time-dependent process synchronization methods, and a practical process synchronization method can be obtained. Furthermore, concurrency control can be easily performed. Furthermore, since token ownership is circulated, it is possible to reliably detect a failure within one token period after the failure occurs, and highly reliable process synchronization is possible. By storing the past state in each process, it is possible to rollback when a failure is detected, and the fact that a failure can be detected within one token cycle after it occurs is possible at the time one token cycle ago. Since a more normal state is guaranteed, failure recovery is possible by rolling back to this point (one token cycle earlier) and retrying the process. In addition, if a system failure is detected and a rollback is performed within the past 1)--kun period, each process is It is also possible to reduce the amount of past states to be used.

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

第1図(a>、(b)、(c)は、本発明の実施例にお
けるアルゴリズムを示す流れ図、第2図は本発明の方法
を実現するためのトークン所有権の巡回を示す説明図、
第3図は本発明の方法の原理を示すタイミングチャート
、第4図は本発明の方法における障害復旧方法を示す状
態推移図、第5図は従来タイム・デペンデント型のプロ
セス同期方法の原理を示すタイミングチャートである。 Tp・・・(トークンの)受け渡し間隔、TKI・・・
トークン、ts・・・タイムスタンプ、T1−T16・
・・タイムスタンプ値、N・・・総プロセス数、S、・
・・システム状態変数、CNT・・・制御変数、101
〜107.111〜113,120.121・・・制御
ブロック。 井 I 関し) 多 /  Tl!J(り 第 1 図(C) β   1 0   歯   目 で   1− −     声   H口) 勢               聾 )−)−け ド          )!l!)− )−−H
FIG. 1 (a>, (b), (c) is a flowchart showing the algorithm in the embodiment of the present invention, FIG. 2 is an explanatory diagram showing the circulation of token ownership for realizing the method of the present invention,
FIG. 3 is a timing chart showing the principle of the method of the present invention, FIG. 4 is a state transition diagram showing the failure recovery method in the method of the present invention, and FIG. 5 is a diagram showing the principle of the conventional time-dependent process synchronization method. This is a timing chart. Tp... (token) delivery interval, TKI...
Token, ts...Time stamp, T1-T16.
...Timestamp value, N...Total number of processes, S,...
...System state variable, CNT...Control variable, 101
〜107.111〜113,120.121...Control block. I Seki) Ta/Tl! J (Fig. 1 (C) β 1 0 Teeth Eye 1- - Voice H Mouth) Force Deaf)-)-Kedo)! l! )-)--H

Claims (2)

【特許請求の範囲】[Claims] (1)お互いにメッセージを交換しながら処理を進めて
いく複数のプロセスの中で唯一のプロセスがトークン所
有権を有し、該トークン所有権は前記複数のプロセス内
をある一定時間毎に受け渡されていき論理的なトークン
所有権の巡回ループを形成し、トークン所有権を有する
プロセスは前記一定時間経過後にトークンを全てのプロ
セスに送出すると共に前記トークン所有権を次のプロセ
スに渡し、トークン所有権が第1のプロセスから順次受
け渡されていき再び該第1のプロセスに戻ってくるまで
の時間をトークン周期とし、各プロセスでは該トークン
を受信するとただちにメッセージの送信、受信メッセー
ジ中のコマンドの実行を開始し、前記トークン所有権を
有するプロセスではシステムの状態が正常か異常かを判
断し、システム状態の異常を検出した場合は1トークン
周期前の状態に全てのプロセスを戻し、各プロセスでは
メッセージの再送信、受信コマンドの再実行をして障害
回復を行なうことを特徴とするプロセス同期方法。
(1) Among multiple processes that proceed with processing while exchanging messages with each other, only one process has ownership of the token, and the ownership of the token is passed between the multiple processes at regular intervals. The process that owns the token sends the token to all processes after the specified period of time has elapsed, passes the token ownership to the next process, and the process that owns the token sends out the token to all processes after the specified period of time has elapsed. The token period is the time it takes for the right to be passed from the first process to the time it returns to the first process.When each process receives the token, it immediately sends a message and executes the command in the received message. The process that starts execution and has ownership of the token determines whether the system status is normal or abnormal, and if an abnormality is detected in the system status, all processes are returned to the status one token cycle ago, and each process A process synchronization method characterized by performing failure recovery by retransmitting messages and re-executing received commands.
(2)お互いにメッセージを交換しながら処理を進めて
いく複数のプロセスの中で唯一のプロセスがトークン所
有権を有し、該トークン所有権は前記複数のプロセス内
をある一定時間毎に受け渡されていき論理的なトークン
所有権の巡回ループを形成し、トークン所有権を有する
プロセスは前記一定時間経過後にトークンを全てのプロ
セスに送出すると共に前記トークン所有権を次のプロセ
スに渡し、トークン所有権が第1のプロセスから順次受
け渡されていき再び該第1のプロセスに戻ってくるまで
の時間をトークン周期とし、各プロセスでは該トークン
を受信するとただちにメッセージの送信、受信メッセー
ジ中のコマンドの実行を開始し、前記トークン所有権を
有するプロセスではシステムの状態が正常が異常かを判
断し、システム状態の異常を検出しかつ過去1トークン
周期内にシステム状態の異常を検出していない場合は全
てのプロセスを1トークン周期前の状態に戻し、システ
ム状態の異常を検出しかつ過去1トークン周期内にシス
テム状態の異常を検出している場合は、前の異常検出時
に戻った状態に全てのプロセスを戻し、各プロセスでは
メッセージの再送信、受信コマンドの再実行をして障害
回復を行なうことを特徴とするプロセス同期方法。
(2) Among multiple processes that proceed with processing while exchanging messages with each other, only one process has ownership of the token, and the ownership of the token is passed between the multiple processes at regular intervals. The process that owns the token sends the token to all processes after the specified period of time has elapsed, passes the token ownership to the next process, and the process that owns the token sends out the token to all processes after the specified period of time has elapsed. The token period is the time it takes for the right to be passed from the first process to the time it returns to the first process.When each process receives the token, it immediately sends a message and executes the command in the received message. The process that starts execution and has ownership of the token determines whether the system state is normal or abnormal, and if an abnormality in the system state is detected and no abnormality in the system state has been detected within the past one token cycle. If all processes are returned to the state from one token cycle ago, and an abnormality in the system state is detected, and an abnormality in the system state has been detected within the past one token cycle, all processes are returned to the state they were in when the previous abnormality was detected. A process synchronization method characterized in that processes are returned and each process performs failure recovery by retransmitting messages and re-executing received commands.
JP18244686A 1986-08-01 1986-08-01 Process synchronizing method Pending JPS6339038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18244686A JPS6339038A (en) 1986-08-01 1986-08-01 Process synchronizing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18244686A JPS6339038A (en) 1986-08-01 1986-08-01 Process synchronizing method

Publications (1)

Publication Number Publication Date
JPS6339038A true JPS6339038A (en) 1988-02-19

Family

ID=16118405

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18244686A Pending JPS6339038A (en) 1986-08-01 1986-08-01 Process synchronizing method

Country Status (1)

Country Link
JP (1) JPS6339038A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628199A (en) * 1990-03-05 1994-02-04 Internatl Business Mach Corp <Ibm> Synchronizing method of parallel processing
JP2015067252A (en) * 2013-10-01 2015-04-13 株式会社日立製作所 Signal security system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59158161A (en) * 1983-02-14 1984-09-07 プライム・コンピュータ・インコーポレイテッド Method and device for detecting and reproducing erased tokenin data communication network based on token

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59158161A (en) * 1983-02-14 1984-09-07 プライム・コンピュータ・インコーポレイテッド Method and device for detecting and reproducing erased tokenin data communication network based on token

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628199A (en) * 1990-03-05 1994-02-04 Internatl Business Mach Corp <Ibm> Synchronizing method of parallel processing
JP2015067252A (en) * 2013-10-01 2015-04-13 株式会社日立製作所 Signal security system

Similar Documents

Publication Publication Date Title
EP1326184B1 (en) Conflict resolution for collaborative work system
US8538923B2 (en) Method, node and system for controlling version in distributed system
JP3822381B2 (en) Distributed database system failure recovery method
US7334014B2 (en) Consistent time service for fault-tolerant distributed systems
US7739237B2 (en) Data input routing after failure
US20100191884A1 (en) Method for replicating locks in a data replication engine
JPH0415840A (en) Distributed data base control device
JPS6066538A (en) Method of synchronizing clock
US20170201590A1 (en) Fault-tolerant data processing computer system and method for implementing a distributed two-tier state machine
EP0839350B1 (en) Optimized synchronisation procedure
CN115794499B (en) Method and system for dual-activity replication data among distributed block storage clusters
CN115098229A (en) Transaction processing method, device, node equipment and storage medium
JPS6339038A (en) Process synchronizing method
EP2009557A1 (en) Method and device for data processing and system comprising such device
JPS6339039A (en) Process synchronizing method
JPS6339040A (en) Process synchronizing method
CN110442475B (en) Method and device for realizing distributed consistency group and DRM (digital rights management) equipment
CN111130896A (en) NFS fault switching method and system and dual-control storage system
Srinivasan et al. Solving consensus in true partial synchrony
JPS62177649A (en) Process synchronizing method
CN113238892B (en) Time point recovery method and device for global consistency of distributed system
JPH02122362A (en) Decentralized data control system
JPH03282764A (en) Committing protocol for distributed transaction
Neogy et al. CCUML: a checkpointing protocol for distributed system processes
Said et al. The DLR-ORECOP real-time replication control protocol