JPH08314740A - Process dispatch method - Google Patents

Process dispatch method

Info

Publication number
JPH08314740A
JPH08314740A JP7117386A JP11738695A JPH08314740A JP H08314740 A JPH08314740 A JP H08314740A JP 7117386 A JP7117386 A JP 7117386A JP 11738695 A JP11738695 A JP 11738695A JP H08314740 A JPH08314740 A JP H08314740A
Authority
JP
Japan
Prior art keywords
time
executed
real
execution
sharing
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
JP7117386A
Other languages
Japanese (ja)
Inventor
Kazuo Yorichika
和夫 頼近
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox 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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP7117386A priority Critical patent/JPH08314740A/en
Publication of JPH08314740A publication Critical patent/JPH08314740A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE: To suppress the increase of overhead which is caused by occurrence of a prescribed event that should start a real-time process. CONSTITUTION: As shown in (C), a CPU 1 carries out a time division process A and at the same time a CPU 2 carries out a time division process B for a time longer than a prescribed carry-over boundary time T2. If such an event that should start a real-time process occurs under such conditions, the execution of the process B is discontinued and the real-time process is started. When the real-time process is over, a time dividion process C that should be carried out after the process B is carried out by the CPU 2. The shortage X of the time slice time of the process B is carried over to the next time. When the process B is started as shown in (2) of (C), the process B is carried out for a time equivalent to the sum of the shortage X and a time slice time T1 of the process B. Thereby, the process dispatch frequency can be reduced compared with the conventional system that is shown in (B).

Description

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

【0001】[0001]

【産業上の利用分野】本発明はプロセスディスパッチ方
法に係り、特に、所定の事象が発生した場合に実行すべ
きプロセス、及び定期的に実行すべきプロセスを各々実
行するプロセスディスパッチ方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a process dispatch method, and more particularly to a process dispatch method for executing a process to be executed when a predetermined event occurs and a process to be executed periodically.

【0002】[0002]

【従来の技術及び発明が解決しようとする課題】情報処
理装置において、CPUを複数のプロセスに順に割り当
ててマルチタスクで処理を行う場合には、各プロセスの
実行においてイベント発生待ち(例えばデータの入力や
データの出力完了に伴う割込み信号の入力待ち、特定の
資源の解放待ち等)となる回数が多いか少ないか等によ
り、各プロセスをイベントが発生した場合に起動・実行
するプロセス(以下、実時間プロセスという)と、定期
的に予め定められた所定時間だけ実行するプロセス(以
下、時分割プロセスという)と、に予め区分すると共
に、各プロセスに対して実行の優先度を定めておき、実
行中のプロセスのCPU使用時間やイベントの発生の有
無や各プロセスの優先度等に応じて、CPUを割り当て
るプロセスを切替えるディスパッチ方式が知られてい
る。
2. Description of the Related Art In an information processing apparatus, when a CPU is sequentially assigned to a plurality of processes to perform multitask processing, an event occurrence wait (for example, data input) is executed in each process execution. Process that starts and executes each event when an event occurs, depending on whether the number of times that it waits for input of an interrupt signal due to completion of output of data or data output, waiting for release of specific resource, etc. is large or small. Time process) and a process that is periodically executed for a predetermined time (hereinafter referred to as a time-sharing process), and the execution priority is set for each process Switching the process to which the CPU is allocated according to the CPU usage time of the inside process, the occurrence of events, the priority of each process, etc. Dispatch system are known.

【0003】上記方式において、実時間プロセスを起動
すべきイベントが発生していない場合には、一例として
図14(A)にも示すように複数の時分割プロセスが順
次実行される。図14(A)には時分割プロセスA〜C
(優先度はプロセスC>プロセスB>プロセスAとす
る)を実行する際の動作の一例を示しており、プロセス
Cを所定時間実行するとプロセスBが起動(ディスパッ
チ)され(図14(A)の)、プロセスBを所定時間
実行するとプロセスAが起動され(図14(A)の
)、プロセスAを所定時間実行するとプロセスCが再
び起動される(図14(A)の)。
In the above method, when an event for activating a real-time process has not occurred, a plurality of time-division processes are sequentially executed as shown in FIG. 14A as an example. In FIG. 14A, time division processes A to C are shown.
An example of an operation when executing (the priority is process C> process B> process A) is shown. When the process C is executed for a predetermined time, the process B is activated (dispatched) (see FIG. 14A). ), When the process B is executed for a predetermined time, the process A is activated (in FIG. 14A), and when the process A is executed for a predetermined time, the process C is activated again (in FIG. 14A).

【0004】図14(A)からも明らかなように、各プ
ロセスに対しCPUを割当てる時間(各プロセスの実行
時間)は、プロセスの優先度が高くなるに従って長くな
るように設定されており、何れかのプロセスが自発的に
イベント発生待ち等の待ち状態にならない限りは、プロ
セスC→B→Aの順に、各プロセスの優先度に応じた時
間だけ繰り返し実行される。
As is apparent from FIG. 14A, the time for allocating the CPU to each process (the execution time of each process) is set to be longer as the process priority increases. Unless any of the processes spontaneously waits for the occurrence of an event or the like, the processes are repeatedly executed in the order of process C → B → A for a time corresponding to the priority of each process.

【0005】また、実時間プロセスを起動すべきイベン
トが発生した場合には、一例として図14(B)に示す
ように実時間プロセスが実行される。図14(B)には
実時間プロセスD〜F(優先度はプロセスF>プロセス
E>プロセスDとする)を実行する際の動作の一例を示
しており、プロセスD実行中にプロセスEを起動すべき
イベント1が発生すると直ちにプロセスEが起動され
(図14(B)の)、プロセスEで他のプロセスの起
動要求やイベントの設定が行われなければ、プロセスE
が自発的に待ち状態に移行したときに、直前に実行して
いたプロセス(図14(B)ではプロセスD)が再び起
動される(図14(B)の)。また同様に、プロセス
Eの起動を促すイベント2、プロセスFの起動を促すイ
ベント3が連続して発生すると(図14(B)の、
)、イベントが発生する毎に実行中のプロセスが直ち
に中断されて対応するプロセスが起動される。
Further, when an event for activating a real-time process occurs, the real-time process is executed as shown in FIG. 14B as an example. FIG. 14B shows an example of the operation when executing the real-time processes D to F (the priority is process F> process E> process D), and the process E is started during the execution of the process D. As soon as the event 1 to be generated occurs, the process E is started (in FIG. 14B). If the process E does not make a request to start another process or set an event, the process E is started.
When the device spontaneously shifts to the waiting state, the process (process D in FIG. 14B) that was being executed immediately before is restarted (in FIG. 14B). Similarly, when the event 2 that prompts the activation of the process E and the event 3 that prompts the activation of the process F occur consecutively (see FIG. 14 (B),
), Each time an event occurs, the running process is immediately interrupted and the corresponding process is started.

【0006】実時間プロセスは、イベントの発生に対し
高い応答性を確保するため、対応するイベントが発生す
ると直ちに起動される代わりに、CPUを長時間に亘っ
て占有することがないようにCPU使用時間が制限され
ていることが一般的である。図14(B)においても、
イベントの発生により起動された実時間プロセスは、他
のプロセスを起動すべきイベントが発生しなくても比較
的短時間実行された後に自発的に待ち状態に移行し、他
のプロセスが起動されている(図14(B)の、及
び)。
[0006] The real-time process ensures high responsiveness to the occurrence of an event, so that instead of being activated immediately when a corresponding event occurs, the real-time process uses the CPU so as not to occupy the CPU for a long time. Time is typically limited. Also in FIG. 14B,
The real-time process started by the occurrence of the event will run for a relatively short time even if there is no event that should start the other process, then voluntarily shift to the waiting state, and the other process is started. (FIG. 14 (B) and).

【0007】また、時分割プロセスと実時間プロセスと
が混在した場合の動作の一例を図14(C)に示す。図
14(C)に示した例では、時分割プロセスCが所定時
間実行されることにより時分割プロセスBが起動され
(図14(C)の)てから、比較的短い時間が経過し
た後に実時間プロセスEを起動すべきイベント4が発生
しており(図14(C)の)、このイベント4の発生
により時分割プロセスBの実行が中断されて実時間プロ
セスEが直ちに起動される。時分割プロセスBは実時間
プロセスEが自発的に待ち状態に移行した時点で再起動
され(図14(C)の)、実行中断前のCPU使用時
間(図14(C)の〜の時間)と、実行再開後のC
PU使用時間(図14(C)の以降の時間)との合計
が所定時間に達すると、次に実行すべき時分割プロセス
Cが起動される(図14(C)の)。
FIG. 14C shows an example of the operation when the time division process and the real time process are mixed. In the example shown in FIG. 14C, the time-division process C is executed for a predetermined time to activate the time-division process B (in FIG. 14C), and then the real-time process is performed after a relatively short time has elapsed. Event 4 that should activate the time process E has occurred (FIG. 14C), and the occurrence of this event 4 interrupts the execution of the time-sharing process B and immediately activates the real-time process E. The time-divisional process B is restarted when the real-time process E voluntarily shifts to the waiting state (in FIG. 14C), and the CPU usage time before execution suspension (time in FIG. 14C). And C after resuming execution
When the total of the PU usage time (time after FIG. 14C) reaches a predetermined time, the time division process C to be executed next is activated (in FIG. 14C).

【0008】ところで、CPUを割り当てるプロセスの
切替えは、実行中のプロセスからOS(オペレーティン
グシステム)へCPUが明け渡され、OSにより、実行
していたプロセスのキューへの繋ぎ替え、次に実行すべ
きプロセスの判断、判断したプロセスのキューからの取
出し等が行われた後に、OSから前記キューから取出さ
れたプロセスへCPUが明け渡される等の一連の処理に
より実現される。このプロセスの切替えは、マルチタス
クで処理を行う場合に必須の処理であるが、プロセスの
実行のようにCPUで実行すべき本質的な処理ではな
く、情報処理装置のオーバヘッドである。情報処理装置
の実質的な処理能力を向上させるにはオーバヘッドをな
るべく小さくすることが望ましい。
By the way, when switching the process to which the CPU is assigned, the CPU is released from the running process to the OS (operating system), the OS switches the running process to the queue, and the process to be executed next. Is performed, and after the judged process is taken out from the queue or the like, the process is realized by a series of processing such as yielding the CPU from the OS to the process taken out from the queue. This process switching is an indispensable process when multi-tasking is performed, but it is not an essential process to be executed by the CPU like process execution, but an overhead of the information processing device. In order to improve the substantial processing capability of the information processing device, it is desirable to reduce the overhead as much as possible.

【0009】先に説明した図14(A)〜(C)では、
プロセスの切替えが行われるタイミングを丸付き数字及
び矢印で示しているが、図14からも明らかなように、
前述したディスパッチ方式では、時分割プロセス実行中
にイベントが発生し実時間プロセスの起動が必要となっ
た場合(図14(C))に、時分割プロセスのみを実行
している場合及び実時間プロセスのみを実行している場
合と比較してプロセスの切替え回数が増加し、オーバヘ
ッドが増大して情報処理装置の実質的な処理能力が低下
する、という問題があった。
In FIGS. 14A to 14C described above,
The timing at which the process is switched is indicated by circled numbers and arrows, but as is clear from FIG. 14,
In the dispatch method described above, when an event occurs during execution of the time-sharing process and the real-time process needs to be activated (FIG. 14C), only the time-sharing process is executed and the real-time process is executed. There is a problem in that the number of process switchings increases, the overhead increases, and the substantial processing capability of the information processing apparatus decreases as compared with the case where only the information processing apparatus is executed.

【0010】また、上記に関連して特開平2-156337号公
報には、各プロセスに適切な優先度を設定するために、
ファジイ関数を用い応答要求の度合い及びI/O要求の
度合いを考慮して各プロセスの優先度を決定する技術が
示されている。また、特開平6-12263号公報には、装置
全体のスループットを向上させるために、CPU使用率
やI/O使用率を考慮してプロセスの優先順位を動的に
変更する方式が示されている。しかし、上記何れの公報
に記載の技術についても、前述の問題に関して何ら考慮
されておらず、時分割プロセス実行中に実時間プロセス
を起動すべきイベントが発生した場合のオーバヘッドの
増大を回避できない。
Further, in connection with the above, Japanese Patent Laid-Open No. 2-156337 discloses that in order to set an appropriate priority for each process,
A technique is disclosed in which the priority of each process is determined in consideration of the degree of response request and the degree of I / O request using a fuzzy function. Further, Japanese Patent Laid-Open No. 6-12263 discloses a method of dynamically changing the priority of processes in consideration of the CPU usage rate and the I / O usage rate in order to improve the throughput of the entire device. There is. However, none of the techniques described in any of the above publications considers the above-mentioned problem, and it is impossible to avoid an increase in overhead when an event that should activate a real-time process occurs during execution of a time-sharing process.

【0011】本発明は上記事実を考慮して成されたもの
で、実時間プロセスを起動すべき所定の事象の発生によ
りオーバヘッドが増大することを抑制できるプロセスデ
ィスパッチ方法を得ることが目的である。
The present invention has been made in consideration of the above facts, and an object thereof is to obtain a process dispatch method capable of suppressing an increase in overhead due to occurrence of a predetermined event for activating a real-time process.

【0012】[0012]

【課題を解決するための手段】上記目的を達成するため
に請求項1記載の発明は、定期的に実行すべき複数の時
分割プロセス及び所定の事象が発生した場合に実行すべ
き実時間プロセスを各々実行するにあたり、前記複数の
時分割プロセスの各々に対し、通常実行時間及び該通常
実行時間よりも短い繰越し境界時間を予め定めておき、
前記所定の事象が発生していない場合は、前記複数の時
分割プロセスの各々を、各時分割プロセスの通常実行時
間だけ順にかつ繰返し実行し、所定の事象の発生に伴い
実時間プロセスを起動するために実行中の所定の時分割
プロセスの実行を中断する場合は、前記所定の時分割プ
ロセスの実行を開始してからの経過時間が前記所定の時
分割プロセスの繰越し境界時間以上であれば、前記所定
の時分割プロセスの実行を中断して前記実時間プロセス
を起動し、時分割プロセスを実行可能な状態となったと
きには前記所定の時分割プロセスに続いて実行すべき別
の時分割プロセスを実行すると共に、前記実行の中断に
より生じた前記所定の時分割プロセスの通常実行時間の
不足分を、前記所定の時分割プロセスを再び実行する際
へ繰り越すことを特徴としている。
In order to achieve the above object, the invention according to claim 1 is to provide a plurality of time division processes to be executed periodically and a real time process to be executed when a predetermined event occurs. In each of the above, for each of the plurality of time-sharing processes, a normal execution time and a carry-forward boundary time shorter than the normal execution time are set in advance,
When the predetermined event has not occurred, each of the plurality of time-sharing processes is sequentially and repeatedly executed by the normal execution time of each time-sharing process, and the real-time process is activated when the predetermined event occurs. In order to suspend the execution of the predetermined time-division process being executed for, if the elapsed time from the start of execution of the predetermined time-division process is equal to or more than the carry-over boundary time of the predetermined time-division process, When the execution of the predetermined time-sharing process is interrupted, the real-time process is started, and when the time-sharing process is ready for execution, another time-sharing process to be executed subsequent to the predetermined time-sharing process is executed. Along with the execution, the shortage of the normal execution time of the predetermined time division process caused by the interruption of the execution is carried over to the time of executing the predetermined time division process again. It is a symptom.

