JPH07234764A - Scheduler - Google Patents

Scheduler

Info

Publication number
JPH07234764A
JPH07234764A JP2455194A JP2455194A JPH07234764A JP H07234764 A JPH07234764 A JP H07234764A JP 2455194 A JP2455194 A JP 2455194A JP 2455194 A JP2455194 A JP 2455194A JP H07234764 A JPH07234764 A JP H07234764A
Authority
JP
Japan
Prior art keywords
command
execution
list
commands
flag
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
JP2455194A
Other languages
Japanese (ja)
Inventor
Deyudomeenu Marutan
デュドメーヌ マルタン
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2455194A priority Critical patent/JPH07234764A/en
Publication of JPH07234764A publication Critical patent/JPH07234764A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To correctly control the execution order of plural commands irrespectively of priority by controlling the execution order of the plural commands necessary for processing in an execution device to be a desired order based on a state flag, first and second lists. CONSTITUTION:The state flag F shows the processing state of plural commands 111 to 11n. The first list (master list) Lp stores the list of all the commands necessitating processing in advance of some command and the second list (slave list) Lc stores all the list of the commands waiting for the completion of the execution of some command. Then, based on the state flag F, the first and second lists Lp and Lc, this scheduler controls the execution order of the plural commands 111 to 11n to be the desired order. Thereby, the scheduler can lock the execution of some command until the execution of the other commands is completed so as to strictly control the execution order of the plural commands 111 to 11n without any influence on the side of the execution device.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、光ディスク・オート
・チェンジャー(ODAC)などの実行装置と呼ばれるシス
テムに供給するコマンド(命令)の順序及び体系を管理
するスケジューラと呼ばれるシステムに関する。とく
に、コマンドを実行する実行装置のハードウエアの性質
に因って、コマンドの中には、他のコマンドの実行が完
了したときにのみ実行できるように強制する必要がある
ものがあり、そのようなコマンドを処理する機能を有し
た順序制御形のスケジューラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a system called a scheduler for managing the order and system of commands (instructions) supplied to a system called an execution unit such as an optical disk auto changer (ODAC). In particular, due to the nature of the hardware of the execution unit that executes the command, some commands need to be forced to execute only when the execution of another command is complete. The present invention relates to a sequence control type scheduler having a function of processing various commands.

【0002】[0002]

【従来の技術】システムを運用するのに現在使われてい
るスケジューラの本質的概念は、図12に示すように優
先度の梯子構造にあり、この優先度の各レベルは、その
レベル内でランウド・ロビン方式で実行されるコマンド
の鎖構造を有している。
2. Description of the Prior Art The essential concept of a scheduler currently used to operate a system is a ladder structure of priorities, as shown in FIG. 12, in which each level of this priority is run within that level. -It has a chain structure of commands executed by the Robin method.

【0003】あるコマンドが与えられたとき、そのコマ
ンドの優先度は以下に記載の要素によって決定される。
When a command is given, the priority of the command is determined by the elements described below.

【0004】(a)ハードウエアの実行速度:ハードウ
エアユニットの中には、実行時間に関する限り比較的遅
いものがあるが、そのようなハードウエアに送るコマン
ドには、通常、低い優先度が与えられる。これにより、
高速に処理する必要があるコマンドを先に実行させ、シ
ステムが不必要に遅くなるのが防止される。
(A) Hardware Execution Speed: Some hardware units are relatively slow as far as execution time is concerned, but commands sent to such hardware are usually given low priority. To be This allows
Commands that need to be processed faster are executed first, which prevents the system from unnecessarily slowing down.

【0005】(b)信頼性:また、コマンドの中には、
その性質によって、重要なデータの処理や格納を伴うも
のもある。データ紛失のリスクを最小にするため、それ
らのコマンドはなるべく速やかに実行させることが望ま
しい。このため、かかる重要なコマンドには高い優先度
が割り当てられる。
(B) Reliability: In addition, some commands include
Some of them involve the processing and storage of important data, depending on their nature. These commands should be executed as soon as possible to minimize the risk of data loss. Therefore, such important commands are assigned high priority.

【0006】(c)緊急性:緊急状態に至ったため、コ
マンドを直ちに実行せねばならない事態も時には生じ
る。この場合、通常、かかるコマンドには、その時点で
可能な最高の優先度(しばしば「緊急レベル」と称され
る)が付与される。
(C) Urgency: Since an emergency has been reached, sometimes a command must be executed immediately. In this case, such commands are typically given the highest priority available at that time (often referred to as the "emergency level").

【0007】また、コマンドの実行の順序については次
のようになっている。優先度毎のコマンドはランウド・
ロビン方式で扱われる。つまり、コマンドは何等の特別
な取扱いも無く、次々に実行される。ただし、最初に来
たコマンドは最初に扱われる。
The order of command execution is as follows. Commands for each priority are run
Handled in the Robin system. That is, the commands are executed one after another without any special handling. However, the command that comes first is treated first.

【0008】例えば、図12に記載の優先度の梯子構造
では、コマンドは、コマンド1から始まってコマンド9
で終わる、コマンド番号の上昇順序で実行される。
For example, in the priority ladder structure shown in FIG. 12, the commands start with command 1 and start with command 9.
The command numbers are executed in ascending order, ending with.

【0009】さらに、コマンドの実行の同時性について
は次のようである。実行装置の構造及びそれに取り付け
られるハードウエアの性質に拠っては、いくつかのコマ
ンドを同時に実行できる。そこで、例えば最大4つのコ
マンドを同時に実行できるとすると、スケジューラは最
初の4つのコマンドを、それらの中間での実行完了の応
答を待たずに、直ちに次々と送ることができる。
Further, the simultaneity of command execution is as follows. Depending on the structure of the execution unit and the nature of the hardware attached to it, several commands can be executed simultaneously. Therefore, for example, assuming that a maximum of four commands can be executed at the same time, the scheduler can immediately send the first four commands one after another without waiting for the response of completion of execution in the middle of them.

【0010】[0010]