【0013】請求項2記載の発明は、所定の事象が発生
した場合に実行すべき実時間プロセスを含む多数のプロ
セスを各々実行するにあたり、前記所定の事象が発生し
た場合に、予め設定した許容遅延時間内に現在実行中の
プロセスが待機状態になるか否かを判断し、現在実行中
のプロセスが許容遅延時間内に待機状態となると判断し
た場合には、前記プロセスが待機状態となったときに前
記実時間プロセスを起動することを特徴としている。
According to a second aspect of the present invention, when each of a large number of processes including a real-time process to be executed when a predetermined event occurs, when a predetermined event occurs, a preset allowance is set. If it is determined whether the currently executing process is in the waiting state within the delay time, and if it is determined that the currently executing process is in the waiting state within the allowable delay time, the process is placed in the waiting state. It is characterized in that the real-time process is activated at times.

【0014】請求項3記載の発明は、所定の事象が発生
した場合に実行すべき実時間プロセスを含む多数のプロ
セスを各々実行するにあたり、前記所定の事象が発生し
た場合に、現在実行中のプロセスが待機状態になるか、
又は前記所定の事象が発生してからの経過時間が予め設
定した許容遅延時間となったときに前記実時間プロセス
を起動することを特徴としている。
According to a third aspect of the present invention, when each of a large number of processes including a real-time process to be executed when a predetermined event occurs, when the predetermined event occurs, the current process is being executed. The process is waiting,
Alternatively, the real-time process is activated when an elapsed time after the occurrence of the predetermined event reaches a preset allowable delay time.

【0015】請求項4記載の発明は、請求項2又は請求
項3記載の発明において、前記多数のプロセスには、定
期的に実行すべき複数の時分割プロセスが含まれてお
り、前記複数の時分割プロセスの各々に対し、通常実行
時間及び該通常実行時間よりも短い繰越し境界時間を定
めておき、前記所定の事象が発生していない場合は、前
記複数の時分割プロセスの各々を、各時分割プロセスの
通常実行時間だけ順にかつ繰返し実行し、前記所定の事
象が発生した場合に、実行中でかつ実行を開始してから
前記繰越し境界時間以上経過した所定の時分割プロセス
が有れば、前記所定の時分割プロセスの実行を中断して
前記実時間プロセスを起動し、時分割プロセスを実行可
能な状態となったときには前記所定の時分割プロセスに
続いて実行すべき別の時分割プロセスを実行すると共
に、前記実行の中断により生じた前記所定の時分割プロ
セスの通常実行時間の不足分を、前記所定の時分割プロ
セスを再び実行する際へ繰り越すことを特徴としてい
る。
According to a fourth aspect of the present invention, in the second or third aspect of the invention, the plurality of processes include a plurality of time division processes to be executed periodically, and the plurality of time division processes are included. A normal execution time and a carry-over boundary time shorter than the normal execution time are defined for each of the time-division processes, and when the predetermined event has not occurred, each of the plurality of time-division processes is If there is a predetermined time-division process that is being executed and has passed the carry-over boundary time or more after the execution is started when the predetermined event occurs, the time-division process is executed sequentially and repeatedly for the normal execution time. , The execution of the predetermined time-sharing process is suspended, the real-time process is started, and when the time-sharing process is ready to be executed, it should be executed following the predetermined time-sharing process. Time and executes the dividing process, the usual shortage of execution times of the predetermined time-division processes caused by interruption of the execution, is characterized in that carried over to the time of executing said predetermined time-division process again.

【0016】請求項5記載の発明は、請求項1又は請求
項4記載の発明において、過去に所定の時分割プロセス
の実行を中断することにより生じた通常実行時間の不足
分を繰り越して前記所定の時分割プロセスを実行してい
るときには、前記所定の時分割プロセスの優先度を通常
時よりも高くすることを特徴としている。
According to a fifth aspect of the invention, in the first or fourth aspect of the invention, the shortage of the normal execution time caused by interrupting the execution of the predetermined time division process in the past is carried over to the predetermined time. When the time-division process is executed, the priority of the predetermined time-division process is set to be higher than that of the normal time.

【0017】請求項6記載の発明は、請求項1又は請求
項4記載の発明において、複数の処理部で複数のプロセ
スを並列に実行する場合に、前記複数の処理部のうちの
少なくとも1つの処理部で実行される前記時分割プロセ
スの繰越し境界時間を、他の処理部における時分割プロ
セスの実行状況に応じて変更することを特徴としてい
る。
According to a sixth aspect of the invention, in the invention of the first or fourth aspect, when a plurality of processing units execute a plurality of processes in parallel, at least one of the plurality of processing units is used. The carry-over boundary time of the time division process executed in the processing unit is changed according to the execution status of the time division process in another processing unit.

【0018】[0018]

【作用】一般に時分割プロセス、特に優先度の低い時分
割プロセスを要求通りに実行するには、所定期間当りの
実行率(所定期間に占める特定の時分割プロセスのCP
U使用時間の割合)が規定値を満たすようにすることが
重要であり、実行単位の大きさ(1回当りの実行時間)
はそれ程重要ではない。そして、所定期間当りの実行率
が規定値を満たしていれば、実行単位を大きくして実行
回数を少なくした方がオーバヘッドが小さくて済む。本
願発明者は上記事実に想到して本発明を成すに至った。
In general, in order to execute a time-sharing process, especially a time-sharing process having a low priority, as required, an execution rate per a predetermined period (CP of a specific time-sharing process in a predetermined period)
It is important that the ratio of U usage time) satisfies the specified value, and the size of the execution unit (execution time per execution)
Is not that important. If the execution rate per a predetermined period satisfies the specified value, the overhead can be reduced by increasing the execution unit and decreasing the number of executions. The inventor of the present application has reached the above facts and completed the present invention.

【0019】このため請求項1記載の発明では、所定の
事象の発生に伴い実時間プロセスを起動するために実行
中の所定の時分割プロセスの実行を中断する場合は、所
定の時分割プロセスの実行を開始してからの経過時間が
所定の時分割プロセスの繰越し境界時間以上であれば、
所定の時分割プロセスの実行を中断して実時間プロセス
を起動し、時分割プロセスを実行可能な状態となったと
きには所定の時分割プロセスに続いて実行すべき別の時
分割プロセスを実行すると共に、前記実行の中断により
生じた所定の時分割プロセスの通常実行時間の不足分
を、所定の時分割プロセスを再び実行する際へ繰り越す
ようにしている。
Therefore, according to the first aspect of the invention, when the execution of the predetermined time-sharing process being executed to start the real-time process is interrupted when a predetermined event occurs, the predetermined time-sharing process is executed. If the elapsed time from the start of execution is equal to or longer than the carry-over boundary time of the predetermined time division process,
When the execution of a predetermined time-sharing process is interrupted, a real-time process is started, and when the time-sharing process becomes ready to execute, another time-sharing process that should be executed following the predetermined time-sharing process is executed. The shortage of the normal execution time of the predetermined time division process caused by the suspension of the execution is carried over to the execution of the predetermined time division process again.

【0020】上記によれば、時分割プロセスの実行を開
始してからの経過時間が繰越し境界時間以上のとき、す
なわち時分割プロセスの実行時間の残りが少ないときに
は、実時間プロセスを実行した後に中断していた時分割
プロセスの再開を行わないので、時分割プロセスの実行
時間の残りが少ないにも拘わらず時分割プロセスの実行
を再開するために無駄にプロセスの切替え(ディスパッ
チ)を行うことがなくなり、プロセスのディスパッチを
行う回数が従来よりも少なくて済む。これにより、実時
間プロセスを起動すべき所定の事象の発生によりオーバ
ヘッドが増大することを抑制できる。
According to the above, when the elapsed time from the start of execution of the time-division process is the carry-over boundary time or more, that is, when the remaining execution time of the time-division process is small, the real-time process is executed and then interrupted. Since the time-sharing process that was being performed is not restarted, unnecessary process switching (dispatching) is performed in order to restart the execution of the time-sharing process even though the execution time of the time-sharing process is short. , The number of process dispatches is less than before. As a result, it is possible to prevent the overhead from increasing due to the occurrence of a predetermined event that should activate the real-time process.

【0021】また上記では、実時間プロセスを起動した
後に、時分割プロセスを実行可能な状態となったときに
は実行が中断された所定の時分割プロセスに続いて実行
すべき別の時分割プロセスを実行するので、所定の事象
の発生により実行が中断された時分割プロセスの実行率
は一時的に低下することになるが、実行の中断により生
じた時分割プロセスの通常実行時間の不足分は、時分割
プロセスを再び実行する際に繰り越され、再び実行され
る際には通常実行時間よりも長い時間実行されることに
なるので、前記時分割プロセスの実行率の平均値は一定
値に維持されることになる。
Further, in the above, when the time-division process is ready to be executed after the real-time process is activated, another time-division process to be executed is executed following the predetermined time-division process whose execution has been interrupted. Therefore, the execution rate of the time-sharing process whose execution was interrupted due to the occurrence of a predetermined event will temporarily decrease, but the shortage of the normal execution time of the time-sharing process caused by the interruption of execution When the divided process is executed again, it is carried over, and when it is executed again, it is executed for a time longer than the normal execution time. Therefore, the average value of the execution ratio of the time divided process is maintained at a constant value. It will be.

【0022】ところで、実時間プロセスを起動すべき所
定の事象が発生した場合、従来は図14にも示すよう
に、直ちに実行中のプロセスを中断して実時間プロセス
を起動することが通例であり、これに伴いプロセスの切
替え回数の増加、オーバヘッドの増大を招いていた。し
かし、所定の事象はプロセスの実行と非同期に発生する
ので、所定の事象が発生してから比較的短時間で、実行
中のプロセスの実行が終了する可能性がある。
By the way, when a predetermined event for activating a real-time process occurs, conventionally, as shown in FIG. 14, it is customary to immediately interrupt the process being executed and activate the real-time process. As a result, the number of process switchings and the overhead are increased. However, since the predetermined event occurs asynchronously with the execution of the process, there is a possibility that the execution of the process being executed will be completed within a relatively short time after the occurrence of the predetermined event.

【0023】このため請求項2記載の発明では、実時間
プロセスを起動すべき所定の事象が発生した場合に予め
設定した許容遅延時間内に現在実行中のプロセスが待機
状態になるか否かを判断し、現在実行中のプロセスが許
容遅延時間内に待機状態となると判断した場合には、前
記プロセスが待機状態となったときに実時間プロセスを
起動するようにしている。上記によれば、所定の事象が
発生したとしても、予め設定した許容遅延時間内に現在
実行中のプロセスが待機状態になる場合には他のプロセ
スの実行を中断しないので、上記場合におけるプロセス
のディスパッチの回数が少なくて済むので、実時間プロ
セスを起動すべき所定の事象の発生によりオーバヘッド
が増大することを抑制できる。
Therefore, according to the second aspect of the present invention, when a predetermined event for activating a real-time process occurs, it is determined whether or not the process currently being executed enters a standby state within a preset allowable delay time. If it is determined that the currently executing process is in the standby state within the allowable delay time, the real-time process is activated when the process is in the standby state. According to the above, even if a predetermined event occurs, execution of other processes will not be interrupted if the currently executing process enters the standby state within the preset allowable delay time. Since the number of dispatches is small, it is possible to prevent the overhead from increasing due to the occurrence of a predetermined event that should activate the real-time process.

【0024】なお、時分割プロセスは通常は予め設定さ
れた時間だけ実行されるので、時分割プロセスが実行中
の場合には、該時分割プロセスの実行を開始してからの
経過時間に基づいて、前記待機状態になるか否かの判断
を行うことができる。また、実時間プロセスについては
待機状態となる時間を予め検知することは困難である
が、例えば起動してから自発的に待機状態となる迄の最
大時間を予め計測しておく等により、時分割プロセスが
実行中の場合に該時分割プロセスが待機状態になるか否
かの判断を行うことは可能である。
Since the time-sharing process is normally executed for a preset time, when the time-sharing process is being executed, the time-sharing process is executed based on the elapsed time from the start of execution of the time-sharing process. It is possible to determine whether or not to enter the standby state. In addition, it is difficult to detect the standby time for a real-time process in advance. However, for example, by measuring in advance the maximum time from startup to the spontaneous standby status, time sharing It is possible to determine whether or not the time-sharing process is in a standby state when the process is running.

【0025】また、請求項3記載の発明では、実時間プ
ロセスを起動すべき所定の事象が発生した場合に、現在
実行中のプロセスが待機状態になるか、又は所定の事象
が発生してからの経過時間が予め設定した許容遅延時間
となったときに実時間プロセスを起動するようにしてい
る。前述したように、実時間プロセス或いは時分割プロ
セスについても自発的に待機状態となる時間を予め検知
することは困難であるが、上記によれば、実行中のプロ
セスが許容遅延時間内に待機状態となった場合には、待
機状態となったプロセスに続いて実時間プロセスを実行
することができ、他のプロセスの実行を中断せずに済
む。従って、プロセスのディスパッチの回数が少なくて
済み、実時間プロセスを起動すべき所定の事象の発生に
よりオーバヘッドが増大することを抑制できる。
According to the third aspect of the present invention, when a predetermined event for activating a real-time process occurs, the process currently being executed enters a standby state or after the predetermined event occurs. The real-time process is started when the elapsed time reaches the preset allowable delay time. As described above, it is difficult to detect beforehand the time when a real-time process or a time-sharing process spontaneously enters the waiting state. However, according to the above, the running process is in the waiting state within the allowable delay time. In this case, the real-time process can be executed subsequently to the process in the waiting state, and the execution of other processes can be uninterrupted. Therefore, the number of times the process is dispatched is small, and it is possible to prevent the overhead from increasing due to the occurrence of a predetermined event that should activate the real-time process.

【0026】また請求項4に記載したように、請求項2
又は請求項3においても、所定の事象が発生した場合
に、実行中でかつ実行を開始してから繰越し境界時間以
上経過した所定の時分割プロセスが有れば、所定の時分
割プロセスの実行を中断して実時間プロセスを起動し、
時分割プロセスを実行可能な状態となったときには所定
の時分割プロセスに続いて実行すべき別の時分割プロセ
スを実行すると共に、実行の中断により生じた前記所定
の時分割プロセスの通常実行時間の不足分を、所定の時
分割プロセスを再び実行する際へ繰り越すことが好まし
い。
Further, as described in claim 4, claim 2
Alternatively, also in claim 3, when a predetermined event occurs, if there is a predetermined time-sharing process that is being executed and has passed over the carry-over boundary time since the start of execution, the predetermined time-sharing process is executed. Interrupt and launch the real-time process,
When it becomes possible to execute a time-division process, another time-division process that should be executed following the predetermined time-division process is executed, and the normal execution time of the predetermined time-division process caused by interruption of execution is It is preferable to carry over the deficiency in performing the predetermined time-sharing process again.