【発明が解決しようとする課題】ところで、あるシーケ
ンスに係るコマンドは非常に厳格な順序で実行されなけ
ればならないことがよくある。すなわち、あるコマンド
は、他のコマンドの実行が完了するまで実行開始しては
いけない、という順序である。しかしながら、上述した
従来のスケジューラは、そのような厳格に限定されたシ
ーケンスを確保する機能が無いので、かかるシーケンス
を得るには実行装置のプログラム上で処理させるしか手
立てが無い。
By the way, it is often the case that commands related to a certain sequence must be executed in a very strict order. That is, one command must not start executing until the other commands have completed execution. However, since the above-mentioned conventional scheduler does not have a function of ensuring such a strictly limited sequence, the only way to obtain such a sequence is to execute it on the program of the execution device.

【0011】この不都合を具体例を挙げながら更に詳述
する。いま、ハードウエアとして複数台の光ディスク・
オート・チェンジャー(ODAC)を配置して成るものとす
る。光ディスク・オート・チェンジャーの各々は、光デ
ィスク(OD)を格納する多数の棚と、光ディスクに対し
てデータを読み書きする1台又は2台のディスク・ドラ
イブと、光ディスクを棚からディスク・ドライブへ又は
その反対に搬送する機械的なディスク操作機構(ロバテ
ィックス(robotics)と称される)とを備える。ここでの
動作は、現在使っている光ディスク(ディスク1)から
新しい、未フォーマットの光ディスク(ディスク2)に
ファイルをコピーすることであると仮定する。
This inconvenience will be described in more detail with specific examples. Now, as hardware, multiple optical disks
It shall consist of an auto changer (ODAC). Each of the optical disc auto changers has a number of shelves for storing optical discs (OD), one or two disc drives for reading / writing data from / to the optical discs, and optical discs from the shelves to the disc drives or On the contrary, it is provided with a mechanical disc operating mechanism (referred to as robotics) for carrying. It is assumed that the operation here is to copy a file from the currently used optical disk (disk 1) to a new, unformatted optical disk (disk 2).

【0012】この場合、3つの上位概念のコマンドが実
行されることになる。即ち、
In this case, the commands of the three superordinate concepts are executed. That is,

【外1】 これら3つの上位概念のコマンドをもう少し細かく展開
すると、図13記載のフローチャートになる。
[Outer 1] When the commands of these three superordinate concepts are expanded a little more finely, the flow chart shown in FIG. 13 is obtained.

【0013】このフローチャートから分かるように、
「ディスク1からのファイル読出し」を規定するコマン
ドA,B,Cのステップは順次実行する必要がある。同
様に、「ディスク2のフォーマット」を規定するコマン
ドD,E,Fも順番に処理する必要がある。しかしなが
ら、コマンドA,B,Cのグループは、コマンドD,
E,Fのグループが実行中である間に、同時に実行可能
である。コマンドG,H,Iも順次実行しなければなら
ないが、しかし、このコマンドG,H,Iのグループ全
体は、両方のコマンドグループ「A,B,C」及び
「D,E,F」が実行完了して初めて実行開始可能とな
る。
As can be seen from this flow chart,
The steps of the commands A, B, and C that define "reading a file from the disk 1" must be sequentially executed. Similarly, the commands D, E, and F that define the "format of the disk 2" must be processed in order. However, the group of commands A, B and C is
They can be executed simultaneously while the E and F groups are being executed. Commands G, H, I must also be executed sequentially, but the entire group of commands G, H, I is executed by both command groups "A, B, C" and "D, E, F". Execution can be started only after completion.

【0014】このような条件下で、上記9つのコマンド
を従来のスケジューラに処理させた場合、上述した順序
で実行させることは困難である。というのは、従来のス
ケジューラで採用している、優先度毎のランウド・ロビ
ン方式は詳細な実行順序までも限定するようになっては
いないからであり、コマンドC及びFの完了を待ってか
らコマンドGを実行開始するように、スケジューラに指
示するのは不可能だからである。
When the above-mentioned nine commands are processed by the conventional scheduler under such conditions, it is difficult to execute them in the order described above. This is because the Runoud-Robin method used in the conventional scheduler does not limit the detailed execution order even after the completion of commands C and F. This is because it is impossible to instruct the scheduler to start executing the command G.

【0015】たとえ上記3つのグループのコマンドに3
つの異なる優先度を割り当てることによってシステムを
操作したとしても、実行ユニットは非常に沢山のコマン
ドを同時に実行できることを考えると、かかる適正な実
行順序を保証することには無理がある。
Even if the above three groups of commands have three
Even if the system is operated by assigning three different priorities, it is impossible to guarantee such a proper execution order, considering that the execution unit can execute a large number of commands at the same time.

【0016】この発明は、上述した従来技術の問題に鑑
みてなされたもので、他のコマンドの実行が完了するま
で、あるコマンドの実行をロックでき、その他のコマン
ドの実行が完了すると、それまで待っていたコマンドの
中から必要なコマンドを自動的にアンロックできる機能
を備えた順序制御形のスケジューラを提供することを、
目的とする。
The present invention has been made in view of the above-described problems of the prior art. When the execution of another command can be locked until the execution of the other command is completed, and when the execution of the other command is completed, To provide a sequence control type scheduler with a function that can automatically unlock the required command from the commands that have been waiting,
To aim.

【0017】[0017]

【課題を解決するための手段】上記目的を達成させるた
め、この発明に係るスケジューラは、実行装置における
処理に必要な複数のコマンドの実行順序を管理するもの
であり、上記複数のコマンドを個別に記憶するコマンド
ブロックの各々に、そのコマンドの処理状態を示す状態
フラグと、そのコマンドに先行して処理する必要がある
全コマンドリストを記憶した第1のリストと、そのコマ
ンドの実行完了を待っている全コマンドリストを記憶し
た第2のリストとを付加するとともに、上記状態フラ
グ、第1のリスト、及び第2のリストに基づいて上記複
数のコマンドの実行順序を所望の順序に制御する順序制
御手段を設けた。
In order to achieve the above object, a scheduler according to the present invention manages the execution order of a plurality of commands required for processing in an execution device, and the plurality of commands are individually managed. In each of the command blocks to be stored, a status flag indicating the processing status of the command, a first list that stores a list of all commands that need to be processed prior to the command, and wait for the completion of execution of the command. And a second list storing all command lists stored therein, and a sequence control for controlling the execution order of the plurality of commands to a desired order based on the status flag, the first list, and the second list. Means were provided.