【0027】上記によれば、実行中でかつ実行を開始し
てから繰越し境界時間以上経過した所定の時分割プロセ
スが有れば、所定の事象の発生から直ちに実時間プロセ
スが起動されるので、所定の事象の発生に対する実時間
プロセス起動の応答性が向上する。また請求項1と同様
に、所定の事象が発生した際に、実行中の時分割プロセ
スの実行時間の残りが少ないにも拘わらず時分割プロセ
スの実行を再開するために無駄にプロセスのディスパッ
チを行うことがなくなり、プロセスのディスパッチを行
う回数が従来よりも少なくて済むので、実時間プロセス
を起動すべき所定の事象の発生によりオーバヘッドが増
大することを抑制できる。
According to the above, if there is a predetermined time-sharing process that is being executed and has passed over the carry-over boundary time since the start of execution, the real-time process is started immediately after the occurrence of a predetermined event. The responsiveness of real-time process startup to the occurrence of a predetermined event is improved. Similarly to claim 1, when a predetermined event occurs, the process is unnecessarily dispatched in order to restart the execution of the time-sharing process even though the remaining time of the time-sharing process being executed is small. Since the process is not performed and the number of times of dispatching the process is smaller than in the conventional case, it is possible to prevent the overhead from increasing due to the occurrence of a predetermined event that should activate the real-time process.

【0028】ところで、所定の時分割プロセスの実行を
中断し、該中断により生じた通常実行時間の不足分を繰
り越した場合、該不足分を通常実行時間に加えて前記所
定の時分割プロセスを実行している際に、再び所定の事
象の発生等により所定の時分割プロセスの実行が中断さ
れることがある。この場合、所定の時分割プロセスの実
行率が大きく低下することになるので好ましくない。
By the way, when the execution of the predetermined time-division process is interrupted and the shortfall of the normal execution time caused by the interruption is carried over, the shortfall is added to the normal execution time to execute the predetermined time-division process. While doing so, the execution of the predetermined time-sharing process may be interrupted again due to the occurrence of a predetermined event or the like. In this case, the execution rate of the predetermined time-sharing process is greatly reduced, which is not preferable.

【0029】上記を考慮すると、請求項5にも記載した
ように、過去に所定の時分割プロセスの実行を中断する
ことにより生じた通常実行時間の不足分を繰り越して所
定の時分割プロセスを実行しているときには、記所定の
時分割プロセスの優先度を通常時よりも高くすることが
好ましい。これにより、特定の時分割プロセスの実行が
短い時間間隔で複数回中断されることにより、該特定の
時分割プロセスの実行率が大きく低下することを回避す
ることができる。
In view of the above, as described in claim 5, the shortage of the normal execution time caused by interrupting the execution of the predetermined time-sharing process in the past is carried over to execute the predetermined time-sharing process. During this time, it is preferable that the priority of the predetermined time division process is set higher than that of the normal time. As a result, it is possible to prevent the execution rate of the specific time-division process from being significantly reduced by suspending the execution of the specific time-division process multiple times at short time intervals.

【0030】また、請求項1又は請求項4において、時
分割プロセス実行中に実時間プロセスを実行すべき所定
の事象が発生した場合、時分割プロセスを実行可能な状
態となったときに、実行を中断した時分割プロセスを再
起動するよりも、時分割プロセスの実行時間の不足分を
繰り越した方がディスパッチを行う回数が少なくなり、
オーバヘッドの増大を抑制できる。しかし、時分割プロ
セスの通常実行時間の不足分の繰り越しを行うか否か
は、時分割プロセスの実行を開始してから所定の事象が
発生する迄の時間が繰越し境界時間以上か否かに依存す
る。
Further, in claim 1 or claim 4, when a predetermined event for executing the real-time process occurs during execution of the time-sharing process, the execution is performed when the time-sharing process is ready to be executed. The number of dispatches will be less if you carry over the lack of execution time of the time-sharing process than when you restart the time-sharing process that interrupted
The increase in overhead can be suppressed. However, whether or not to carry over the shortage of the normal execution time of the time-sharing process depends on whether the time from the start of execution of the time-sharing process to the occurrence of a predetermined event is the carry-over boundary time or more. To do.

【0031】このため、繰越し境界時間として比較的大
きな値が設定されている時分割プロセスを実行している
ときには、所定の事象が発生した場合に、実行が中断さ
れた時分割プロセスに対し通常実行時間の不足分の繰越
しを行わず、従来と同様に、オーバヘッドが増大する可
能性が高い。特に、複数の処理部で複数のプロセスを並
列に実行する際に、各処理部で実行されているプロセス
が繰越し境界時間として比較的大きな値が設定された時
分割プロセスであった場合には、所定の事象の発生に伴
ってオーバヘッドが増大する可能性が非常に高い。
Therefore, when a time-sharing process in which a relatively large value is set as the carry-over boundary time is being executed, when a predetermined event occurs, the time-sharing process whose execution is interrupted is normally executed. As in the conventional case, the overhead is likely to increase without carrying over the lack of time. In particular, when executing multiple processes in parallel in multiple processing units, if the process being executed in each processing unit is a time division process in which a relatively large value is set as the carry-over boundary time, It is very likely that the overhead will increase with the occurrence of a given event.

【0032】上記のような状況を考慮すると、請求項6
にも記載したように、複数の処理部で複数のプロセスを
並列に実行する場合に、複数の処理部のうちの少なくと
も1つの処理部で実行される時分割プロセスの繰越し境
界時間を、他の処理部における時分割プロセスの実行状
況に応じて変更することが好ましい。これにより、例え
ば上記のように各々繰越し境界時間として比較的大きな
値が設定された複数の時分割プロセスを複数の処理部で
並列に実行する等の状況において、例えば少なくとも何
れか1つの時分割プロセスの繰越し境界時間を小さい値
に変更する等により、所定の事象の発生に伴うオーバヘ
ッドの増大を回避できる可能性が高くなる。従って、時
分割プロセスの実行状況に拘わらず所定の事象の発生に
伴うオーバヘッドの増大を回避できる。
In view of the above situation, claim 6
As described above, when the plurality of processing units execute the plurality of processes in parallel, the carry-over boundary time of the time-sharing process executed by at least one of the plurality of processing units is It is preferable to change according to the execution status of the time division process in the processing unit. As a result, for example, in a situation in which a plurality of time division processes each having a relatively large carry-over boundary time set as described above are executed in parallel by a plurality of processing units, for example, at least one time division process is executed. For example, by changing the carry-over boundary time to a small value, it is possible to avoid an increase in overhead due to occurrence of a predetermined event. Therefore, it is possible to avoid an increase in overhead due to occurrence of a predetermined event regardless of the execution status of the time division process.

【0033】[0033]

【実施例】以下、図面を参照して本発明の実施例を詳細
に説明する。なお、以下では本発明に支障のない数値を
用いて説明するが、本発明は以下に記載した数値に限定
されるものではない。
Embodiments of the present invention will be described below in detail with reference to the drawings. In addition, although the following description will be given using numerical values that do not hinder the present invention, the present invention is not limited to the numerical values described below.

【0034】図1には本発明を適用可能な情報処理装置
10の概略構成図が示されている。情報処理装置10は
n個のCPU1、CPU2、…、CPUnを備えてお
り、各CPUは各々バス14に接続されている。バス1
4には図示しない各種周辺装置(例えばキーボード、デ
ィスプレイ、プリンタ、通信制御装置等)が接続されて
いる。またバス14には、各CPUの主記憶装置として
機能する共有メモリ16が接続されている。共有メモリ
16の記憶領域には、プロセスディスパッチ制御プログ
ラム18及びシステムデータベース20を含む各種情報
が予め記憶されている。
FIG. 1 shows a schematic block diagram of an information processing apparatus 10 to which the present invention can be applied. The information processing device 10 includes n CPUs 1, CPU 2, ..., CPUn, and each CPU is connected to a bus 14. Bus 1
Various peripheral devices (not shown) (for example, keyboard, display, printer, communication control device, etc.) are connected to 4. A shared memory 16 that functions as a main storage device of each CPU is connected to the bus 14. Various information including the process dispatch control program 18 and the system database 20 is stored in advance in the storage area of the shared memory 16.

【0035】本実施例に係る情報処理装置10は、CP
U1、CPU2、…、CPUnが互いに並列に動作し、
かつマスタスレーブシステムのように各CPUの役割分
担が定められていない、所謂対称型のマルチプロセッサ
システムとされている。このため、情報処理装置10で
実行すべき多数のプロセスが各々何れのCPUで実行さ
れるかは不定とされており、前述したプロセスディスパ
ッチ制御プログラム18は、各CPUにおいて実行する
プロセスを切替える等の場合に実行される。
The information processing apparatus 10 according to the present embodiment has a CP
U1, CPU2, ..., CPUn operate in parallel with each other,
Moreover, it is a so-called symmetric multiprocessor system in which the division of roles of each CPU is not defined like the master-slave system. Therefore, it is indefinite which CPU each of the multiple processes to be executed by the information processing apparatus 10 is executed, and the above-described process dispatch control program 18 switches the processes executed in each CPU. If executed.

【0036】図2に示すように、システムデータベース
20は、時分割クラス待ち行列20A、実時間クラス待
ち行列20B、起動遅延テーブル20C、実行中プロセ
ステーブル20D等の各種情報を含んで構成されてい
る。
As shown in FIG. 2, the system database 20 is configured to include various information such as the time division class queue 20A, the real time class queue 20B, the activation delay table 20C and the running process table 20D. .