【0018】とくに、請求項2記載の発明に係るスケジ
ューラは、前記状態フラグには、「待機中」、「準備完
了」、「実行中」、及び「実行完了」の各処理状態を割
り当てる一方、前記順序制御手段は、前記第1のリスト
が空では無い限り、その状態フラグを「待機中」に維持
する第1のフラグ制御手段と、上記第1のリストが空に
なったとき、その状態フラグを「待機中」から「準備完
了」に変更する第2のフラグ制御手段と、上記コマンド
を実行するとき、その状態フラグを「準備完了」から
「実行中」に変更する第3のフラグ制御手段と、上記コ
マンドの実行完了のとき、その状態フラグを「実行中」
から「実行完了」に変更する第4のフラグ制御手段とを
備えるとともに、上記各コマンドの状態フラグの内容を
評価して「準備完了」になっているときにのみ、そのコ
マンドを実行可能にするフラグ・サーチ手段と、現在実
行中のコマンドの処理が完了したとき、その完了したコ
マンドの第2のリストに載っている待機中の各コマンド
をスキャンして、その各コマンドの第1のリストから完
了したコマンドを削除するコマンド削除手段とを備え
た。
In particular, the scheduler according to the second aspect of the present invention allocates to the state flag the processing states of "standby", "ready", "in execution", and "execution completed", and The order control means keeps its status flag "waiting" unless the first list is empty, and the status control means when the first list is empty Second flag control means for changing the flag from "standby" to "ready" and third flag control for changing the status flag from "ready" to "running" when the command is executed Means, and when the execution of the above command is completed, set the status flag to "running"
And a fourth flag control means for changing from "execution completed" to "execution completed", and the command can be executed only when the contents of the status flag of each command are evaluated and "ready". When the flag search means and the processing of the command currently being executed are completed, each waiting command in the second list of completed commands is scanned and the first list of each command is scanned. And a command deleting means for deleting the completed command.

【0019】[0019]

【作用】この発明では、順序制御手段により、対象装置
におけるコマンドの実行順序が予め定めた所望の順序に
制御される。例えば、あるコマンドの第1のリストが空
では無い限り、その状態フラグは「待機中」に維持され
(第1のフラグ制御手段)、その第1のリストが空にな
ったとき、状態フラグは「待機中」から「準備完了」に
変更される(第2のフラグ制御手段)。各コマンドの状
態フラグの内容はフラグ・サーチ手段により評価され、
「準備完了」になっているときにのみ、そのコマンドが
実行可能な状態に移行される。そのコマンドが実行され
ると、状態フラグが「準備完了」から「実行中」に変更
され(第3のフラグ制御手段)、その後、実行完了のと
き、「実行中」から「実行完了」に変更される(第4の
フラグ制御手段)。実行中のコマンドの処理が完了する
と、その完了したコマンドの第2のリストに載っている
待機中の各コマンドがスキャンされ、その各コマンドの
第1のリストから完了したコマンドがコマンド削除手段
により削除される。
According to the present invention, the order control means controls the command execution order in the target device to a predetermined desired order. For example, unless the first list of a command is empty, its status flag is kept "waiting" (first flag control means), and when the first list is empty, the status flag is The status is changed from "standby" to "ready" (second flag control means). The content of the status flag of each command is evaluated by the flag search means,
Only when it is "ready" will the command be moved to a ready state. When the command is executed, the status flag is changed from "ready" to "running" (third flag control means), and when the execution is completed, the status flag is changed from "running" to "running completed". (Fourth flag control means). When the processing of the command being executed is completed, each waiting command in the second list of completed commands is scanned, and the completed command is deleted from the first list of each command by the command deleting means. To be done.