【0037】情報処理装置10で実行すべき多数のプロ
セスは、定期的に実行すべきプロセス(時分割プロセ
ス)のグループ(時分割クラス)、又は所定のイベント
が発生した場合に実行すべきプロセス(実時間プロセ
ス)のグループ(実時間クラス)に各々予め区分されて
おり、各々実行の優先度が予め付与されている。共有メ
モリ16上には、各プロセスに対応して各プロセスの実
行に必要な各種情報を設定するためのタスクコントロー
ルブロック(以下「TCB」と称する)が設けられてい
る。時分割クラス待ち行列20Aには実行待ち状態の時
分割プロセスのTCBがプロセスの実行順にリンクされ
ており、実時間クラス待ち行列20Bには実時間プロセ
スのTCBが優先度の降順にリンクされている。
A large number of processes to be executed by the information processing apparatus 10 are a group of processes (time-division processes) to be executed periodically (time-division class), or processes to be executed when a predetermined event occurs ( Each of them is pre-divided into groups (real-time classes) (real-time processes), and execution priorities are given in advance. The shared memory 16 is provided with a task control block (hereinafter referred to as “TCB”) for setting various information necessary for executing each process corresponding to each process. The time division class queue 20A is linked with the TCBs of the time division processes in the execution waiting state, and the real time class queue 20B is linked with the TCBs of the real time processes in descending order of priority. .

【0038】図3に示すように、TCBにはプロセスの
名称、サイズ、クラス(時分割プロセスか実時間プロセ
スか)等の情報で構成されるプロセス情報(1)、プロ
セスの実行に際して使用される共有メモリ16上の所定
領域の位置を表すマッピング情報等で構成されるプロセ
ス情報(2)、プロセス毎に予め定められたプロセス優
先度等の情報が予め設定されている。また、時分割プロ
セスのTCBについては、タイムスライス時間T1(本
発明の通常実行時間に相当)及び繰越し境界時間T2も
設定されている。
As shown in FIG. 3, the TCB includes process information (1) composed of information such as process name, size, class (whether a time division process or a real time process), and is used when the process is executed. Process information (2) including mapping information and the like indicating the position of a predetermined area on the shared memory 16, and information such as process priority determined in advance for each process are set in advance. Further, regarding the TCB of the time division process, a time slice time T1 (corresponding to the normal execution time of the present invention) and a carry-over boundary time T2 are also set.

【0039】更に、TCBにはプロセス情報(3)、繰
越し処理フラグ、及び繰越し時間T3(本発明の通常実
行時間の不足分に相当)又は実行残時間Tsを設定する
ためのフィールドが設けられている。プロセス情報
(3)のフィールドは、先にプロセスの実行が終了又は
中断された際にCPUのレジスタやプログラムカウンタ
等に保持されていた情報を退避するための領域とされて
いる。繰越し処理フラグ、繰越し時間T3、実行残時間
Tsについては後述するが、時分割プロセスのTCBに
のみ設定される。
Further, the TCB is provided with fields for setting process information (3), a carry-over processing flag, and carry-over time T3 (corresponding to the shortage of the normal execution time of the present invention) or remaining execution time Ts. There is. The field of the process information (3) is an area for saving the information held in the register of the CPU, the program counter, or the like when the execution of the process is first ended or interrupted. The carry-over process flag, the carry-over time T3, and the remaining execution time Ts will be described later, but are set only in the TCB of the time division process.

【0040】また起動遅延テーブル20Cは、次の表1
にも示すように、実時間プロセスを起動すべきイベント
が発生してから対応する実時間プロセスを起動するまで
の許容遅延時間をプロセスの優先度及びCPU毎に定め
たものである。なお本実施例では、表1からも明らかな
ようにプロセス優先度を160種類のレベルに分け、最
も低いレベルから順に1〜160の符号を付して各レベ
ルを区別している。
The activation delay table 20C is shown in Table 1 below.
As also shown, the permissible delay time from the occurrence of an event that should activate the real-time process to the activation of the corresponding real-time process is determined for each process priority and each CPU. In addition, in this embodiment, as is clear from Table 1, the process priority is divided into 160 types of levels, and the levels 1 to 160 are assigned in order from the lowest level to distinguish each level.

【0041】[0041]

【表1】 [Table 1]

【0042】また実行中プロセステーブル20Dは、次
の表2にも示すように、各CPUで現在実行中のプロセ
スの情報を登録するためのテーブルであり、各CPUで
新たなプロセスを起動する毎に「クラス」「優先度」等
の情報が書替えられる。また起動するプロセスが時分割
プロセスの場合は、「タイムスライス時間」「繰越し境
界時間」等の情報も設定される。また「CPU使用時
間」は実行中のプロセスによるCPU使用時間を表して
おり、後述するCPU消費時間計測/保持部32により
時間の経過に伴って徐々に値が増加するように更新され
ると共に、各CPUで新たなプロセスが起動される毎に
値がリセットされる。
Further, as shown in Table 2 below, the running process table 20D is a table for registering the information of the process currently being executed by each CPU, and each time a new process is started by each CPU. The information such as "class" and "priority" is rewritten in. If the process to be activated is a time-division process, information such as "time slice time" and "carry-on boundary time" is also set. The “CPU usage time” represents the CPU usage time of the process being executed, and is updated by the CPU consumption time measurement / holding unit 32 described later so that the value gradually increases with the passage of time. The value is reset each time a new process is started in each CPU.

【0043】[0043]

【表2】 [Table 2]

【0044】図2には、各CPUが備えている各種機能
のうち、各CPUでプロセスディスパッチ制御プログラ
ム18が実行されることにより実現される、プロセスの
ディスパッチに関連する機能がブロックに分けて示され
ている。
In FIG. 2, among various functions of each CPU, the functions related to the process dispatch realized by executing the process dispatch control program 18 in each CPU are shown in blocks. Has been done.

【0045】タイマ26は現在の時刻を保持しており、
CPU消費時間検出部28はタイマ26に保持されてい
る時刻の変化を監視し、一定時間が経過する毎にプロセ
スディスパッチ制御部30にタイマ割込み信号を出力す
る。プロセスディスパッチ制御部30のCPU消費時間
計測/保持部32では、タイマ割込み信号が入力される
と前述のように実行中プロセステーブル20DのCPU
使用時間を更新し、CPUで新たなプロセスが起動され
る毎に値をリセットする(0に戻す)。
The timer 26 holds the current time,
The CPU consumption time detection unit 28 monitors a change in the time held in the timer 26, and outputs a timer interrupt signal to the process dispatch control unit 30 each time a fixed time has elapsed. In the CPU consumption time measurement / holding unit 32 of the process dispatch control unit 30, when the timer interrupt signal is input, the CPU of the running process table 20D is processed as described above.
The usage time is updated, and the value is reset (returned to 0) each time a new process is started by the CPU.

【0046】また外部イベント検出部34は、データの
入力、データの出力完了、資源の解放等の外部イべント
の発生に伴って入力される割込み信号を検出し、プロセ
スディスパッチ制御部30のプロセス選択制御部36に
外部イベントの発生を通知する。プロセス選択制御部3
6では、外部イベントの発生に伴って実行すべきプロセ
スをどのCPUで実行するかを選択する。
The external event detection unit 34 detects an interrupt signal input in response to the occurrence of an external event such as data input, data output completion, resource release, etc., and the process of the process dispatch control unit 30 is detected. The selection control unit 36 is notified of the occurrence of the external event. Process selection control unit 3
In 6, the CPU that selects the process to be executed in response to the occurrence of the external event is selected.

【0047】選択されたCPUでは、実行すべきプロセ
スが実時間プロセスであれば、実時間プロセスディスパ
ッチ制御部38により前記実行すべき実時間プロセスの
ディスパッチが行われ、実行すべきプロセスが時分割プ
ロセスの場合には、時分割プロセスディスパッチ制御部
40により前記実行すべき時分割プロセスのディスパッ
チが行われる。また何らイベントが発生していない状況
では、時分割プロセスディスパッチ制御部40により時
分割プロセスのディスパッチが行われる。
In the selected CPU, if the process to be executed is a real-time process, the real-time process dispatch control unit 38 dispatches the real-time process to be executed, and the process to be executed is the time-division process. In this case, the time-sharing process dispatch control unit 40 dispatches the time-sharing process to be executed. Further, when no event has occurred, the time-sharing process dispatch control unit 40 dispatches the time-sharing process.

【0048】またタイムスライス値変更部42は、時分
割プロセスの起動時に、起動される時分割プロセスの繰
越し境界時間T2を変更すべきか否かをプロセスの実行
状況に基づいて判断し、変更すべきと判断した場合には
繰越し境界時間T2の変更を行う。優先度変更部44
は、後述する繰越し処理を適用する時分割プロセスに対
し優先度の変更を行う。
Further, the time slice value changing unit 42 judges whether or not the carry-over boundary time T2 of the time-division process to be started should be changed at the time of starting the time-division process, based on the execution status of the process, and should be changed. If it is determined that the carry-over boundary time T2 is changed. Priority changing unit 44
Changes the priority of the time-sharing process to which the carry-forward process described later is applied.

【0049】次に本実施例の作用を説明する。まず図4
のフローチャートを参照し、イベントが発生した場合に
実行されるイベント受付処理について説明する。なお、
イベント受付処理は前述のプロセス選択制御部36及び
実時間プロセスディスパッチ制御部38に対応する処理
である。また、本実施例に係る情報処理装置10は対称
型マルチプロセッサシステムであるので、以下で説明す
るイベント受付処理がCPU1〜CPUnの何れで行わ
れるかは不定であり、イベント受付処理を実行するCP
Uはオペレーティングシステム(OS)によって決定さ
れる。
Next, the operation of this embodiment will be described. First, FIG.
The event reception process executed when an event occurs will be described with reference to the flowchart of FIG. In addition,
The event reception process is a process corresponding to the process selection control unit 36 and the real-time process dispatch control unit 38 described above. Further, since the information processing apparatus 10 according to the present embodiment is a symmetric multiprocessor system, it is uncertain which of the CPU1 to CPUn will perform the event reception processing described below, and a CP that executes the event reception processing.
U is determined by the operating system (OS).

【0050】ステップ100では、発生したイベントが
実時間プロセスを起動すべきイベントか否か判定する。
時分割プロセスであっても所定のイベントの発生を待っ
ている状態に移行することはあり、発生したイベントが
時分割プロセスを起動すべきイベントであった場合には
前記判定が否定され、ステップ102で発生したイベン
トに対応する時分割プロセスを起動する時分割クラスイ
ベント処理を行った後に処理を終了する。また、判定が
肯定された場合にはステップ104へ移行し、CPU1
〜CPUnで実行中のプロセスのうち、実行を開始して
から繰越し境界時間T2以上経過している(すなわちC
PU使用時間≧繰越し境界時間T2)時分割プロセスが
有るか否か判定する。
In step 100, it is determined whether the generated event is an event for activating a real-time process.
Even in the time-sharing process, the process may shift to a state of waiting for the occurrence of a predetermined event. If the occurring event is an event that should activate the time-sharing process, the above determination is denied, and step 102 After performing the time-sharing class event process that starts the time-sharing process corresponding to the event that occurred in step 1, the process ends. If the determination is affirmative, the process proceeds to step 104, and the CPU 1
~ Among the processes being executed by CPUn, the carry-over boundary time T2 or more has passed since the start of execution (that is, C
PU usage time ≧ carrying boundary time T2) It is determined whether or not there is a time division process.

【0051】判定が肯定された場合にはステップ106
へ移行し、前記時分割プロセスを実行しているCPUに
おいて実時間プロセスへの切替え処理を起動させ、処理
を終了する。この切替え処理の詳細については後述する
が、実行中の時分割プロセスの処理が中断され前記発生
したイベントに対応する実時間プロセスが起動されると
共に、(CPU使用時間≧繰越し境界時間T2)の条件
を満足しているので、実行が中断された時分割プロセス
に対し繰越し処理が適用されることになる。
If the determination is positive, step 106
Then, the CPU executing the time division process starts the switching process to the real-time process and ends the process. The details of this switching processing will be described later, but the processing of the time-divisional process being executed is interrupted, the real-time process corresponding to the event that has occurred is started, and the condition (CPU usage time ≧ carrying boundary time T2) is satisfied. Therefore, the carry forward process is applied to the time division process whose execution is interrupted.

【0052】一方、ステップ104の判定が否定された
場合にはステップ108へ移行し、CPU1〜CPUn
で実行中のプロセスのうち、許容遅延時間内にタイムス
ライス時間T1満了(すなわちCPU使用時間=タイム
スライス時間T1)となる時分割プロセスが有るか否か
判定する。この判定は、より詳しくは起動すべき実時間
プロセスの優先度をキーとして起動遅延テーブル20C
を参照し、各CPUにおける許容遅延時間を取込むと共
に、時分割プロセスを実行中のCPUの各々に対し、実
行中プロセステーブル20Dに設定されているタイムス
ライス時間T1からCPU使用時間を減じた値(タイム
スライス満了迄の時間)を演算し、演算した値と前記取
り込んだ許容遅延時間を各々比較することにより行われ
る。
On the other hand, when the determination at step 104 is negative, the routine proceeds to step 108, where CPU1 to CPUn
Of the processes being executed, it is determined whether or not there is a time division process in which the time slice time T1 expires (that is, CPU usage time = time slice time T1) within the allowable delay time. More specifically, this determination uses the priority of the real-time process to be activated as a key and the activation delay table 20C.
Value obtained by subtracting the CPU usage time from the time slice time T1 set in the executing process table 20D for each of the CPUs executing the time-divisional process, while taking in the allowable delay time in each CPU. (Time until expiration of time slice) is calculated, and the calculated value is compared with the accepted allowable delay time.

【0053】上記判定が肯定された場合には、タイムス
ライス時間が満了し時分割プロセスの処理が停止された
後に、この時分割プロセスを実行していたCPUで実時
間プロセスを実行させるために、ステップ112でイベ
ントが発生したことを情報として記憶し、処理を終了す
る。また、上記判定が否定された場合にも、許容遅延時
間内に実行中のプロセスが自発的に待ち状態に移行する
か、又は実行中の時分割プロセスによるCPU使用時間
が繰越し境界時間T2以上となる可能性があるため、ス
テップ110で所定の許容遅延時間が経過するとタイム
アウトするプロセス切替えタイマをスタートさせ、ステ
ップ112でイベントが発生したことを情報として記憶
して処理を終了する。
If the above determination is affirmative, after the time slice time has expired and the processing of the time-sharing process is stopped, the CPU that was executing this time-sharing process executes the real-time process. In step 112, the occurrence of the event is stored as information, and the process ends. Even if the above determination is denied, the process being executed spontaneously shifts to the waiting state within the allowable delay time, or the CPU use time by the time-sharing process being executed is carried forward to the boundary time T2 or more. Therefore, in step 110, a process switching timer that times out when a predetermined allowable delay time elapses is started, and in step 112, the occurrence of an event is stored as information and the processing ends.

【0054】上記ステップ110でスタートさせたプロ
セス切替えタイマは、実行中のプロセスが自発的に待ち
状態に移行する等により前記発生したイベントに対応す
る実時間プロセスが許容遅延時間内に起動されたときに
は停止されるが、それ以外の場合にはタイムアウトし、
このタイムアウトに伴ってプロセス切替え要求タイマタ
イムアウト受付処理(図5参照)が実行される。以下、
図5を参照してプロセス切替え要求タイマタイムアウト
受付処理について説明する。なお、この処理も前述のプ
ロセス選択制御部36及び実時間プロセスディスパッチ
制御部38に対応する処理である。また、この処理につ
いてもCPU1〜CPUnの何れで行われるか不定であ
り、この処理を行うCPUはオペレーティングシステム
(OS)によって決定される。
The process switching timer started in step 110 is used when the real-time process corresponding to the generated event is activated within the allowable delay time due to the process being executed voluntarily shifting to the waiting state. Will be stopped, but otherwise timed out,
Along with this timeout, the process switching request timer timeout acceptance process (see FIG. 5) is executed. Less than,
The process switch request timer timeout acceptance process will be described with reference to FIG. Note that this processing is also processing corresponding to the process selection control unit 36 and the real-time process dispatch control unit 38 described above. Further, it is uncertain which of the CPU1 to CPUn will perform this processing, and the CPU that performs this processing is determined by the operating system (OS).

【0055】ステップ120では実行中プロセステーブ
ル20Dを読込み、ステップ122ではCPU1〜CP
Unで実行中のプロセスのうち、実行を開始してから繰
越し境界時間T2以上経過している時分割プロセスが有
るか否かを前記読込んだ情報に基づいて判定する。判定
が肯定された場合にはステップ128へ移行し、前記と
同様に、前記時分割プロセスを実行しているCPUにお
いて実時間プロセスへの切替え処理を起動させる。この
場合、実時間プロセスの起動に伴って処理が中断される
時分割プロセスは(CPU使用時間≧繰越し境界時間T
2)の条件を満足しているので、該時分割プロセスに対
し繰越し処理が適用される。そして次のステップ130
では、先のイベント受付処理で記憶した、イベントが発
生したことを表す情報を消去し、処理を終了する。
At step 120, the executing process table 20D is read, and at step 122, CPUs 1 to CP are read.
It is determined based on the read information whether or not there is a time-divisional process of which the carry-over boundary time T2 or more has passed from the start of execution among the processes being executed by Un. When the determination is affirmative, the process proceeds to step 128, and similarly to the above, the CPU executing the time division process activates the switching process to the real time process. In this case, the time division process whose processing is interrupted due to the activation of the real-time process is (CPU usage time ≧ carrying boundary time T
Since the condition of 2) is satisfied, the carry-forward process is applied to the time division process. And the next step 130
Then, the information indicating that an event has occurred, which is stored in the previous event reception process, is erased, and the process ends.

【0056】またステップ122の判定が否定された場
合には、ステップ124で実行中プロセステーブル20
Dから読込んだ情報に基づいて、CPU1〜CPUnの
少なくとも何れかで時分割プロセスが実行されているか
否か判定する。判定が肯定された場合には、前記と同様
にステップ128、130の処理が行われる。この場合
に実時間プロセスへの切替え処理による実時間プロセス
の起動に伴って処理が中断される時分割プロセスは、
(CPU使用時間≧繰越し境界時間T2)の条件を満足
していないので、該時分割プロセスに対しては繰越し処
理は適用されない。なお、複数のCPUで時分割プロセ
スが実行されている場合、ステップ128では最も優先
度の低い時分割プロセスを実行しているCPUにおい
て、実時間プロセスへの切替え処理を起動させる。
If the determination in step 122 is negative, the running process table 20 in step 124.
Based on the information read from D, it is determined whether the time division process is being executed by at least one of the CPU1 to CPUn. If the determination is affirmative, the processes of steps 128 and 130 are performed as described above. In this case, the time-sharing process whose processing is interrupted when the real-time process is started by switching to the real-time process is
Since the condition of (CPU use time ≧ carry-over boundary time T2) is not satisfied, the carry-over process is not applied to the time-division process. When a plurality of CPUs are executing the time-sharing process, in step 128, the CPU executing the time-sharing process having the lowest priority starts the switching process to the real-time process.

【0057】またステップ124の判定が否定された場
合は、CPU1〜CPUnで実行されているプロセスは
全て実時間プロセスであるので、ステップ126におい
て、CPU1〜CPUnで実行中の実時間プロセスのう
ち、発生したことが記憶されているイベントに対応する
実時間プロセス(起動すべき実時間プロセス)よりも優
先度の低い実時間プロセスが有るか否か判定する。上記
判定が肯定された場合には、前記と同様にステップ12
8、130の処理が行われ、実行中の実時間プロセスの
うちの何れか(優先度の低い実行中の実時間プロセスが
複数存在している場合には、最も優先度の低い実時間プ
ロセス)の処理が中断され、より優先度の高い実時間プ
ロセスが実行されることになる。
If the determination in step 124 is negative, all the processes executed by the CPUs 1 to CPUn are real-time processes. Therefore, in step 126, among the real-time processes being executed by the CPUs 1 to CPUn, It is determined whether or not there is a real-time process having a lower priority than the real-time process (the real-time process to be started) corresponding to the event in which the occurrence is stored. If the above determination is affirmed, the same as the above step 12
Any of the real-time processes that are being executed after processing 8 and 130 (the real-time process having the lowest priority if there are multiple real-time processes that have a low priority) Will be interrupted, and the real-time process with higher priority will be executed.

【0058】また、CPU1〜CPUnで実行されてい
る実時間プロセスの優先度が何れも高い場合には、ステ
ップ126の判定も否定されてステップ132へ移行
し、プロセス切替えタイマを再スタートさせて処理を終
了する。これは優先度の高い実時間プロセスを起動すべ
きイベントの発生が輻輳した等のように極めて稀なケー
スであるが、実行中の実時間プロセスの何れかが自発的
に待ち状態に移行するか、またはプロセス切替えタイマ
が再びタイムアウトする迄、起動待ち状態となっている
実時間プロセスの起動は保留される。
If the priority of each of the real-time processes executed by the CPU1 to CPUn is high, the determination at step 126 is denied and the process proceeds to step 132, the process switching timer is restarted and processed. To finish. This is an extremely rare case such as the occurrence of an event that should start a high-priority real-time process is congested, but whether any of the running real-time processes voluntarily shifts to the waiting state. , Or the activation of the real-time process in the activation waiting state is suspended until the process switching timer times out again.

【0059】次に、図4のステップ106又は図5のス
テップ128における処理に伴って対応するCPUで実
行される実時間プロセスへの切替え処理について、図6
のフローチャートを参照して説明する。なお、この処理
は実時間プロセスディスパッチ制御部38に対応する処
理である。ステップ140では実行中のプロセスの処理
を停止し、ステップ142では処理を停止したプロセス
の情報(レジスタに設定されている情報等)を対応する
TCBに設定する。次のステップ144ではプロセスの
実行を中断していることを表すプロセス実行中断情報を
TCBに設定し、ステップ146では、実行中プロセス
テーブル20Dから対応する情報(今迄処理を行ってい
たプロセスの情報)を消去する。
Next, the switching processing to the real-time process executed by the corresponding CPU in accordance with the processing in step 106 of FIG. 4 or step 128 of FIG. 5 will be described with reference to FIG.
This will be described with reference to the flowchart in FIG. Note that this processing is processing corresponding to the real-time process dispatch control unit 38. In step 140, the processing of the process being executed is stopped, and in step 142, the information (such as the information set in the register) of the process that has stopped processing is set in the corresponding TCB. In the next step 144, the process execution interruption information indicating that the execution of the process is interrupted is set in the TCB, and in step 146, the corresponding information from the executing process table 20D (information of the process that has been performing the process up to now). ) Is erased.

【0060】次のステップ148では、先のステップ1
40で処理を停止したプロセスが時分割プロセスか否か
判定する。判定が否定された場合にはステップ166へ
移行するが、判定が肯定された場合にはステップ150
で処理を停止した時分割プロセスによるCPU使用時間
tを取込む。ステップ152では取り込んだCPU使用
時間が、前記時分割プロセスのTCBに設定されている
繰越し境界時間T2以上か否か判定する。判定が肯定さ
れた場合にはステップ154へ移行する。
In the next step 148, the previous step 1
At 40, it is determined whether the process that has stopped processing is a time-sharing process. If the determination is negative, the process proceeds to step 166, but if the determination is affirmative, step 150
The CPU usage time t by the time-sharing process whose processing has been stopped at is taken in. In step 152, it is determined whether the fetched CPU usage time is equal to or longer than the carry-over boundary time T2 set in the TCB of the time division process. If the determination is affirmative, the process proceeds to step 154.

【0061】ステップ154では、前記処理を停止した
時分割プロセスに対し繰越し処理を適用するために、次
回に該時分割プロセスが実行される際の繰越し時間T3
(タイムスライス満了迄の時間)を次の(1)式に従っ
て演算する。
In step 154, in order to apply the carry-forward process to the time-division process whose processing has been stopped, the carry-over time T3 when the time-division process is executed next time is executed.
(Time until expiration of time slice) is calculated according to the following equation (1).

【0062】 繰越し時間T3=タイムスライス値T1−CPU使用時間t …(1) ステップ156では処理を停止した時分割プロセスのT
CBに、上記で演算した繰越し時間T3を設定すると共
に、繰越し処理フラグをセットする。そして次のステッ
プ158では上記で情報を設定したTCBを、時分割ク
ラス待ち行列20Aの末尾にリンクし、ステップ166
へ移行する。一方、ステップ152の判定が否定された
場合には、ステップ160でタイムスライス残時間Ts
(タイムスライス満了迄の時間)を次の(2)式に従っ
て演算する。
Carry-over time T3 = time slice value T1-CPU usage time t (1) In step 156, T of the time-division process whose processing has been stopped
The carry-over time T3 calculated above is set in CB, and the carry-over process flag is set. Then, in the next step 158, the TCB set with the above information is linked to the end of the time division class queue 20A, and step 166
Move to. On the other hand, when the determination in step 152 is negative, the time slice remaining time Ts is determined in step 160.
(Time until expiration of time slice) is calculated according to the following equation (2).

【0063】 残時間Ts=タイムスライス値T1−CPU使用時間t …(2) ステップ162では、処理を停止した時分割プロセスの
TCBに上記で演算した残時間Tsを設定し、次のステ
ップ164では残時間Tsを設定したTCBを時分割ク
ラス待ち行列20Aの先頭にリンクし、ステップ166
へ移行する。
Remaining time Ts = time slice value T1-CPU usage time t (2) In step 162, the remaining time Ts calculated above is set in the TCB of the time-division process whose processing has stopped, and in the next step 164 The TCB in which the remaining time Ts is set is linked to the head of the time division class queue 20A, and step 166 is performed.
Move to.

【0064】ステップ166では、起動する実時間プロ
セスに関する情報を対応するTCBから取込み、次のス
テップ168ではこれから起動する実時間プロセスにつ
いての必要情報を実行中プロセステーブルに登録する。
そしてステップ170で実時間プロセスの処理を開始す
ることにより、実時間プロセスへの切替え処理を終了す
る。
At step 166, the information about the real-time process to be started is fetched from the corresponding TCB, and at the next step 168, the necessary information about the real-time process to be started is registered in the running process table.
Then, by starting the processing of the real-time process in step 170, the switching processing to the real-time process is completed.

【0065】次に実行していた実時間プロセスが自発的
に待ち状態に移行することにより、該実時間プロセスを
実行していたCPUで実行される実時間プロセス終了処
理について、図7のフローチャートを参照して説明す
る。なお、この処理はプロセス実行CPU選択制御部3
6、実時間プロセスディスパッチ制御部38及び時分割
プロセスディスパッチ制御部40に対応する処理であ
る。ステップ180では前記待ち状態に移行することに
より処理を終了した実時間プロセスの情報を対応するT
CBに設定し、ステップ182では実行中プロセステー
ブル20Dから対応する情報(今迄処理を行っていた実
時間プロセスの情報)を消去する。
Next, the real-time process ending process executed by the CPU that was executing the real-time process when the real-time process that was executing next voluntarily shifts to the waiting state is shown in the flowchart of FIG. It will be described with reference to FIG. Note that this process is performed by the process execution CPU selection control unit 3
6. This is processing corresponding to the real-time process dispatch control unit 38 and the time-sharing process dispatch control unit 40. In step 180, the information of the real-time process whose processing is completed by shifting to the waiting state is set to the corresponding T
CB is set, and in step 182, the corresponding information (information on the real-time process which has been processed up to now) is deleted from the executing process table 20D.

【0066】ステップ184では他の実時間プロセスに
割り込まれて実行中断中の実時間プロセスが存在してい
るか否か判定する。この判定は、実時間クラス待ち行列
に20Bにリンクされている複数のTCBの中に、プロ
セス実行中断情報が設定されているTCBが有るか否か
を判断することにより行われる。
At step 184, it is determined whether or not there is a real-time process which is interrupted by another real-time process and whose execution is suspended. This determination is made by determining whether or not there is a TCB for which process execution interruption information is set among the plurality of TCBs linked to 20B in the real-time class queue.

【0067】判定が肯定された場合には、ステップ18
6でイベントが発生したことを表す情報が記憶されてい
るか否か判定する。判定が否定された場合にはステップ
190へ移行するが、判定が肯定された場合にはステッ
プ188において、先のステップ184で発見された実
行中断中の実時間プロセスより、発生したことが記憶さ
れているイベントに対応する実時間プロセスの方が優先
度が高いか否か判定する。
If the determination is positive, step 18
At 6, it is determined whether or not information indicating that an event has occurred is stored. If the determination is negative, the process proceeds to step 190. However, if the determination is affirmative, in step 188, it is stored that the execution-time suspended real-time process found in the previous step 184 has occurred. It is determined whether the real-time process corresponding to the current event has a higher priority.

【0068】判定が肯定された場合には前記イベントに
対応する実時間プロセスを起動すべきであると判断して
ステップ198へ移行するが、前記判定が否定された場
合には実行中断中の実時間プロセスを起動すべきである
と判断し、ステップ190へ移行する。ステップ190
では実行中断中の実時間プロセスに関する情報を対応す
るTCBから取込み、次のステップ192では、これか
ら起動する実時間プロセスについての必要情報を実行中
プロセステーブルに登録する。そしてステップ194で
実時間プロセスの処理を開始することにより、実時間プ
ロセス終了処理を終了する。
If the determination is affirmative, it is determined that the real-time process corresponding to the event should be started, and the process proceeds to step 198. However, if the determination is negative, the execution is suspended. It is determined that the time process should be started, and the process proceeds to step 190. Step 190
Then, the information about the real-time process whose execution is suspended is fetched from the corresponding TCB, and in the next step 192, the necessary information about the real-time process to be activated is registered in the running process table. Then, in step 194, the processing of the real-time process is started to end the real-time process end processing.

【0069】一方、実行中断中の実時間プロセスが無か
った場合にはステップ184の判定が否定され、ステッ
プ196でイベントが発生したことが記憶されているか
否か判定する。判定が肯定された場合はイベントは発生
したものの対応する実時間プロセスは未だ起動されてい
ない場合であり、ステップ198以降では記憶されてい
るイベントに対応する実時間プロセスの起動を行うが、
複数種類のイベントの発生が記憶されている場合には、
各イベントに対応する実時間プロセスのうち最も優先度
の高い実時間プロセス、或いは最も速く発生したイベン
トに対応する実時間プロセスを対象として、以下の処理
が行われる。
On the other hand, if there is no real-time process whose execution is suspended, the determination in step 184 is denied, and it is determined in step 196 whether the occurrence of the event is stored. If the determination is affirmative, it means that the event has occurred but the corresponding real-time process has not been started yet. In step 198 and thereafter, the real-time process corresponding to the stored event is started.
If multiple types of event occurrences are stored,
The following processing is performed for the real-time process having the highest priority among the real-time processes corresponding to each event, or the real-time process corresponding to the event that occurs fastest.

【0070】ステップ198では起動する実時間プロセ
スに対応するプロセス切替え要求タイマが作動していれ
ば、このタイマの作動を停止させる。このプロセス切替
え要求タイマは、前記実時間プロセスに対応するイベン
トが発生した際に行われたイベント受付処理においてス
テップ108(図4参照)の判定が否定されていた場合
に作動されている。次のステップ200では、これから
起動する実時間プロセスに関する情報を対応するTCB
から取込み、ステップ202では、これから起動する実
時間プロセスについての必要情報を実行中プロセステー
ブルに登録する。次のステップ204ではこれから起動
する実時間プロセスに対応するイベントが発生したこと
を表す情報を消去し、ステップ206で実時間プロセス
の処理を開始することにより、実時間プロセス終了処理
を終了する。
In step 198, if the process switching request timer corresponding to the real-time process to be started is operating, this timer is stopped. The process switch request timer is operated when the determination in step 108 (see FIG. 4) is denied in the event reception process performed when the event corresponding to the real-time process occurs. In the next step 200, information about the real-time process that is about to start is provided in the corresponding TCB.
In step 202, necessary information about a real-time process to be activated is registered in the executing process table. In the next step 204, the information indicating that the event corresponding to the real-time process to be activated has occurred is erased, and the process of the real-time process is started in step 206, thereby ending the real-time process end process.

【0071】また、実行中断中の実時間プロセスが無
く、イベントの発生も記憶されていなかった場合には、
ステップ196の判定が否定されてステップ208へ移
行し、時分割プロセス起動処理を行った後に、実時間プ
ロセス終了処理を終了する。なお、前記時分割プロセス
起動処理については後述する。
If there is no real-time process whose execution is suspended and the occurrence of an event is not stored,
When the determination in step 196 is negative, the process proceeds to step 208, and after the time-sharing process starting process is performed, the real-time process ending process is ended. The time division process start processing will be described later.

【0072】次に、実行していた時分割プロセスのタイ
ムスライス時間T1が満了するか、又は時分割プロセス
が自発的に待ち状態に移行することにより、該時分割プ
ロセスを実行していたCPUで実行される時分割プロセ
ス終了処理について、図8のフローチャートを参照して
説明する。なお、この処理もプロセス実行CPU選択制
御部36、実時間プロセスディスパッチ制御部38及び
時分割プロセスディスパッチ制御部40に対応する処理
である。ステップ220では処理を終了した時分割プロ
セスの情報を対応するTCBに設定し、ステップ222
では前記情報を設定したTCBを時分割クラス待ち行列
20Aの末尾にリンクする。ステップ224では実行中
プロセステーブル20Dから対応する情報(今迄処理を
行っていた時分割プロセスの情報)を消去する。
Next, when the time slice time T1 of the time-division process being executed expires or the time-division process voluntarily shifts to the waiting state, the CPU executing the time-division process The time division process end processing executed will be described with reference to the flowchart in FIG. This process is also a process corresponding to the process execution CPU selection control unit 36, the real-time process dispatch control unit 38, and the time-division process dispatch control unit 40. In step 220, the information of the time-division process that has completed processing is set in the corresponding TCB, and step 222
Then, the TCB in which the above information is set is linked to the end of the time division class queue 20A. In step 224, the corresponding information (information on the time-division process which has been processed up to now) is deleted from the process table 20D being executed.

【0073】次のステップ226以降の処理は、先に説
明した実時間プロセス終了処理のステップ184〜20
8(図7参照)と同じである。すなわち、ステップ22
6では他の実時間プロセスに割り込まれて実行を中断中
の実時間プロセスが存在しているか否か判定し、判定が
肯定された場合には、ステップ228でイベントが発生
したことを表す情報が記憶されているか否か判定する。
判定が否定された場合にはステップ232へ移行する
が、判定が肯定された場合にはステップ230で、発見
された実行中断中の実時間プロセスより、発生したこと
が記憶されているイベントに対応する実時間プロセスの
方が優先度が高いか否か判定する。
The processing from the next step 226 is executed in steps 184 to 20 of the real-time process end processing described above.
8 (see FIG. 7). That is, step 22
At 6, it is determined whether or not there is a real-time process that is interrupted by another real-time process and whose execution is suspended. If the determination is affirmative, information indicating that an event has occurred at step 228 is displayed. It is determined whether or not it is stored.
If the determination is negative, the process proceeds to step 232, but if the determination is affirmative, in step 230, the detected real-time process in which the execution is suspended corresponds to the event stored as occurring. It is determined whether the real-time process to be executed has a higher priority.

【0074】判定が否定された場合にはステップ232
へ移行し、実行中断中の実時間プロセスに関する情報を
対応するTCBから取込み、ステップ234ではこれか
ら起動する実時間プロセスについての必要情報を実行中
プロセステーブルに登録した後に、ステップ234で実
時間プロセスを再起動し、時分割プロセス終了処理を終
了する。
If the determination is negative, step 232
In step 234, the information about the real-time process whose execution is suspended is fetched from the corresponding TCB, and in step 234, the necessary information about the real-time process to be activated is registered in the running process table. Restart and end the time-sharing process termination processing.

【0075】一方、ステップ226の判定が否定された
場合には、ステップ238でイベントが発生したことが
記憶されているか否か判定する。判定が肯定された場合
はステップ240へ移行し、これから起動する実時間プ
ロセスに対応するプロセス切替え要求タイマが作動して
いれば、このタイマの作動を停止させる。次のステップ
242では、これから起動する実時間プロセスに関する
情報を対応するTCBから取込み、ステップ244で
は、これから起動する実時間プロセスについての必要情
報を実行中プロセステーブルに登録する。次のステップ
246ではこれから起動する実時間プロセスに対応する
イベントが発生したことを表す情報を消去し、ステップ
206で実時間プロセスの処理を開始することにより、
時分割プロセス終了処理を終了する。また、ステップ2
38の判定が否定された場合には、ステップ250で時
分割プロセス起動処理を行った後に、時分割プロセス終
了処理を終了する。
On the other hand, when the determination in step 226 is negative, it is determined in step 238 whether the occurrence of the event is stored. If the determination is affirmative, the routine proceeds to step 240, and if the process switching request timer corresponding to the real-time process to be started is running, this timer is stopped. In the next step 242, information about the real-time process to be started up is fetched from the corresponding TCB, and in step 244, necessary information about the real-time process to be started up is registered in the running process table. At the next step 246, the information indicating that the event corresponding to the real-time process to be activated has occurred is deleted, and at step 206, the processing of the real-time process is started.
The time sharing process termination processing is terminated. Also, step 2
If the determination in step 38 is negative, the time-sharing process start processing is performed in step 250, and then the time-sharing process end processing is ended.