【0020】このように、コマンドは第1のリストが空
でない間は実行されずに、ロック状態のまま待機してい
る。このロック状態にあるコマンドの第1のリストのコ
マンド名は、先行して実行完了されたコマンドの第2に
リストで指定されたものについて逐一削除されていき、
第1のリストが空になるとアンロック状態(状態フラグ
=「準備完了」となり、実行可能となる。かかるコマン
ド削除にも関わらず、第1のリストが空になっていない
場合は、依然としてロック状態(状態フラグ=「待機
中」)に止められる。したがって、各コマンドの第1の
リストに、そのコマンドに先行して実行させるコマンド
名をリストアップし、同様に各コマンドの第2のリスト
に、現在のコマンドの実行完了を待機しているコマンド
名をリストアップしておけば、複数のコマンドの実行順
序が適宜に制御される。
As described above, the command is not executed while the first list is not empty, and waits in the locked state. The command names of the first list of commands in this locked state are deleted one by one for the commands specified in the second list of the previously completed commands,
When the first list is empty, it is in the unlocked state (state flag = "ready", and execution is possible. Despite the command deletion, if the first list is not empty, it is still in the locked state. (Status flag = "waiting") Therefore, in the first list of each command, the command name to be executed prior to the command is listed, and similarly, in the second list of each command, If the command names waiting for the completion of execution of the current command are listed, the execution order of a plurality of commands can be controlled appropriately.

【0021】[0021]

【実施例】以下、この発明の一実施例を図1〜図11に
基づき説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to FIGS.

【0022】図1に示すように、この発明に係る順序制
御形のスケジューラ1は、オペレータがコンソール2を
介してアクセスするアプリケーション・ユニット3と、
実行装置としての光ディスク・オート・チェンジャー
(ODAC)4との間に介挿されており、アプリケション・
ユニット3からの要求に応答して起動する。なお、実行
装置は、光ディスク・オート・チェンジャー(ODAC)4
に限定されるものではなく、少なくとも複数のコマンド
を所望の順番に処理させるプログラムを内蔵している機
器であればよい。
As shown in FIG. 1, a sequence control type scheduler 1 according to the present invention includes an application unit 3 which an operator accesses through a console 2,
It is inserted between the optical disk auto changer (ODAC) 4 as an execution device,
It is activated in response to a request from the unit 3. The execution device is an optical disc auto changer (ODAC) 4
However, the device is not limited to the above, and may be any device as long as it has a program for processing at least a plurality of commands in a desired order.

【0023】スケジューラ1は、CPU(中央演算装
置)10及びメモリ11を内蔵しており、メモリ11の
記憶領域に、複数のコマンドブロック111 …11n
形成している。コマンドブロック111 …11n の各々
は、コマンド名、状態フラグF、親リストLp、及び子
供リストLcから成る。状態フラグFは、各コマンドの
処理状態を示すもので、「待機中(:waiting for execut
ion)」、「準備完了(:ready for execution)」、「実行
中(:executing)、及び「完了(:done) 」の各処理状態を
表すデータが割り当てられる。一方、親リストLpは本
発明の第1のリストに相当するもので、ある一つのコマ
ンドに着目すると、そのコマンドに先行して処理する必
要がある全コマンドリストを記憶したものである。また
子供リストLcは本発明の第2のリストに相当するもの
で、ある一つのコマンドに着目すると、そのコマンドの
実行完了を待っている全コマンドリストを記憶したもの
である。
The scheduler 1 has a CPU (central processing unit) 10 and a memory 11 built therein, and a plurality of command blocks 11 1 ... 11 n are formed in a storage area of the memory 11. Each of the command blocks 11 1 ... 11 n includes a command name, a status flag F, a parent list Lp, and a child list Lc. The status flag F indicates the processing status of each command, and is "waiting for execut
Ion) ”,“ ready for execution ”,“ executing ”, and“ completed (: done) ”. On the other hand, the parent list Lp corresponds to the first list of the present invention, and when one command is focused, it stores all command lists that need to be processed prior to the command. The child list Lc corresponds to the second list of the present invention, and when one command is focused on, it stores all command lists waiting for the completion of execution of the command.

【0024】上記CPU10は、ODAC4でのコマン
ドの実行順序を、従来と同様に、優先度の梯子構造及び
その各梯子構造内でラウンド・ロビン方式を用いて、上
記複数のコマンドブロック111 …11n の記憶データ
に基づいて管理する。この管理のために、図3〜図5記
載のサブプログラムとこれを管理するメインプログラム
(図示せず)とを内蔵しており、メインプログラムの実
行中に、例えば一定時間毎のタイマ割込み処理によって
上記サブプログラムを処理するようになっている。
The CPU 10 executes the command execution order in the ODAC 4 in the same manner as in the prior art by using the priority ladder structure and the round robin method in each ladder structure, and the plurality of command blocks 11 1 ... 11 Manage based on n stored data. For this management, a sub program shown in FIGS. 3 to 5 and a main program (not shown) that manages the sub program are built in, and during execution of the main program, for example, by timer interrupt processing at regular time intervals. It is designed to process the above subprogram.

【0025】上記サブプログラムの内、図3記載のもの
は、待機中のコマンドの親リストのチェックに関する。
具体的には、状態フラグF=「待機中」となっている、
あるコマンドの親リストLpを参照し(ステップ2
0)、その親リストLpが空(すなわち、コマンド名の
データが零)か否か判定する(ステップ21)。この判
定でNO、すなわち親リストLpが空ではないときは、
そのコマンドの状態フラグF=「待機中」を維持し(ス
テップ22)、待機中の全部のコマンドについて親リス
トの参照が終わったか否か判定する(ステップ23)。
ここでNOの判定、すなわち未だ全部は終わっていない
ときは、次のコマンドに処理を進め(ステップ24)、
上記ステップ20に戻る。ステップ21の判定でYE
S、すなわち親リストLpが空のときは、そのコマンド
の状態フラグFを「待機中」から「準備完了」に更新し
(ステップ25)、上記ステップ23の判定に入る。こ
のようにして、待機中の全てのコマンドについて親リス
トの参照がなされる。
Of the above subprograms, the one shown in FIG. 3 relates to checking the parent list of waiting commands.
Specifically, the state flag F = “standby”,
Refer to the parent list Lp of a command (step 2
0), it is determined whether the parent list Lp is empty (that is, the command name data is zero) (step 21). If this determination is NO, that is, if the parent list Lp is not empty,
The status flag F = “standby” of the command is maintained (step 22), and it is determined whether reference of the parent list has been completed for all the commands waiting (step 23).
Here, if the determination is NO, that is, if all of the processing is not finished yet, the process proceeds to the next command (step 24),
Return to step 20 above. YE in the judgment of step 21
When S, that is, when the parent list Lp is empty, the status flag F of the command is updated from "standby" to "ready" (step 25), and the determination of step 23 is started. In this way, the parent list is referred to for all commands that are waiting.

【0026】図4記載の処理は、コマンドの状態フラグ
参照に関する。あるコマンドについて状態フラグF=
「準備完了」か否か判定し(ステップ30)、NOの場
合(「準備完了」でない)、全部のコマンドについてフ
ラグ参照が終わったか否か判定する(ステップ31)。
ここでNOの判定(すなわち未だ参照していないコマン
ドがある)のときは、次のコマンドに処理を進め(ステ
ップ32)、上記ステップ30に戻る。ステップ30で
YESの判定、すなわち状態フラグF=「準備完了」の
ときは、そのフラグFを「準備完了」から「実行中」に
変更し(ステップ33)、さらにそのコマンドの実行を
可能にした後(ステップ34)、ステップ31で上記判
定を同様に行う。このため、図3の処理によって「準備
完了」になっていたコマンドの状態フラグが「実行中」
となり、ODAC4において所定の実行命令があれば、
そのコマンド内容が実行に移される。
The process described in FIG. 4 relates to the command status flag reference. Status flag F = for a command
It is determined whether "preparation is complete" (step 30), and if NO (not "preparation is complete"), it is determined whether flag reference has been completed for all commands (step 31).
If the determination is NO (that is, there is a command that has not been referred to yet), the process proceeds to the next command (step 32) and the process returns to step 30. When the determination in step 30 is YES, that is, when the status flag F = "ready", the flag F is changed from "ready" to "running" (step 33), and the command can be executed. After that (step 34), the above determination is similarly performed in step 31. Therefore, the status flag of the command that has been "ready" by the process of FIG. 3 is "execution".
If there is a predetermined execution instruction in ODAC4,
The command contents are moved to execution.

【0027】さらに図5の処理は、コマンドの実行終了
時の状態フラグの更新及び子供リストの参照に関する。
現在のコマンドの実行がODAC4にて終わると、OD
AC4から実行終了の応答があるので、この応答信号を
使ってCPU10はコマンドの実行終了か否かを判定す
る(ステップ40)。この判定でNOのときは、メイン
プログラムに戻って次のタイマ割込み時期を待つ。YE
Sのときは、コマンドの実行が終了したのであるから、
そのコマンドの状態フラグFをそれまでの「実行中」か
ら「完了」に変更する(ステップ41)。次いで、実行
完了したコマンドの子供リストLcを参照し(ステップ
42)、その子供リストLcのコマンド名データが空か
否か判定する(ステップ43)。この判定でYES、即
ち子供リストLcが空の場合、待機しているコマンドが
無くなったので、コマンドの実行順序の管理は不要にな
ったとしてメインプログラムに戻る。ステップ43の判
定でNOの場合、完了した子供リストLcのコマンド名
データをチェックし、そのコマンド(待機中のコマン
ド)の親リストLpから実行完了したコマンド名データ
を消去する(ステップ44)。この後、メインプログラ
ムに戻る。このように、待機中のコマンドの親リストL
pのコマンド名データの内、実行完了したコマンド名が
順次消去される。
Further, the processing of FIG. 5 relates to updating the status flag and referring to the child list at the end of command execution.
When the current command execution ends with ODAC4, OD
Since there is an execution end response from the AC4, the CPU 10 uses this response signal to determine whether or not the command execution has ended (step 40). If NO in this determination, the process returns to the main program and waits for the next timer interrupt timing. YE
When S, execution of the command has ended, so
The status flag F of the command is changed from "currently executing" to "completed" (step 41). Next, the child list Lc of the command that has been executed is referenced (step 42), and it is determined whether the command name data of the child list Lc is empty (step 43). If the result of this determination is YES, that is, if the child list Lc is empty, there are no commands waiting, so management of the command execution order is no longer necessary, and the process returns to the main program. If the determination in step 43 is NO, the command name data of the completed child list Lc is checked, and the command name data that has been executed is deleted from the parent list Lp of the command (standby command) (step 44). After this, return to the main program. Thus, the parent list L of waiting commands
Of the p command name data, the command names that have been executed are sequentially deleted.

【0028】上述した構成及び処理の中で、図3のステ
ップ22の処理が第1のフラグ制御手段の要部を成し、
同図ステップ25の処理が第2のフラグ制御手段の要部
を成し、図4のステップ33の処理が第3のフラグ制御
手段の要部を成し、さらに、図5のステップ41の処理
が第4のフラグ制御手段の要部を成す。また、図4の3
0、34の処理によってフラグ・サーチ手段が形成され
るとともに、図5のステップ40、42、44の処理に
よってコマンド削除手段が形成される。
In the above-mentioned configuration and processing, the processing of step 22 of FIG. 3 constitutes the main part of the first flag control means,
The process of step 25 in the figure constitutes the essential part of the second flag control means, the process of step 33 in FIG. 4 constitutes the essential part of the third flag control means, and the process of step 41 in FIG. Form an essential part of the fourth flag control means. Also, in FIG.
The flag search means is formed by the processing of 0 and 34, and the command deleting means is formed by the processing of steps 40, 42 and 44 of FIG.

【0029】続いて、本実施例の動作を図3〜5及び図
6〜8に基づいて説明する。
The operation of this embodiment will be described below with reference to FIGS. 3 to 5 and 6 to 8.

【0030】まず、図6に示すように、4個のコマンド
#001〜#004がスケジューラ1の実行順序の対象
であり、コマンド#001〜#004の状態フラグF、
親リストLp、及び子供リストLcは図示の如く設定さ
れているとする。つまり、現在実行中のコマンド#00
1は、状態フラグF=「実行中」、親リストLp=空、
子供リストLc=003、004であり、実行準備完了
のコマンド#002は、状態フラグF=「準備完了」、
親リストLp=空、子供リストLc=004である一
方、待機中の2つのコマンドの内、#003は状態フラ
グF=「待機中」、親リストLp=001、子供リスト
Lc=空、#004は状態フラグF=「待機中」、親リ
ストLp=001,002、子供リストLc=空、であ
る。この状態では、コマンド#003,#004の親リ
ストLpが共に「空」ではないから待機中であり、実行
予定となることはなく、その実行がロックされた状態
(ロック状態)が維持されている。
First, as shown in FIG. 6, four commands # 001 to # 004 are targets of the execution order of the scheduler 1, and the status flags F of the commands # 001 to # 004,
It is assumed that the parent list Lp and the child list Lc are set as illustrated. That is, the command # 00 currently being executed
1 is the status flag F = “running”, the parent list Lp = empty,
The child list Lc = 003,004, and the command # 002 for completion of execution preparation has a status flag F = “ready”,
While the parent list Lp = empty and the child list Lc = 004, # 003 of the two waiting commands is the status flag F = “waiting”, the parent list Lp = 001, the child list Lc = empty, # 004. Is the state flag F = “waiting”, the parent list Lp = 001,002, and the child list Lc = empty. In this state, since the parent lists Lp of the commands # 003 and # 004 are not “empty”, they are on standby and are not scheduled to be executed, and the execution is locked (locked state). There is.

【0031】この状態で前述した図3〜図5の処理がC
PU10にて実施される。いま実行中であったコマンド
#001の実行完了がODAC4から通知されると、図
5の処理により、コマンド#001の状態フラグF=
「完了」となり、その子供リストLcがチェックされ
る。いま、子供リストLc=003,004であるの
で、CPU10は待機中のコマンド#003、004の
親リストLpを図7に示すように各々参照する。そし
て、それらのコマンド#003、004の親リストLp
の中から、図7に模式的に示す如く、実行完了のコマン
ド#001のコマンド名データを消去する。これによ
り、コマンド#003の親リストLp=空、コマンド#
004の親リストLp=002となる。
In this state, the processing shown in FIGS.
It is implemented in PU10. When the completion of execution of the command # 001 which is being executed now is notified from the ODAC 4, the status flag F = of the command # 001 by the process of FIG.
“Completed”, and the child list Lc is checked. Now, since the child list Lc = 003,004, the CPU 10 respectively refers to the parent lists Lp of the waiting commands # 003,004 as shown in FIG. Then, the parent list Lp of those commands # 003 and 004
As shown in FIG. 7, the command name data of the execution completion command # 001 is deleted from among the above. As a result, the parent list Lp of command # 003 = empty, command # 003
The parent list of 004 is Lp = 002.

【0032】また、図3の処理により、コマンド#00
4の状態フラグFは空ではないから依然として「待機
中」、つまりロック状態が維持されるが、コマンド#0
03の状態フラグF=空であるから、その状態フラグF
=「準備完了」に更新される(図7、8参照)。これに
より、コマンド#003はロック状態が解除され、実行
可能なアンロック状態に移行する。
Further, by the processing of FIG. 3, command # 00
The status flag F of 4 is not empty, so that the status is still "waiting", that is, the lock status is maintained, but the command # 0
03 state flag F = empty, so the state flag F
= Updated to "ready" (see FIGS. 7 and 8). As a result, the lock state of the command # 003 is released, and the command # 003 shifts to the unlock state in which it can be executed.

【0033】また、図4の処理により、準備完了となっ
たコマンド#004の状態フラグF=「実行中」に更新
される(図7、8参照)。
Further, by the processing of FIG. 4, the status flag F of the command # 004 which has been prepared is updated to “execution in progress” (see FIGS. 7 and 8).

【0034】さらに、今回実行中となったコマンド#0
02の実行が完了すると、次回の図5記載の処理によ
り、そのコマンド#002の状態フラグF=「完了」と
なり、子供リストLc=004が参照される。この参照
により、指定された待機中のコマンド#004の親リス
トLp=002内のコマンド名「002」が削除され
る。この結果、それまでロック状態のまま待機していた
コマンド#002もアンロックされ、図3の処理により
実行可能となり、さらに、図4の処理を介して実行予定
となる。
Furthermore, the command # 0 which is being executed this time
When the execution of 02 is completed, the state flag F of the command # 002 becomes “completed” by the next processing described in FIG. 5, and the child list Lc = 004 is referred to. By this reference, the command name “002” in the parent list Lp = 002 of the designated waiting command # 004 is deleted. As a result, the command # 002 that has been waiting in the locked state until then is unlocked, becomes executable by the processing of FIG. 3, and is scheduled to be executed through the processing of FIG.

【0035】このように各コマンドの親リストにコマン
ド名データが残っている限り、そのコマンドはロック状
態のまま待機し、親リストのコマンド名が全て削除され
た空になると、ロック状態が解除されて実行可能にな
る。この結果、状態フラグ、親リスト、及び子供リスト
を上述のように各コマンドブロックに設定し、CPUで
上述した処理を実施させることにより、特定のコマンド
の実行が完了してから別のコマンドを自動的に実行させ
ることができ、複数のコマンド間の実行順序を所望のも
のに確実に設定できる。したがって、各コマンドに異な
る優先度を割り当て実行装置を操作する必要なく、実行
装置が同時に大量のコマンドを実行する場合でも、所望
の実行順序が確実に保証される。
As described above, as long as the command name data remains in the parent list of each command, the command remains in the locked state, and when all command names in the parent list are deleted and become empty, the locked state is released. Becomes feasible. As a result, the status flag, the parent list, and the child list are set in each command block as described above, and the CPU executes the above-described processing to automatically execute another command after the execution of the specific command is completed. Therefore, the execution order among a plurality of commands can be surely set to a desired one. Therefore, it is possible to reliably guarantee the desired execution order even when the execution device executes a large number of commands at the same time without assigning different priorities to the commands and operating the execution device.

【0036】上記利点をより明確にするため、本実施例
のスケジューラの具体的動作を従来のそれと比較して説
明する。まず、前述した図13と同一の状況を再び導入
する。つまり、光ディスク・オート・チェンジャー(OD
AC)において、現在使っている光ディスク(ディスク
1)から新しい、未フォーマットの光ディスク(ディス
ク2)にファイルをコピーする状況であり、
In order to make the above advantages clearer, the specific operation of the scheduler of this embodiment will be described in comparison with that of the conventional one. First, the same situation as in FIG. 13 described above is introduced again. In other words, optical disc auto changer (OD
AC) is a situation where files are being copied from the currently used optical disk (disk 1) to a new, unformatted optical disk (disk 2),

【外2】 の3つのコマンドグループがある(コマンドA〜Iの内
容は図13と同じである)。
[Outside 2] There are three command groups (the contents of commands A to I are the same as in FIG. 13).

【0037】通常、フォーマットに関するコマンド
(D,E,F)は、読出しに関するコマンド(A,B,
C)及び書込みに関するコマンド(G,H,I)よりも
優先度が低く設定されるのが現実的であると想定され
る。この結果、従来のスケジューラでは、コマンドグル
ープを図9に示す梯子構造に設定することになる。しか
し、これでは、ディスク2をフォーマットする前に、デ
ィスク2に書込みを行ってしまい、的確な実行順序は得
られない。
Normally, the format-related commands (D, E, F) are read-related commands (A, B,
It is realistic that the priority is set lower than that of C) and the command (G, H, I) related to writing. As a result, the conventional scheduler sets the command group in the ladder structure shown in FIG. However, in this case, the disk 2 is written before the disk 2 is formatted, and an accurate execution order cannot be obtained.

【0038】これに対し、本発明に係る順序制御形のス
ケジューラを使えば、図10に示すコマンドの梯子構造
となり、「ディスク2のフォーマット」の優先度が低く
ても、この「ディスク2のフォーマット」及び「ディス
ク1からの読出し」が共に完了するまで、「ディスク2
への書込み」の実行がロックされる。図11には上記梯
子構造を実施する具体的なコマンドブロックを示す(各
コマンドブロックのリストを制御する処理は前述した図
3〜5と同様である)。図11によれば、コマンドGの
親リストLpには2つのコマンド名C,Fが設定されて
いるので、このコマンドC,Fが共に実行されるまでコ
マンドGはロックされることになる。つまり、このロッ
ク機能が図10の「AND」記号のブロックで等価的に
表現されている。
On the other hand, when the sequence control type scheduler according to the present invention is used, the command ladder structure shown in FIG. 10 is obtained, and even if the "format of disk 2" has a low priority, the "format of disk 2" is used. "And" read from disk 1 "are both completed until" disk 2
"Write to" execution is locked. FIG. 11 shows a specific command block for implementing the ladder structure (the process of controlling the list of each command block is the same as that in FIGS. 3 to 5). According to FIG. 11, since two command names C and F are set in the parent list Lp of the command G, the command G will be locked until both the commands C and F are executed. That is, this lock function is equivalently expressed by the block of the "AND" symbol in FIG.

【0039】したがって、優先度を無視した横断的な、
しかも厳格な実行順序を的確に管理できる。一方、「デ
ィスク1からの読出し」及び「ディスク2のフォーマッ
ト」には何等制限を課していないから、実行ユニット
(例えばODAC)はこれらのコマンドグループを並列
に実行できる。
Therefore, cross-cutting with priority neglected,
Moreover, the strict execution order can be managed accurately. On the other hand, since no restrictions are imposed on "read from disk 1" and "format of disk 2", the execution unit (for example, ODAC) can execute these command groups in parallel.

【0040】なお、上記実施例では、あるコマンドグル
ープに先行して処理するコマンドグループが2つの場合
について説明したが、本発明は必ずしもこれに限定され
ることなく、例えば3つ以上のコマンドグループを先行
して処理するロック機構に適用してもよい。
In the above embodiment, the case where there are two command groups to be processed prior to a certain command group has been described, but the present invention is not necessarily limited to this, and, for example, three or more command groups may be processed. It may be applied to a locking mechanism which is processed in advance.

【0041】また、親リスト及び子供リストは各々、必
要に応じて2種以上のものを用意するコマンドブロック
構成も可能である。
The parent list and the child list may each have a command block structure in which two or more types are prepared as needed.

【0042】[0042]

【発明の効果】以上説明したように、本発明のスケジュ
ーラによれば、コマンドの処理状態を示す状態フラグ
と、あるコマンドに先行して処理する必要がある全コマ
ンドリストを記憶した第1のリストと、あるコマンドの
実行完了を待っている全コマンドリストを記憶した第2
のリストとを付加するとともに、状態フラグ、第1のリ
スト、及び第2のリストに基づいて複数のコマンドの実
行順序を所望の順序に制御するので、他のコマンドの実
行が完了するまで、あるコマンドの実行をロックするこ
とができ、複数のコマンドの実行順序を、実行装置側に
何等影響を与えずに、厳格に管理することがきる。
As described above, according to the scheduler of the present invention, the first flag which stores the status flag indicating the processing status of a command and the list of all commands that need to be processed prior to a certain command is stored. And a second command that stores a list of all commands that are waiting for the execution of a certain command
, And the execution order of a plurality of commands is controlled to a desired order based on the status flag, the first list, and the second list, so that the execution of other commands is completed. Command execution can be locked, and the execution order of a plurality of commands can be strictly managed without affecting the execution device side.

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

【図1】この発明の一実施例に係るスケジューラのブロ
ック図。
FIG. 1 is a block diagram of a scheduler according to an embodiment of the present invention.

【図2】コマンドブロックを模式的に示すブロック図。FIG. 2 is a block diagram schematically showing a command block.

【図3】待機中のコマンドの親リストのチェック処理を
示す概略フローチャート。
FIG. 3 is a schematic flowchart showing a process of checking a parent list of a command on standby.

【図4】コマンドの状態フラグのサーチ処理を示す概略
フローチャート。
FIG. 4 is a schematic flowchart showing a search process of a command status flag.

【図5】コマンドの実行終了時の状態フラグの更新及び
子供リストの参照を示す概略フローチャート。
FIG. 5 is a schematic flowchart showing updating of a status flag and reference of a child list at the end of command execution.

【図6】実施例の動作の概略を説明する、4つのコマン
ドブロックの状態模式図。
FIG. 6 is a state schematic diagram of four command blocks for explaining the outline of the operation of the embodiment.

【図7】実施例の動作の概略を説明する、4つのコマン
ドブロックの状態模式図。
FIG. 7 is a state schematic diagram of four command blocks for explaining the outline of the operation of the embodiment.

【図8】実施例の動作の概略を説明する、4つのコマン
ドブロックの状態模式図。
FIG. 8 is a state schematic diagram of four command blocks for explaining the outline of the operation of the embodiment.

【図9】従来のスケジューラよる具体的なコマンドの梯
子構造を説明する説明図。
FIG. 9 is an explanatory diagram for explaining a concrete ladder structure of commands by a conventional scheduler.

【図10】実施例に係るスケジューラによる具体的なコ
マンドの梯子構造を説明する説明図。
FIG. 10 is an explanatory diagram illustrating a specific command ladder structure by the scheduler according to the embodiment.

【図11】図10の梯子構造に対応する、各コマンドの
コマンドブロックを説明する模式図。
11 is a schematic diagram illustrating command blocks of each command corresponding to the ladder structure of FIG.

【図12】従来技術に係る優先度及びランウド・ロビン
方式のコマンドの梯子構造を示す模式図。
FIG. 12 is a schematic diagram showing a priority and a ladder structure of a command of the Runudo-Robin method according to the prior art.

【図13】従来の具体例に係るコマンドの実行順を説明
する概略フローチャート。
FIG. 13 is a schematic flowchart illustrating a command execution order according to a conventional specific example.

【符号の説明】[Explanation of symbols]

1 スケジューラ 10 CPU 11 メモリ 111 …11n コマンドブロック F 状態フラグ Lp 親フラグ Lc 子供リスト1 scheduler 10 CPU 11 memory 11 1 ... 11 n command block F status flag Lp parent flag Lc child list

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 実行装置における処理に必要な複数のコ
マンドの実行順序を管理するスケジューラにおいて、上
記複数のコマンドを個別に記憶するコマンドブロックの
各々に、そのコマンドの処理状態を示す状態フラグと、
そのコマンドに先行して処理する必要がある全コマンド
リストを記憶した第1のリストと、そのコマンドの実行
完了を待っている全コマンドリストを記憶した第2のリ
ストとを付加するとともに、上記状態フラグ、第1のリ
スト、及び第2のリストに基づいて上記複数のコマンド
の実行順序を所望の順序に制御する順序制御手段を設け
たことを特徴とするスケジューラ。
1. A scheduler that manages the execution order of a plurality of commands required for processing in an execution device, in each of command blocks that individually store the plurality of commands, a status flag indicating the processing status of the command,
A first list storing a list of all commands that need to be processed prior to the command and a second list storing a list of all commands waiting for the completion of execution of the command are added, and the above-mentioned state is added. A scheduler comprising an order control means for controlling the execution order of the plurality of commands to a desired order based on the flag, the first list, and the second list.
【請求項2】 前記状態フラグには、「待機中」、「準
備完了」、「実行中」、及び「実行完了」の各処理状態
を割り当てる一方、前記順序制御手段は、前記第1のリ
ストが空では無い限り、その状態フラグを「待機中」に
維持する第1のフラグ制御手段と、上記第1のリストが
空になったとき、その状態フラグを「待機中」から「準
備完了」に変更する第2のフラグ制御手段と、上記コマ
ンドを実行するとき、その状態フラグを「準備完了」か
ら「実行中」に変更する第3のフラグ制御手段と、上記
コマンドの実行完了のとき、その状態フラグを「実行
中」から「実行完了」に変更する第4のフラグ制御手段
とを備えるとともに、上記各コマンドの状態フラグの内
容を評価して「準備完了」になっているときにのみ、そ
のコマンドを実行可能にするフラグ・サーチ手段と、現
在実行中のコマンドの処理が完了したとき、その完了し
たコマンドの第2のリストに載っている待機中の各コマ
ンドをスキャンして、その各コマンドの第1のリストか
ら完了したコマンドを削除するコマンド削除手段とを備
えた請求項1記載のスケジューラ。
2. The status flag is assigned to each of the processing statuses of "standby", "ready", "running", and "execution completed", while the order control means sets the first list. Unless the flag is empty, the first flag control means for maintaining the status flag in "standby", and when the first list is empty, the status flag is changed from "waiting" to "ready". To the second flag control means for changing the status flag from "ready" to "in execution" when executing the command, and when the execution of the command is completed. A fourth flag control means for changing the status flag from "in execution" to "execution completed" is provided, and only when the contents of the status flag of each of the above commands are evaluated to be "ready" , That command can be executed When the processing of the command currently being executed is completed, the flag search means for performing scanning is performed to scan each waiting command in the second list of the completed commands, and the first command of each command is scanned. The scheduler according to claim 1, further comprising command deleting means for deleting a completed command from the list.
JP2455194A 1994-02-22 1994-02-22 Scheduler Pending JPH07234764A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2455194A JPH07234764A (en) 1994-02-22 1994-02-22 Scheduler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2455194A JPH07234764A (en) 1994-02-22 1994-02-22 Scheduler

Publications (1)

Publication Number Publication Date
JPH07234764A true JPH07234764A (en) 1995-09-05

Family

ID=12141294

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2455194A Pending JPH07234764A (en) 1994-02-22 1994-02-22 Scheduler

Country Status (1)

Country Link
JP (1) JPH07234764A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012523619A (en) * 2009-04-08 2012-10-04 グーグル インコーポレイテッド Data storage device command and interrupt grouping

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012523619A (en) * 2009-04-08 2012-10-04 グーグル インコーポレイテッド Data storage device command and interrupt grouping

Similar Documents

Publication Publication Date Title
US5956712A (en) Byte range locking in a distributed environment
EP0683453B1 (en) Multi-processor system, disk controller using the same and non-disruptive maintenance method thereof
US5535381A (en) Apparatus and method for copying and restoring disk files
US5721943A (en) Negotiable locks for concurrent access of control data by multiple programs
US5093912A (en) Dynamic resource pool expansion and contraction in multiprocessing environments
EP1624375A2 (en) Apparatus, method and program to handle an abnormality in a distributed information processing system
CN100485676C (en) Apparatus, system, and method for file system serialization reinitialization
US7047240B2 (en) File backup method and storage apparatus, computer program therefor and computer-readable medium containing the same
JPH04229355A (en) Data access method and data processing system
US7418563B2 (en) Method for controlling storage device controller, storage device controller, and program
JPS60147855A (en) Memory managing apparatus
JPH0619765A (en) Method and system for file management in computer system
EP0240616A1 (en) Method to test and set data in a record on disk in one atomic input/output operation
US20010014932A1 (en) Multi-processor system
JPH07234764A (en) Scheduler
JP2711066B2 (en) File management method and information processing system incorporating the same
JPS5852740A (en) System for restoration processing control of partitioned file
JPH0773078A (en) File copy shift system
JPH0991098A (en) Device driver access system
JP2002278705A (en) Computer system
JP3460265B2 (en) Data transfer method between computers
JPH08212064A (en) Switching system and method for shared subroutine
JP3445848B2 (en) Buffer control method for external storage device
JPH04139545A (en) Data base updating processing system
JP2000003287A (en) Exclusive controller for shared resource, method therefor and recording medium for recording exclusive control program