【0076】次に図9のフローチャートを参照し、図7
のステップ208又は図8のステップ250で行われる
時分割プロセス起動処理について説明する。なお、この
処理は時分割プロセスディスパッチ制御部40に対応す
る処理である。ステップ260では時分割クラス待ち行
列20Aの先頭にリンクされているTCBを取出し、次
のステップ262では、前記取り出したTCBにプロセ
ス実行中断情報が設定されているか否かに基づいて、取
り出したTCBに対応する時分割プロセス(これから起
動する時分割プロセス)が、前回の実行がタイムスライ
ス時間T1満了前に中断されたか否か判定する。判定が
否定された場合には、ステップ264で今回のタイムス
ライス値(これから起動する時分割プロセスのタイムス
ライス値)Tとして、TCBに設定されているタイムス
ライス時間T1を設定し、ステップ282へ移行する。
Next, referring to the flowchart of FIG.
The time-division process activation processing performed in step 208 of FIG. 8 or step 250 of FIG. 8 will be described. It should be noted that this process is a process corresponding to the time-division process dispatch control unit 40. In step 260, the TCB linked to the head of the time division class queue 20A is taken out, and in the next step 262, the TCB extracted is taken out based on whether or not the process execution interruption information is set in the taken out TCB. The corresponding time-division process (time-division process to be activated) determines whether the previous execution was interrupted before the time slice time T1 expired. If the determination is negative, the time slice time T1 set in the TCB is set as the current time slice value (time slice value of the time division process to be activated) T in step 264, and the process proceeds to step 282. To do.

【0077】また、ステップ262の判定が肯定された
場合にはステップ266へ移行し、前記取り出したTC
Bに繰越し処理フラグがセットされているか否かに基づ
いて、これから起動する時分割プロセスが繰越し処理を
適用する時分割プロセスか否か判定する。判定が肯定さ
れた場合には、ステップ268で今回のタイムスライス
値Tとして、TCBに設定されている残時間Tsを設定
する。ステップ270でTCBからプロセス実行中断情
報を消去し、ステップ272でTCBに設定されている
残時間Tsをリセットした後に、ステップ282へ移行
する。
When the determination in step 262 is affirmative, the process proceeds to step 266, and the TC that has been taken out is taken.
Based on whether or not the carry-forward processing flag is set in B, it is determined whether or not the time-sharing process to be activated from now on is a time-sharing process to which the carry-forward processing is applied. If the determination is affirmative, the remaining time Ts set in the TCB is set as the current time slice value T in step 268. In step 270, the process execution interruption information is erased from the TCB, the remaining time Ts set in the TCB is reset in step 272, and then the process proceeds to step 282.

【0078】また、ステップ266の判定が肯定された
場合にはステップ274へ移行し、今回のタイムスライ
ス値Tとして、TCBに設定されているタイムスライス
値T1と繰越し時間T3の和を設定する。次のステップ
276では前記繰越し時間T3が経過するとタイムアウ
トする繰越し時間経過タイマをスタートさせる。ステッ
プ278ではこれから起動する時分割プロセスに対し、
繰越し処理用の優先度(通常時よりも高い優先度)を設
定する。このステップ278は優先度変更部44に対応
しており、請求項5に対応する処理である。
When the determination at step 266 is affirmative, the routine proceeds to step 274, where the sum of the time slice value T1 set in TCB and the carry-over time T3 is set as the current time slice value T. In the next step 276, a carry-over time elapsed timer is started which times out when the carry-over time T3 has elapsed. In step 278, for the time-sharing process to be started,
Set the priority for carry-forward processing (higher priority than normal). This step 278 corresponds to the priority changing unit 44 and is a process corresponding to claim 5.

【0079】これにより、これから起動する時分割プロ
セスを実行している最中に実時間プロセスを起動すべき
イベントが発生したとしても、他のCPUで他の時分割
プロセスを実行していれば、該他の時分割プロセスの実
行が中断される可能性が高くなる。従って、繰越し処理
適用中の時分割プロセスが、イベントの発生により実行
が中断される可能性は低くなる。次のステップ280で
はTCBからプロセス実行中断情報を消去し、TCBに
設定されている繰越し時間T3をリセットした後に、ス
テップ282へ移行する。
As a result, even if an event for activating a real-time process occurs while a time-division process to be activated is being executed, if another CPU is executing another time-division process, The execution of the other time division process is likely to be interrupted. Therefore, it is less likely that the execution of the time-sharing process to which the carry-forward process is applied is interrupted due to the occurrence of the event. In the next step 280, the process execution interruption information is erased from the TCB, the carry-over time T3 set in the TCB is reset, and then the process proceeds to step 282.

【0080】ステップ282ではこれから起動する時分
割プロセスについての必要情報を実行中プロセステーブ
ルに登録し、次のステップ284では実行中プロセステ
ーブルに登録されている情報を読み込む。そして、ステ
ップ286では読み込んだ情報に基づいて、これから起
動する時分割プロセスの繰越し境界時間T2の変更が必
要か否か判定する。
At step 282, necessary information about the time-sharing process to be activated is registered in the executing process table, and at next step 284, the information registered in the executing process table is read. Then, in step 286, based on the read information, it is determined whether or not it is necessary to change the carry-over boundary time T2 of the time division process to be started.

【0081】一例として、他のCPUで実行中の全ての
時分割プロセスにおいて、繰越し境界時間T2が経過す
る迄の残時間が比較的長い場合には、現時点から比較的
短い期間内にイベントが発生すると、許容遅延時間経過
後に時分割プロセスの実行を中断して実時間プロセスを
起動したとしても、前記実行を中断した時分割プロセス
に対し繰越し処理が適用されない可能性が高く、繰越し
処理を適用する場合と比較してプロセスディスパッチ回
数の増加によるオーバヘッドの増大を招くことになる。
As an example, in all the time-division processes being executed by other CPUs, if the remaining time until the carry-over boundary time T2 elapses is relatively long, an event occurs within a relatively short period from the present time. Then, even if the execution of the time-sharing process is interrupted after the allowable delay time has elapsed and the real-time process is started, there is a high possibility that the carry-forward process is not applied to the time-sharing process whose execution has been interrupted, and the carry-forward process is applied. Compared with the case, the overhead is increased due to the increase in the number of process dispatches.

【0082】実行中の他の時分割プロセスの優先度にも
よるが、上記のような場合にはステップ286の判定が
肯定され、ステップ288でこれから起動する時分割プ
ロセスの繰越し境界時間T2が小さな値となるように繰
越し境界時間T2を変更設定した後にステップ290へ
移行する。これにより、イベントが発生し実時間プロセ
スを起動するために実行が中断された時分割プロセスに
対し繰越し処理が適用される可能性が高くなるので、プ
ロセスディスパッチ回数の増加によるオーバヘッドの増
大を回避することができる。
In the above case, the determination at step 286 is affirmative, and the carry-over boundary time T2 of the time-sharing process to be activated at step 288 is small, although it depends on the priority of the other time-sharing process being executed. After the carry-over boundary time T2 is changed and set to be a value, the process proceeds to step 290. This increases the possibility that the carry-forward process will be applied to the time-sharing process whose execution has been interrupted to start the real-time process, thus avoiding the increase in overhead due to the increase in the number of process dispatches. be able to.

【0083】なお、ステップ228で繰越し境界時間T
2を変更設定する対象としての時分割プロセスは、これ
から実行を開始する時分割プロセスのみに限定されるも
のではなく、実行中の他の時分割プロセスの繰越し境界
時間T2を変更設定するようにしてもよい。例えば、こ
れから実行を開始する時分割プロセスよりも優先度の低
い時分割プロセスが実行中であった場合には、該優先度
の低い時分割プロセスの繰越し境界時間T2を変更設定
するようにしてもよい。上記ステップ286、288は
タイムスライス値変更部42に対応しており、請求項6
に対応する処理である。
In step 228, the carry-over boundary time T
The time-sharing process as a target for changing and setting 2 is not limited to the time-sharing process to be executed from now on, and the carry-over boundary time T2 of another time-sharing process being executed is changed and set. Good. For example, when a time-sharing process having a lower priority than the time-sharing process to be started from now on is being executed, the carry-over boundary time T2 of the time-sharing process having a lower priority may be changed and set. Good. The steps 286 and 288 correspond to the time slice value changing unit 42, and
Is a process corresponding to.

【0084】またステップ286の判定が否定された場
合にはステップ290へ移行する。ステップ290では
時分割プロセスの処理を開始し、時分割プロセス起動処
理を終了する。
When the determination in step 286 is negative, the process proceeds to step 290. In step 290, the processing of the time division process is started, and the time division process activation processing is ended.

【0085】また、繰越し時間経過タイマがタイムアウ
トすると、図10に示す繰越し時間経過タイマタイムア
ウト受付処理が実行される。すなわち、ステップ300
ではタイムアウトした繰越し時間経過タイマに対応する
時分割プロセスの実行が継続されているか否か判定す
る。判定が否定された場合は、繰越し処理を適用して起
動した時分割プロセスが、イベントの発生に伴う実時間
プロセスの起動により、繰越し時間T3が経過する前に
中断された場合であるので、何ら処理を行うことなく終
了する。
When the carry-over time elapse timer times out, the carry-over time elapse timer timeout acceptance processing shown in FIG. 10 is executed. That is, step 300
Then, it is determined whether or not the execution of the time division process corresponding to the time-out carry-over time elapsed timer is continued. If the determination is negative, it means that the time-sharing process started by applying the carry-over process is interrupted before the carry-over time T3 elapses due to the start of the real-time process accompanying the occurrence of the event. The process ends without performing any processing.

【0086】一方、ステップ300の判定が肯定された
場合には、繰越し処理を適用して起動した時分割プロセ
スが繰越し時間T3以上実行されているので、ステップ
302で該時分割プロセスの優先度として元の値(TC
Bに設定されている値)を設定する。なお、このステッ
プ302は優先度変更部44に対応している。次のステ
ップ304ではTCBの繰越し処理フラグをリセット
し、処理を終了する。
On the other hand, if the determination in step 300 is affirmative, the time-sharing process started by applying the carry-over process has been executed for the carry-over time T3 or longer, so that the priority of the time-sharing process is set in step 302. Original value (TC
The value set in B) is set. The step 302 corresponds to the priority changing unit 44. At the next step 304, the carry-over process flag of the TCB is reset and the process ends.

【0087】次に図11を参照し、上記で説明したディ
スパッチ制御処理によるディスパッチ動作の一例を、従
来方式によるディスパッチ動作と対比して説明する。な
お図11では説明を簡単にするため、CPUを2個(C
PU1とCPU2)とし、時分割プロセスとして、プロ
セスA〜プロセスDの合計4個の時分割プロセスが設定
されている場合を例として示しており、各プロセスのタ
イムスライス時間T1は、一例としてプロセスAが30m
s、プロセスBが20ms、プロセスCが10ms、プロセスD
が 5msとされており、プロセスBの繰越し境界時間T2
は10msとされている。また図11において括弧内の数値
は各プロセスの実行時間を表している。
Next, with reference to FIG. 11, an example of the dispatch operation by the dispatch control processing described above will be described in comparison with the dispatch operation by the conventional method. Note that in FIG. 11, two CPUs (C
PU1 and CPU2), and a case where a total of four time-sharing processes of process A to process D are set as the time-sharing process is shown as an example, and the time slice time T1 of each process is the process A as an example. Is 30m
s, Process B is 20 ms, Process C is 10 ms, Process D
Is set to 5 ms, and the carry-over boundary time T2 of process B is
Is set to 10ms. Further, in FIG. 11, the numerical value in parentheses represents the execution time of each process.

【0088】図11(A)に示すようにイベントの発生
が無い場合には、各プロセスはタイムスライス時間T1
が満了する迄CPU1又はCPU2で実行され、タイム
スライス時間が満了すると時分割クラス待ち行列20A
の先頭にリンクされているTCBに対応する他の時分割
プロセスがディスパッチされる。図11(A)におい
て、プロセスA〜プロセスDを各々2回実行する間の
(すなわち2サイクル当りの)プロセスのディスパッチ
回数は8回である。
When no event occurs as shown in FIG. 11A, each process has time slice time T1.
Is executed by CPU1 or CPU2 until the time expires, and when the time slice time expires, the time division class queue 20A
Another time-sharing process corresponding to the TCB linked to the head of the is dispatched. In FIG. 11 (A), the number of times the process is dispatched is eight while each of the processes A to D is executed twice (that is, per two cycles).

【0089】また実時間プロセスを起動すべきイベント
が発生した場合には、従来のディスパッチ方式では、図
11(B)に示すように所定の時分割プロセスの実行を
中断し(図11ではプロセスB)実時間プロセスを起動
した後に、実時間プロセスが自発的に待ち状態に移行す
ると、前記実行を中断した時分割プロセスの実行を再開
する。この場合、プロセスのディスパッチ回数は2サイ
クル当り10回と増加することになる。
When an event for activating a real-time process occurs, execution of a predetermined time-division process is interrupted as shown in FIG. 11B (process B in FIG. 11) in the conventional dispatch method. ) When the real-time process voluntarily shifts to the waiting state after the real-time process is started, the execution of the time-division process that has suspended the execution is restarted. In this case, the number of process dispatches increases to 10 every two cycles.

【0090】これに対し本実施例では、図11(C)に
も示すように、イベントが発生した時点でのプロセスB
の実行時間がプロセスBの繰越し境界時間T2以上であ
れば、イベント受付処理(図4)のステップ104の判
定が肯定され、プロセスBを実行していたCPU2にお
いて実時間プロセスへの切替え処理(図6)が起動され
る。実時間プロセスへの切替え処理ではステップ152
の判定が肯定され、繰越し時間T3の演算、演算した繰
越し時間T3のTCBへの設定、繰越し処理実行フラグ
のセットが行われた後に、該TCBが時分割クラス待ち
行列20Aの末尾にリンクされる。
On the other hand, in this embodiment, as shown in FIG. 11C, the process B at the time when the event occurs.
If the execution time of is greater than or equal to the carry-over boundary time T2 of the process B, the determination in step 104 of the event reception process (FIG. 4) is affirmed, and the CPU 2 that was executing the process B switches to the real-time process (FIG. 6) is activated. In the switching process to the real-time process, step 152
Is affirmed, the carry-over time T3 is calculated, the calculated carry-over time T3 is set in the TCB, and the carry-over process execution flag is set, and then the TCB is linked to the end of the time division class queue 20A. .

【0091】これにより、実時間プロセスが自発的に待
ち状態に移行した後には、次のプロセスCが実行され
る。また、CPU1におけるプロセスDのタイムスライ
ス時間の満了(図11(C)の)に伴いCPU1で実
行される時分割プロセス起動処理(図9)では、時分割
クラス待ち行列20Aの先頭迄移動したプロセスBのT
CBが取り出され、このTCBにプロセス実行中断情報
及び繰越し処理フラグが設定されていることからステッ
プ262、266の判定が肯定される。従って、プロセ
スBに対し繰越し処理が適用され、タイムスライス時間
T1と繰越し時間T3の和に相当する時間(図11
(C)では「20+X」として示す)だけプロセスBが
実行されることになる。この場合のプロセスのディスパ
ッチ回数は2サイクル当り9回であり、従来方式と比較
してイベントの発生に伴うオーバヘッドの増大が抑制さ
れることが理解できる。
As a result, the next process C is executed after the real-time process voluntarily shifts to the waiting state. Further, in the time-division process activation processing (FIG. 9) executed by the CPU 1 when the time slice time of the process D in the CPU 1 expires (in FIG. 11C), the process moved to the head of the time-division class queue 20A. B's T
The CB is taken out, and since the process execution interruption information and the carry-over processing flag are set in this TCB, the determinations at steps 262 and 266 are affirmative. Therefore, the carry-forward process is applied to the process B, and the time corresponding to the sum of the time slice time T1 and the carry-over time T3 (see FIG. 11).
In (C), the process B is executed only for "20 + X". In this case, the number of times the process is dispatched is 9 per 2 cycles, and it can be understood that the increase in the overhead due to the occurrence of an event is suppressed as compared with the conventional method.

【0092】次に図12を参照し、前述のディスパッチ
制御処理によるディスパッチ動作の一例を、従来方式に
よるディスパッチ動作と対比して更に説明する。従来方
式では、イベントが発生すると直ちに対応する実時間プ
ロセスを起動する。このため一例として図12(A)に
も示すように、実行中のプロセスの処理がごく短い時間
経過後に終了する(図12(A)では時分割プロセスB
のタイムスライス満了)としても該プロセスの実行が中
断され、実時間プロセスの処理が終了した後に、ごく短
いタイムスライス残時間分実行するために前記中断され
た時分割プロセスが再起動されるので、効率が悪くディ
スパッチの回数も多い。
Next, with reference to FIG. 12, an example of the dispatch operation by the aforementioned dispatch control processing will be further described in comparison with the dispatch operation by the conventional method. In the conventional method, as soon as an event occurs, the corresponding real-time process is started. Therefore, as an example, as shown in FIG. 12A, the processing of the process being executed is terminated after a very short time has elapsed (in FIG.
The execution of the process is interrupted even when the time slice expires), and after the processing of the real-time process is completed, the interrupted time division process is restarted to execute for a very short time slice remaining time. Inefficiency is high and dispatches are frequent.

【0093】これに対し本実施例では、図12(B)に
も示すように、イベントの発生から許容遅延時間が経過
するまでの期間内に実行中の時分割プロセスBがタイム
スライス満了となる場合には、イベント受付処理(図
4)のステップ108の判定が肯定され、発生したイベ
ントに対応する実時間プロセスCの起動が保留される。
そして、時分割プロセスBのタイムスライス満了に伴
い、時分割プロセスBを実行していたCPUで時分割プ
ロセス終了処理(図8)が起動されると、実行中断中の
実時間プロセスが無ければステップ238の判定が肯定
され、起動を保留していた実時間プロセスCが起動され
る。これにより、時分割プロセスを短時間実行するため
にディスパッチを行うことが防止されるので、効率が向
上しディスパッチの回数も少なくなる。
On the other hand, in the present embodiment, as shown in FIG. 12B, the time-division process B being executed reaches the end of the time slice within the period from the occurrence of the event to the passage of the allowable delay time. In this case, the determination in step 108 of the event reception process (FIG. 4) is affirmed, and the activation of the real-time process C corresponding to the occurred event is suspended.
Then, when the CPU that was executing the time-division process B starts the time-division process termination processing (FIG. 8) when the time-slice process B has completed the time slice, if there is no real-time process whose execution is suspended, the step If the determination at 238 is affirmative, the real-time process C that has been suspended from being activated is activated. This prevents dispatching to execute the time-division process for a short time, which improves efficiency and reduces the number of dispatches.

【0094】また、本実施例では表1にも示すように、
実時間プロセスの優先度が高くなるに従って許容遅延時
間の値を小さくしているので、優先度の高い実時間プロ
セスについては、イベントが発生するとごく短い時間で
実時間プロセスが起動されることになり、高い応答性が
確保される。
Further, in this embodiment, as shown in Table 1,
Since the allowable delay time value is decreased as the priority of the real-time process increases, the real-time process with a high priority will start the real-time process in a very short time when an event occurs. , High responsiveness is secured.

【0095】また、図13(A)にも示すように、CP
U2でタイムスライス時間の長い時分割プロセスBを既
に実行しており、かつ他のCPUが無い、或いは他のC
PUが実時間プロセスを継続的に実行している状況で、
CPU1においてもタイムスライス時間及び繰越し境界
時間の比較的長い(タイムスライス時間はT1、繰越し
境界時間はT2として示す)時分割プロセスAを起動し
た場合、イベントの発生により実行が中断された時分割
プロセスに対し繰越し処理が適用されない期間(図13
に示す期間L)が長くなる。従って、イベントが発生
し、実時間プロセスの起動を許容遅延時間だけ遅延させ
たとしても、実行が中断された時分割プロセスに対し繰
越し処理が適用されない可能性が高い。
Further, as shown in FIG. 13A, CP
U2 has already executed the time-sharing process B with a long time slice time, and there is no other CPU, or another C
In a situation where the PU is continuously executing a real-time process,
In the CPU 1, when the time slice process and the carry-over boundary time are relatively long (the time slice time is shown as T1 and the carry-over boundary time is shown as T2), when the time-sharing process A is started, the execution is interrupted due to the occurrence of an event. The period during which the carry-forward process is not applied to
The period L) shown in FIG. Therefore, even if the event occurs and the start of the real-time process is delayed by the allowable delay time, it is highly likely that the carry-forward process is not applied to the time-sharing process whose execution is interrupted.

【0096】これに対し上記実施例では、CPU1で時
分割プロセスAを起動するために実行される時分割プロ
セス起動処理(図9)において、ステップ286の判定
が肯定されることにより、ステップ288で時分割プロ
セスAの繰越し境界時間が短く(図9(B)に示すT
2’)されるので、実行が中断された時分割プロセスに
対し繰越し処理が適用されない期間Lも短くなり、イベ
ントが発生し実行が中断された時分割プロセスに対し繰
越し処理が適用される可能性が高くなる。繰越し処理が
適用された場合には、繰越し処理が適用されなかった場
合と比較してディスパッチの回数が少なくて済むので、
イベントの発生に伴うオーバヘッドの増大を更に抑制で
きる可能性が高い。
On the other hand, in the above-described embodiment, in the time-sharing process starting process (FIG. 9) executed to start the time-sharing process A in the CPU 1, the affirmative judgment in step 286 results in step 288. The carry-over boundary time of the time division process A is short (T shown in FIG. 9B).
2 ') is performed, the period L during which the carry-over processing is not applied to the time-sharing process whose execution has been interrupted is also shortened, and the carry-over processing may be applied to the time-sharing process in which an event has occurred and whose execution has been interrupted. Becomes higher. When the carry forward process is applied, the number of dispatches can be smaller than when the carry forward process is not applied.
There is a high possibility that the increase in overhead due to the occurrence of an event can be further suppressed.

【0097】なお、図4に示したイベント受付処理で
は、イベント発生時に許容遅延時間内にタイムスライス
満了となる時分割プロセスがあったとしても、CPU使
用時間が繰越し境界時間T2以上となっている時分割プ
ロセスがあれば、該時分割プロセスの実行を中断し実時
間プロセスを遅延させるようにしていたが、これに限定
されるものではない。例えば、ステップ104の判定よ
り前にステップ108の判定を行うようにした場合に
は、CPU使用時間が繰越し境界時間T2以上となって
いる時分割プロセスがあったとしても、イベント発生時
に許容遅延時間内にタイムスライス満了となる時分割プ
ロセスがあれば実時間プロセスの起動が遅延されるの
で、実時間プロセスの起動に伴う時分割プロセスの一時
的な実行率の低下を少なくすることができる。また、起
動すべき実時間プロセスの優先度に応じて上記2つの判
定の実行順序を変更するようにしてもよい。
In the event reception process shown in FIG. 4, even if there is a time division process in which the time slice ends within the allowable delay time when the event occurs, the CPU usage time is the carry-over boundary time T2 or more. If there is a time-sharing process, the execution of the time-sharing process is interrupted and the real-time process is delayed, but the present invention is not limited to this. For example, when the determination in step 108 is performed before the determination in step 104, even if there is a time-sharing process in which the CPU usage time is carried over to the boundary time T2 or more, the allowable delay time when an event occurs If there is a time-sharing process whose time slice has expired, the start of the real-time process is delayed, so it is possible to reduce the temporary reduction in the execution rate of the time-sharing process due to the start of the real-time process. Further, the execution order of the above two determinations may be changed according to the priority of the real-time process to be activated.

【0098】また、上記では実行が中断された所定の時
分割プロセスに対し繰越し処理を適用する場合、繰越し
時間T3を、前記所定の時分割プロセスを次回実行する
際に繰り越す(今回のタイムスライス時間Tとしてタイ
ムスライス時間T1と繰越し時間T3の和を設定)よう
にしていたが、これに限定されるものではなく、繰越し
時間T3を複数回に分けて繰り越す(例えばT3を
3 ’とt3 ”とに分割し(但しT3=t3 ’+
3 ”)、所定の時分割プロセスの次回のタイムスライ
ス時間TをT1+t3 ’、更に次の回のタイムスライス
時間TをT1+t3 ”とする等)ようにしてもよい。
Further, in the above, when the carry-over process is applied to the predetermined time-division process whose execution has been interrupted, the carry-over time T3 is carried over when the predetermined time-division process is executed next time (this time slice time). Although the sum of the time slice time T1 and the carry-over time T3 is set as T), the invention is not limited to this. The carry-over time T3 is carried over in a plurality of times (for example, T3 is t 3 'and t 3). divided into the "(However T3 = t 3 '+
t 3 ″), the next time slice time T of a predetermined time division process is T1 + t 3 ′, and the next time slice time T is T1 + t 3 ″).

【0099】なお、上記では本発明を適応可能な情報処
理装置の一例として、対称型マルチプロセッサシステム
である情報処理装置10を説明したが、これに限定され
るものではなく、非対称型のマルチプロセッサシステム
や、単一のプロセッサのみを備えマルチタスクで処理を
行うシステムにも適用可能であることは言うまでもな
い。
Although the information processing apparatus 10 which is a symmetric multiprocessor system has been described above as an example of the information processing apparatus to which the present invention can be applied, the present invention is not limited to this, and the asymmetric multiprocessor is not limited thereto. It goes without saying that the present invention is also applicable to a system or a system having only a single processor and performing processing by multitasking.

【0100】[0100]

【発明の効果】以上説明したように請求項1記載の発明
は、所定の事象の発生に伴い実時間プロセスを起動する
ために実行中の所定の時分割プロセスの実行を中断する
場合は、所定の時分割プロセスの実行を開始してからの
経過時間が所定の時分割プロセスの繰越し境界時間以上
であれば、所定の時分割プロセスの実行を中断して実時
間プロセスを起動し、時分割プロセスを実行可能な状態
となったときには所定の時分割プロセスに続いて実行す
べき別の時分割プロセスを実行すると共に、実行の中断
により生じた所定の時分割プロセスの通常実行時間の不
足分を、所定の時分割プロセスを再び実行する際へ繰り
越すようにしたので、実時間プロセスを起動すべき所定
の事象の発生によりオーバヘッドが増大することを抑制
できる、という優れた効果を有する。
As described above, according to the invention of claim 1, when the execution of a predetermined time-sharing process that is being executed to start a real-time process is interrupted when a predetermined event occurs, a predetermined time-sharing process is interrupted. If the elapsed time after the execution of the time-sharing process is started is equal to or longer than the carry-over boundary time of the predetermined time-sharing process, the execution of the predetermined time-sharing process is interrupted, the real-time process is started, and the time-sharing process is started. When it becomes a state where it can be executed, while executing another time-sharing process that should be executed following the predetermined time-sharing process, the shortage of the normal execution time of the predetermined time-sharing process caused by the interruption of execution is Since the predetermined time-sharing process is carried over when it is executed again, it is possible to prevent the overhead from increasing due to the occurrence of a predetermined event that should activate the real-time process. It was having an effect.

【0101】請求項2記載の発明は、実時間プロセスを
起動すべき所定の事象が発生した場合に、予め設定した
許容遅延時間内に現在実行中のプロセスが待機状態にな
るか否かを判断し、現在実行中のプロセスが許容遅延時
間内に待機状態となると判断した場合には、前記プロセ
スが待機状態となったときに実時間プロセスを起動する
ようにしたので、実時間プロセスを起動すべき所定の事
象の発生によりオーバヘッドが増大することを抑制でき
る、という優れた効果を有する。
In a second aspect of the present invention, when a predetermined event for activating a real-time process occurs, it is determined whether or not a process currently being executed enters a standby state within a preset allowable delay time. However, if it is determined that the process that is currently running enters the standby state within the allowable delay time, the real-time process is started when the process enters the standby state. This has an excellent effect that it is possible to suppress an increase in overhead due to occurrence of a predetermined event to be performed.

【0102】請求項3記載の発明は、実時間プロセスを
起動すべき所定の事象が発生した場合に、現在実行中の
プロセスが待機状態になるか、又は所定の事象が発生し
てからの経過時間が予め設定した許容遅延時間となった
ときに実時間プロセスを起動する実時間プロセスを起動
すべき所定の事象の発生によりオーバヘッドが増大する
ことを抑制できる、という優れた効果を有する。
According to the third aspect of the present invention, when a predetermined event for activating a real-time process occurs, the process currently being executed is in a standby state, or the process has elapsed since the predetermined event occurred. This has an excellent effect that it is possible to suppress an increase in overhead due to occurrence of a predetermined event for activating the real-time process when the time reaches a preset allowable delay time.

【0103】請求項4記載の発明は、請求項2又は請求
項3記載の発明において、実時間プロセスを起動すべき
所定の事象が発生した場合に、実行中でかつ実行を開始
してから繰越し境界時間以上経過した所定の時分割プロ
セスが有れば、所定の時分割プロセスの実行を中断して
実時間プロセスを起動し、時分割プロセスを実行可能な
状態となったときには所定の時分割プロセスに続いて実
行すべき別の時分割プロセスを実行すると共に、実行の
中断により生じた所定の時分割プロセスの通常実行時間
の不足分を、所定の時分割プロセスを再び実行する際へ
繰り越すようにしたので、上記効果に加え、所定の事象
の発生に対する実時間プロセス起動の応答性が向上す
る、という効果を有する。
According to a fourth aspect of the present invention, in the second or third aspect of the invention, when a predetermined event for activating a real-time process occurs, the real-time process is being executed and carried over after the execution is started. If there is a predetermined time-sharing process that has passed the boundary time or more, the execution of the predetermined time-sharing process is interrupted, the real-time process is started, and when the time-sharing process becomes ready to execute, the predetermined time-sharing process In addition to executing another time-sharing process that should be executed, the shortage of the normal execution time of the predetermined time-sharing process caused by the interruption of execution is carried over to the execution of the predetermined time-sharing process again. Therefore, in addition to the above effects, there is an effect that the responsiveness of the real-time process activation to the occurrence of a predetermined event is improved.

【0104】請求項5記載の発明は、請求項1又は請求
項4記載の発明において、過去に所定の時分割プロセス
の実行を中断することにより生じた通常実行時間の不足
分を繰り越して前記所定の時分割プロセスを実行してい
るときには、所定の時分割プロセスの優先度を通常時よ
りも高くするようにしたので、上記効果に加え、特定の
時分割プロセスの実行率が大きく低下することを回避す
ることができる、という効果を有する。
According to a fifth aspect of the present invention, in the first or fourth aspect of the present invention, the shortage of the normal execution time caused by interrupting the execution of the predetermined time division process in the past is carried over to the predetermined time. When executing the time-sharing process of, the priority of the predetermined time-sharing process is set to be higher than that of the normal time, so in addition to the above effect, the execution rate of the specific time-sharing process is significantly reduced. It has the effect that it can be avoided.

【0105】請求項6記載の発明は、請求項1又は請求
項4記載の発明において、複数の処理部で複数のプロセ
スを並列に実行する場合に、少なくとも1つの処理部で
実行される時分割プロセスの繰越し境界時間を、他の処
理部における時分割プロセスの実行状況に応じて変更す
るようにしたので、上記効果に加え、時分割プロセスの
実行状況に拘わらず所定の事象の発生に伴うオーバヘッ
ドの増大を回避できる、という効果を有する。
According to a sixth aspect of the present invention, in the invention according to the first or fourth aspect, when a plurality of processing units execute a plurality of processes in parallel, the time division is performed by at least one processing unit. Since the process carry-over boundary time is changed according to the execution status of the time-sharing process in other processing units, in addition to the above effects, the overhead associated with the occurrence of a predetermined event is generated regardless of the execution status of the time-sharing process. This has the effect of avoiding an increase in

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

【図1】本実施例に係る情報処理装置の概略構成を示す
ブロック図である。
FIG. 1 is a block diagram showing a schematic configuration of an information processing apparatus according to an embodiment.

【図2】システムデータベースの内容の概略を示すと共
に、各CPUによって実現される機能を機能ブロックと
して示す概略図である。
FIG. 2 is a schematic diagram showing an outline of the contents of a system database and showing the functions realized by each CPU as functional blocks.

【図3】TCBの内容を示す概念図である。FIG. 3 is a conceptual diagram showing the contents of TCB.

【図4】イベント受付処理の内容を説明するフローチャ
ートである。
FIG. 4 is a flowchart illustrating the content of event reception processing.

【図5】プロセス切替要求タイマタイムアウト受付処理
の内容を説明するフローチャートである。
FIG. 5 is a flowchart illustrating the contents of a process switching request timer timeout acceptance process.

【図6】実時間プロセスへの切替処理の内容を説明する
フローチャートである。
FIG. 6 is a flowchart illustrating the contents of a process of switching to a real-time process.

【図7】実時間プロセス終了処理の内容を説明するフロ
ーチャートである。
FIG. 7 is a flowchart illustrating the contents of real-time process termination processing.

【図8】時分割プロセス終了処理の内容を説明するフロ
ーチャートである。
FIG. 8 is a flowchart illustrating the content of time division process end processing.

【図9】時分割プロセス起動処理の内容を説明するフロ
ーチャートである。
FIG. 9 is a flowchart illustrating the content of time-division process activation processing.

【図10】繰越し時間経過タイマタイムアウト受付処理
の内容を説明するフローチャートである。
FIG. 10 is a flowchart illustrating the contents of a carry-over time elapsed timer timeout acceptance process.

【図11】(A)はイベントの発生が無い場合のディス
パッチ動作の一例、(B)はイベントが発生した場合の
従来方式によるディスパッチ動作の一例、(C)は本発
明の方式において(B)と同じ条件でのディスパッチ動
作の一例を各々示す概念図である。
11A is an example of a dispatch operation when an event does not occur, FIG. 11B is an example of a dispatch operation by a conventional method when an event occurs, and FIG. 11C is a method of the present invention. FIG. 7 is a conceptual diagram showing an example of a dispatch operation under the same conditions as in FIG.

【図12】実時間プロセスの起動を遅延させることによ
る作用を説明するための、(A)は従来方式におけるデ
ィスパッチ動作の一例、(B)は本発明の方式における
ディスパッチ動作の一例を各々示す概念図である。
FIGS. 12A and 12B are diagrams showing an example of a dispatch operation in a conventional method and an example of a dispatch operation in the method of the present invention, respectively, for explaining the effect of delaying the activation of a real-time process. It is a figure.

【図13】(A)はタイムスライス時間の長い時分割プ
ロセスが並行して実行された場合の問題点、(B)は繰
越し境界時間を動的に変更する場合の作用を各々説明す
るための概念図である。
FIG. 13A is a diagram illustrating a problem when a time division process having a long time slice time is executed in parallel, and FIG. 13B is a diagram illustrating an operation when dynamically changing a carry-over boundary time. It is a conceptual diagram.

【図14】従来のプロセスのディスパッチ方式として、
(A)は時分割プロセスのみ実行しているとき、(B)
は実時間プロセスのみ実行しているとき、(C)は時分
割プロセス及び実時間プロセスを実行しているときの、
ディスパッチの動作の一例を示す概念図である。
FIG. 14 shows a conventional process dispatch method.
(A) is only executing the time division process, (B)
Is a real-time process only, (C) is a time-sharing process and a real-time process,
It is a conceptual diagram which shows an example of operation | movement of dispatch.

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

10 情報処理装置 16 共有メモリ 10 information processing device 16 shared memory

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 定期的に実行すべき複数の時分割プロセ
ス及び所定の事象が発生した場合に実行すべき実時間プ
ロセスを各々実行するにあたり、 前記複数の時分割プロセスの各々に対し、通常実行時間
及び該通常実行時間よりも短い繰越し境界時間を予め定
めておき、 前記所定の事象が発生していない場合は、前記複数の時
分割プロセスの各々を、各時分割プロセスの通常実行時
間だけ順にかつ繰返し実行し、 所定の事象の発生に伴い実時間プロセスを起動するため
に実行中の所定の時分割プロセスの実行を中断する場合
は、前記所定の時分割プロセスの実行を開始してからの
経過時間が前記所定の時分割プロセスの繰越し境界時間
以上であれば、前記所定の時分割プロセスの実行を中断
して前記実時間プロセスを起動し、時分割プロセスを実
行可能な状態となったときには前記所定の時分割プロセ
スに続いて実行すべき別の時分割プロセスを実行すると
共に、前記実行の中断により生じた前記所定の時分割プ
ロセスの通常実行時間の不足分を、前記所定の時分割プ
ロセスを再び実行する際へ繰り越すことを特徴とするプ
ロセスディスパッチ方法。
1. When executing a plurality of time-sharing processes to be executed regularly and a real-time process to be executed when a predetermined event occurs, normal execution is performed for each of the plurality of time-sharing processes. Time and a carry-over boundary time shorter than the normal execution time are set in advance, and when the predetermined event does not occur, each of the plurality of time division processes is sequentially processed by the normal execution time of each time division process. And when repeatedly executing and interrupting the execution of the predetermined time-sharing process that is being executed in order to start the real-time process when a predetermined event occurs, after executing the predetermined time-sharing process, If the elapsed time is equal to or longer than the carry-over boundary time of the predetermined time division process, the execution of the predetermined time division process is interrupted, the real time process is started, and the time division process is started. When the ready state is reached, another time-sharing process that should be executed after the predetermined time-sharing process is executed, and the shortage of the normal execution time of the predetermined time-sharing process caused by the interruption of the execution. Is carried over when the predetermined time division process is executed again.
【請求項2】 所定の事象が発生した場合に実行すべき
実時間プロセスを含む多数のプロセスを各々実行するに
あたり、 前記所定の事象が発生した場合に、予め設定した許容遅
延時間内に現在実行中のプロセスが待機状態になるか否
かを判断し、現在実行中のプロセスが許容遅延時間内に
待機状態となると判断した場合には、前記プロセスが待
機状態となったときに前記実時間プロセスを起動するこ
とを特徴とするプロセスディスパッチ方法。
2. When each of a number of processes including a real-time process to be executed when a predetermined event occurs, when the predetermined event occurs, the process is currently executed within a preset allowable delay time. If it is determined whether the current process is in the standby state and the currently executing process is in the standby state within the allowable delay time, the real-time process is executed when the process is in the standby state. A process dispatch method characterized by starting a process.
【請求項3】 所定の事象が発生した場合に実行すべき
実時間プロセスを含む多数のプロセスを各々実行するに
あたり、 前記所定の事象が発生した場合に、現在実行中のプロセ
スが待機状態になるか、又は前記所定の事象が発生して
からの経過時間が予め設定した許容遅延時間となったと
きに前記実時間プロセスを起動することを特徴とするプ
ロセスディスパッチ方法。
3. When executing a large number of processes including a real-time process that should be executed when a predetermined event occurs, when the predetermined event occurs, the currently executing process enters a standby state. Alternatively, the process dispatch method is characterized in that the real-time process is activated when an elapsed time from the occurrence of the predetermined event reaches a preset allowable delay time.
【請求項4】 前記多数のプロセスには、定期的に実行
すべき複数の時分割プロセスが含まれており、 前記複数の時分割プロセスの各々に対し、通常実行時間
及び該通常実行時間よりも短い繰越し境界時間を定めて
おき、 前記所定の事象が発生していない場合は、前記複数の時
分割プロセスの各々を、各時分割プロセスの通常実行時
間だけ順にかつ繰返し実行し、 前記所定の事象が発生した場合に、実行中でかつ実行を
開始してから前記繰越し境界時間以上経過した所定の時
分割プロセスが有れば、前記所定の時分割プロセスの実
行を中断して前記実時間プロセスを起動し、時分割プロ
セスを実行可能な状態となったときには前記所定の時分
割プロセスに続いて実行すべき別の時分割プロセスを実
行すると共に、前記実行の中断により生じた前記所定の
時分割プロセスの通常実行時間の不足分を、前記所定の
時分割プロセスを再び実行する際へ繰り越すことを特徴
とする請求項2又は請求項3記載のプロセスディスパッ
チ方法。
4. The plurality of processes include a plurality of time-sharing processes to be executed periodically, and a normal execution time and a normal execution time more than the normal execution time are provided for each of the plurality of time-sharing processes. If a short carry-over boundary time is set and the predetermined event has not occurred, each of the plurality of time division processes is sequentially and repeatedly executed for the normal execution time of each time division process, and the predetermined event When there is a predetermined time-division process that is being executed and has passed the carry-over boundary time or more since the start of execution, the execution of the predetermined time-division process is interrupted and the real-time process is executed. When the time-sharing process is started up and ready to be executed, another time-sharing process that should be executed is executed after the predetermined time-sharing process, and the execution is interrupted. 4. The process dispatch method according to claim 2, wherein the shortage of the normal execution time of the predetermined time division process is carried over to the time of executing the predetermined time division process again.
【請求項5】 過去に所定の時分割プロセスの実行を中
断することにより生じた通常実行時間の不足分を繰り越
して前記所定の時分割プロセスを実行しているときに
は、前記所定の時分割プロセスの優先度を通常時よりも
高くすることを特徴とする請求項1又は請求項4記載の
プロセスディスパッチ方法。
5. When the predetermined time division process is being carried out by carrying over the shortage of the normal execution time caused by interrupting the execution of the predetermined time division process in the past, 5. The process dispatch method according to claim 1 or 4, wherein the priority is set higher than that at the normal time.
【請求項6】 複数の処理部で複数のプロセスを並列に
実行する場合に、前記複数の処理部のうちの少なくとも
1つの処理部で実行される前記時分割プロセスの繰越し
境界時間を、他の処理部における時分割プロセスの実行
状況に応じて変更することを特徴とする請求項1又は請
求項4記載のプロセスディスパッチ方法。
6. When a plurality of processing units execute a plurality of processes in parallel, the carry-over boundary time of the time-sharing process executed by at least one processing unit of the plurality of processing units is set to another value. The process dispatch method according to claim 1 or 4, wherein the process dispatching method is changed according to the execution status of the time division process in the processing unit.
JP7117386A 1995-05-16 1995-05-16 Process dispatch method Pending JPH08314740A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7117386A JPH08314740A (en) 1995-05-16 1995-05-16 Process dispatch method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7117386A JPH08314740A (en) 1995-05-16 1995-05-16 Process dispatch method

Publications (1)

Publication Number Publication Date
JPH08314740A true JPH08314740A (en) 1996-11-29

Family

ID=14710371

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7117386A Pending JPH08314740A (en) 1995-05-16 1995-05-16 Process dispatch method

Country Status (1)

Country Link
JP (1) JPH08314740A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005316960A (en) * 2004-03-29 2005-11-10 Matsushita Electric Ind Co Ltd Processing terminal, receiving terminal, and processing system for received data
JP2008108075A (en) * 2006-10-25 2008-05-08 Matsushita Electric Ind Co Ltd Task switch control method, and computer system
JP2010205046A (en) * 2009-03-04 2010-09-16 Toyota Motor Corp Information processing apparatus
JP2015507808A (en) * 2012-01-18 2015-03-12 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Warning tracking interrupt facility

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005316960A (en) * 2004-03-29 2005-11-10 Matsushita Electric Ind Co Ltd Processing terminal, receiving terminal, and processing system for received data
JP4504236B2 (en) * 2004-03-29 2010-07-14 パナソニック株式会社 Processing terminal, receiving terminal and received data processing system
JP2008108075A (en) * 2006-10-25 2008-05-08 Matsushita Electric Ind Co Ltd Task switch control method, and computer system
JP2010205046A (en) * 2009-03-04 2010-09-16 Toyota Motor Corp Information processing apparatus
JP2015507808A (en) * 2012-01-18 2015-03-12 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Warning tracking interrupt facility

Similar Documents

Publication Publication Date Title
US5390329A (en) Responding to service requests using minimal system-side context in a multiprocessor environment
US9870252B2 (en) Multi-threaded processing with reduced context switching
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
EP1365328A1 (en) Method for executing parallel process, and multi-processor computer
US20120260257A1 (en) Scheduling threads in multiprocessor computer
US20010034751A1 (en) Real-time OS simulator
JPH06250853A (en) Management method and system for process scheduling
CN111897637B (en) Job scheduling method, device, host and storage medium
US6408324B1 (en) Operating system having a non-interrupt cooperative multi-tasking kernel and a method of controlling a plurality of processes with the system
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
Atlas et al. Design and implementation of statistical rate monotonic scheduling in KURT Linux
CN109766168B (en) Task scheduling method and device, storage medium and computing equipment
JPH08314740A (en) Process dispatch method
Horowitz A run-time execution model for referential integrity maintenance
JP2008225641A (en) Computer system, interrupt control method and program
CN112114967B (en) GPU resource reservation method based on service priority
JP2009048358A (en) Information processor and scheduling method
JP3005562B1 (en) Task management device and task scheduling method
JPH10177489A (en) Task scheduling method
CN115981829B (en) Scheduling method and system in Internet of things
CN116932227B (en) Task scheduling method and device based on single thread
JPH09160790A (en) Device and method for task schedule
JPH11184828A (en) Test system for multiprocessor system
JPH08137703A (en) Task switching device
US20210141661A1 (en) Lightweight Context For CPU Idling Using A Real Time Kernel

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees