JPH1069392A - How the process runs - Google Patents

How the process runs

Info

Publication number
JPH1069392A
JPH1069392A JP22640496A JP22640496A JPH1069392A JP H1069392 A JPH1069392 A JP H1069392A JP 22640496 A JP22640496 A JP 22640496A JP 22640496 A JP22640496 A JP 22640496A JP H1069392 A JPH1069392 A JP H1069392A
Authority
JP
Japan
Prior art keywords
abort
function
prohibition
preemption
processing
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.)
Granted
Application number
JP22640496A
Other languages
Japanese (ja)
Other versions
JP3724075B2 (en
Inventor
Masahiko Nakahara
雅彦 中原
Masaaki Iwasaki
正明 岩嵜
Osamu Takeuchi
理 竹内
Takahiro Nakano
隆裕 中野
Hajime Serizawa
一 芹沢
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP22640496A priority Critical patent/JP3724075B2/en
Priority to EP97114394A priority patent/EP0834806B1/en
Priority to CA002213371A priority patent/CA2213371C/en
Priority to DE69738646T priority patent/DE69738646T2/en
Priority to US08/917,477 priority patent/US6253225B1/en
Publication of JPH1069392A publication Critical patent/JPH1069392A/en
Priority to US09/838,767 priority patent/US6848102B2/en
Application granted granted Critical
Publication of JP3724075B2 publication Critical patent/JP3724075B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide the process executing method for multiprocessing using common resources without spoiling the periodic drivability of a process which performs continuous media processing. SOLUTION: A process uses an abort inhibition function 21 first and aborts itself for inhibition. Then a preempt inhibition part 30 is used to perform preempt inhibition, and processing wherein common resources are used is entered. After the process for the common resources ends, the preempt inhibition part 30 is used immediately to enter a preempt ready state. After all processes end, an abort inhibition reset function 22 is used lastly to reset the abort inhibition. If the process is forcibly ended during the abort inhibition. The process is continuously executed until the abort inhibition is resets and after the abort inhibition is reset, the forcible ending process of the process is performed.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は計算機を制御するオ
ペレーティング・システムにおけるプロセスの実行方法
に係り、特に、マルチプロセシング環境を提供するオペ
レーティング・システムにおける共有資源を使用するプ
ロセスの実行方法に関する。
The present invention relates to a method for executing a process in an operating system for controlling a computer, and more particularly to a method for executing a process using a shared resource in an operating system providing a multi-processing environment.

【0002】[0002]

【従来の技術】複数のプロセス(またはタスク)を時分
割で並列に実行するマルチプロセシング環境を提供する
オペレーティング・システムでは、プロセス間で共有す
る資源(共有資源)が複数のプロセスに同時に割り当て
られないように排他制御を行ないながらプロセスを実行
する必要がある。この排他制御を実現するために、オペ
レーティング・システム(OS)においてロック制御と
呼ばれる手法が広く使用されている。
2. Description of the Related Art In an operating system that provides a multiprocessing environment in which a plurality of processes (or tasks) are executed in parallel in a time-sharing manner, resources shared between processes (shared resources) cannot be allocated to a plurality of processes at the same time. It is necessary to execute a process while performing exclusive control as described above. In order to realize this exclusive control, a method called lock control is widely used in an operating system (OS).

【0003】ロック制御では、共有資源毎に対応する共
有資源が使用中であることを示すフラグを設ける。プロ
セスが共有資源に対する処理を行う際には、このフラグ
が他のプロセスによりセットされているかを調べる。そ
して、他のプロセスによりフラグがセットされた状態で
なければ、このプロセスによりフラグをセットして資源
を占有する(これを「ロック」すると言う)。そして、
この共有資源に対する処理の終了とともにプロセスがフ
ラグをリセットして資源を解放する(これを「アンロッ
ク」すると言う)。一方、他のプロセスによりフラグが
セットされた状態ならば、OSはこの共有資源がアンロ
ックされるまで、このプロセスを待ち状態にする。
In the lock control, a flag is provided for each shared resource to indicate that the corresponding shared resource is in use. When a process performs a process on a shared resource, it checks whether this flag has been set by another process. If the flag is not set by another process, the flag is set by this process to occupy the resource (this is called "lock"). And
When the process for the shared resource ends, the process resets the flag and releases the resource (this is called "unlock"). On the other hand, if the flag is set by another process, the OS puts this process in a waiting state until the shared resource is unlocked.

【0004】ところで、並列に実行される優先度の低い
プロセス1と優先度の高いプロセス2が存在し、二つの
プロセスが共有する資源Aがあるとする。いま、プロセ
ス1がCPU占有中に共有資源Aをロックし、共有資源A
をロックしたまま休眠状態に入ったとする。この場合、
CPUの使用権が割り当てられたプロセス2が共有資源A
を使用しようとしても、共有資源Aが他のプロセスによ
りロックされているため、プロセス2は共有資源Aを使
用できない。このためプロセス2は、実行継続不能とな
る。
By the way, it is assumed that there are a low-priority process 1 and a high-priority process 2 which are executed in parallel, and there is a resource A shared by the two processes. Now, while the process 1 occupies the CPU, the shared resource A is locked, and the shared resource A is locked.
It is assumed that the computer enters a sleep state with the lock. in this case,
Process 2 to which the right to use the CPU is assigned is shared resource A
, The process 2 cannot use the shared resource A because the shared resource A is locked by another process. Therefore, the process 2 cannot be executed continuously.

【0005】このように優先度の低いプロセスが獲得し
ているロックのために、優先度の高いプロセスが実行継
続不能となることを優先度逆転問題という。従来のオペ
レーティング・システムでは、優先度逆転問題が発生し
た場合は、ロックを取ったまま休眠している優先度の低
いプロセスを最優先で実行させることにより、優先度の
低いプロセスが獲得している資源を解放させ、優先度の
高いプロセスをできるだけ早く実行できるようにしてい
る。
[0005] The inversion of a high-priority process due to a lock acquired by a low-priority process is called a priority inversion problem. In the case of a conventional operating system, when a priority inversion problem occurs, a low-priority process is acquired by executing a low-priority process that is sleeping while holding a lock with the highest priority. It frees up resources so that high-priority processes can run as soon as possible.

【0006】[0006]

【発明が解決しようとする課題】連続メディア処理で
は、動画データなどのデータを処理するプロセスの動作
に周期性が生ずる。この性質を利用したプロセス・スケ
ジューリング方法を特願平8−73673で提供した。
In the continuous media processing, the operation of a process for processing data such as moving image data has periodicity. A process scheduling method utilizing this property is provided in Japanese Patent Application No. 8-73673.

【0007】しかし、優先度逆転問題は周期性を利用し
たプロセス・スケジューリング方法に対しても悪影響を
及ぼす。例えば、連続メディア処理を行うプロセス1、
プロセス2が存在し、二つのプロセスの間で共有する資
源Aがあるとする。プロセス1とプロセス2がこの共有
資源Aをロックを使って排他制御する場合、優先度逆転
問題を発生させる可能性があり、発生すればプロセスの
周期駆動性を損なうことになる。
However, the priority inversion problem has an adverse effect on a process scheduling method using periodicity. For example, a process 1 for performing continuous media processing,
It is assumed that a process 2 exists and a resource A is shared between the two processes. When the process 1 and the process 2 exclusively control the shared resource A using the lock, there is a possibility that a priority inversion problem may occur, and if this occurs, the periodic driving of the process is impaired.

【0008】更に問題なのは、優先度逆転問題が発生す
ると、その原因となったロックを持っているプロセスが
最優先にスケジュールされるため、そのロックとは関係
なく連続メディア処理を行っている別のプロセスの周期
駆動性にまで影響を与えることである。
[0008] Further, when the priority inversion problem occurs, the process having the lock that caused the priority inversion is scheduled with the highest priority, so that another process that performs continuous media processing irrespective of the lock is performed. That is, it affects the periodic drive of the process.

【0009】そこで、連続メディア処理を行うシステム
では、優先度逆転問題を回避するために最初から一切ロ
ックを用いずに計算機システムを構築する方法が考えら
れる。そのような計算機システムにおいて排他制御を行
う方法として、共有資源使用中はプロセスにCPUを占有
させる、すなわち、共有資源使用中は他のプロセスがス
ケジューリングされないプロセス制御方法が考えられ
る。これは、特願平8−97997の発明で提供したプ
リエンプト制御方法を使用することで実現可能である。
プリエンプト制御方法とは、実行中プロセスの実行が一
時中断される(これを「プリエンプト」されると言う)
ことを防ぐために「プリエンプト禁止」及び「プリエン
プト禁止解除」のインタフェースを用意し、プリエンプ
ト禁止にされてからプリエンプト禁止が解除されるまで
の間(これを「プリエンプト禁止区間」と呼ぶ)は他の
プロセスのスケジューリング要求が発行されても、実行
中プロセスはプリエンプトされずに実行を続ける方法で
ある。このような制御を行うことによって、共有資源を
使用しているプロセスは常に1個であることが保証でき
るため、排他制御が実現できる。
Therefore, in a system for performing continuous media processing, a method of constructing a computer system without using any lock from the beginning to avoid the priority inversion problem can be considered. As a method of performing exclusive control in such a computer system, a process control method in which a process occupies the CPU while a shared resource is used, that is, no other process is scheduled while the shared resource is used, is considered. This can be realized by using the preemption control method provided in the invention of Japanese Patent Application No. 8-97997.
The preemption control method means that the execution of a running process is suspended (this is called "preemption").
In order to prevent this, an interface of “preemption prohibition” and “preemption prohibition release” is prepared, and another process is performed between the time the preemption is prohibited and the time the preemption prohibition is released (this is called “preemption prohibition section”). Even if the scheduling request is issued, the running process is not preempted and continues executing. By performing such control, it is possible to guarantee that only one process uses the shared resource at all times, so that exclusive control can be realized.

【0010】しかし、この方法では共有資源使用中のプ
ロセス走行区間が長時間に渡る場合には他のプロセスの
周期駆動性を損なってしまう。
However, in this method, when a process running section using a shared resource extends for a long time, the periodic driving of other processes is impaired.

【0011】例えば、システム内で共有している使用可
能な資源をキューイングするフリーリストから資源を取
り出し、これを初期化して、あるプロセスの資源割当て
リストに繋ぐ処理を考える。ここで排他制御が必要な共
有資源となるのは、フリーリストと資源割当てリストで
ある。
For example, consider a process of extracting resources from a free list that queues available resources shared in the system, initializing the resources, and connecting the resources to a resource allocation list of a certain process. Here, the shared resources requiring exclusive control are a free list and a resource allocation list.

【0012】この処理をプリエンプト禁止区間の設定だ
けで行う場合、プリエンプト禁止区間は「フリーリスト
に触る前」から「資源割当てリストに資源を繋ぎおわ
る」まで設定する必要がある。すなわち、 (1)プリエンプト禁止の設定を行う (2)フリーリストから資源を取り出す (3)資源の初期化を行う (4)資源をプロセスの資源割当てリストに繋ぐ (5)プリエンプト禁止の設定を解除する となる。ここで、資源の初期化に要する時間は短いとは
限らない。実際、オペレーティング・システム内でメモ
リを割り当てる際のメモリの初期化等では数十msを要
する。そのような場合に上記の様にプリエンプト禁止区
間の設定だけで排他制御を行うと、一つのプロセスが長
時間CPUを占有することになる。この結果、リアルタ
イム応答性が悪くなり、連続メディア処理の周期駆動性
に影響を与えることになる。
If this process is performed only by setting a preemption prohibited section, the preemption prohibited section must be set from "before touching the free list" to "connecting resources to the resource allocation list". That is, (1) Pre-emption prohibition setting is performed. (2) Resource is taken out from the free list. (3) Resource initialization is performed. (4) Resource is linked to the process resource allocation list. (5) Pre-emption prohibition setting is released. It becomes. Here, the time required for the initialization of the resources is not always short. Actually, it takes several tens of ms to initialize the memory when allocating the memory in the operating system. In such a case, if exclusive control is performed only by setting the preemption prohibited section as described above, one process occupies the CPU for a long time. As a result, the real-time responsiveness is deteriorated, which affects the periodic drive of the continuous media processing.

【0013】そこで、上記処理を (1)プリエンプト禁止の設定を行う (2)フリーリストから資源を取り出す (3)プリエンプト禁止の設定を解除する (4)資源の初期化を行う (5)プリエンプト禁止の設定を行う (6)資源をプロセスの資源割当てリストに繋ぐ (7)プリエンプト禁止の設定を解除する という形に変更することが考えられる。このようにすれ
ば、排他制御という点でのみ見れば、必要条件を満たし
ている。しかも、プリエンプト禁止区間の長さは10μ
s程度に抑えられ、(4)の処理中はCPU使用権を他
のプロセスに移すことができるので、リアルタイム応答
性が良くなる。ところが、(4)の処理をしている途中
に、この処理を行っているプロセスが外部から強制終了
させられた場合に問題が生ずる。
Therefore, the above processing is performed by (1) setting the preemption prohibition (2) extracting the resource from the free list (3) releasing the setting of the preemption prohibition (4) initializing the resource (5) prohibiting the preemption (6) Connect resources to the resource allocation list of the process. (7) Release preemption prohibition setting. In this way, the requirements are satisfied only in terms of exclusive control. Moreover, the length of the preemption prohibited section is 10μ.
s, and the CPU use right can be transferred to another process during the process (4), so that real-time responsiveness is improved. However, a problem occurs when the process performing this process is forcibly terminated from the outside during the process (4).

【0014】一般の計算機システムでは、プログラムの
暴走に備えて、外部からプロセスを強制的に停止・消滅
させる機能を備えている。この機能を使って上記処理を
行っているプロセスが他のプロセス等から強制終了させ
られた場合、(4)で初期化している資源がどの管理リ
ストにも属さない所属不明の資源となる可能性がある。
この結果、オペレーティング・システムがプロセスを消
滅させる際に資源の回収ができず、その資源は永久に使
用できなくなる可能性がある。これを回避するために
は、フリーリスト、あるいは資源割り当てリストに資源
を繋いだ状態で資源を初期化する方法が考えられるが、
この方法では、前の例の処理全体をプリエンプト禁止区
間で覆う方法とプリエンプト禁止区間の長さがほとんど
変わらなくなる。別の方法として、初期化中の資源を管
理するリストを別に用意し、(4)の処理中はこのリス
トに繋ぐ方法もあるが、リストの繋ぎ換え処理が多くな
るため、初期化処理のオーバヘッドが大きくなる。
A general computer system has a function of forcibly stopping and deleting a process from the outside in preparation for a program runaway. If the process performing the above process using this function is forcibly terminated by another process, etc., the resource initialized in (4) may become an unknown resource that does not belong to any management list. There is.
As a result, resources may not be reclaimed when the operating system kills the process, and the resources may become permanently unavailable. In order to avoid this, there is a method of initializing resources with the resources connected to the free list or the resource allocation list.
In this method, the length of the preemption prohibited section hardly differs from the method of covering the entire processing of the previous example with the preemption prohibited section. As another method, there is a method of separately preparing a list for managing the resources being initialized, and connecting to this list during the processing of (4). However, since the number of processings for changing the list increases, the overhead of the initialization processing is increased. Becomes larger.

【0015】また、共有資源獲得のために必要な時間を
短時間に抑えることができない場合にも、上記の方法は
使用できない。
The above method cannot be used even when the time required for acquiring the shared resources cannot be reduced to a short time.

【0016】そこで本発明者は、プリエンプト制御方法
を利用して、連続メディア処理の周期駆動性に影響を与
えずに共有資源の処理を行うことができるプロセス実行
方法を発明した。
Therefore, the present inventor has invented a process execution method that can perform processing of a shared resource by using a preemption control method without affecting the periodic drive of continuous media processing.

【0017】したがって、本発明の目的は連続メディア
処理を行う計算機システムの共有資源を使用するプロセ
スの実行方法を提供することにある。
Accordingly, it is an object of the present invention to provide a method of executing a process using a shared resource of a computer system that performs continuous media processing.

【0018】[0018]

【課題を解決するための手段】本発明では、プロセスが
共有資源を使用する際には、予め自プロセスが強制終了
させられない(これを「アボート」されないと言い、ア
ボートされないようにすることを「アボート禁止」にす
ると言う)ように宣言を行う。その上で,自プロセスの
処理が中断されないように「プリエンプト禁止」にす
る。そして、共有資源の使用が終了した際にはプリエン
プト禁止の解除を行う。共有資源に対するすべての処理
が終了したら、自プロセスが強制終了させられてもよい
(これを「アボート禁止解除」と呼ぶ)ことを宣言す
る。このアボート禁止を宣言してからアボート禁止解除
を宣言するまでのプロセスが強制終了させられない区間
のことをアボート禁止区間と呼び、このアボート禁止区
間内に当該プロセスの強制終了要求が入った場合は、ア
ボート禁止区間が終了するまでプロセスの実行を継続
し、アボート禁止解除が行われた時点で、当該プロセス
を強制終了させる。
According to the present invention, when a process uses a shared resource, its own process cannot be forcibly terminated in advance (this is referred to as "not aborted", so that it is not aborted). "Abort prohibited"). Then, "preemption prohibited" is set so that the process of the own process is not interrupted. Then, when the use of the shared resource is finished, the preemption prohibition is released. When all the processing for the shared resource is completed, it declares that the own process may be forcibly terminated (this is called “abort inhibition release”). The section in which the process from declaring the abort prohibition to declaring the abort prohibition release cannot be forcibly terminated is called an abort prohibition section. If a forced termination request for the process is included in this abort prohibition section, Then, the execution of the process is continued until the abort prohibition section ends, and when the abort prohibition is canceled, the process is forcibly terminated.

【0019】また、共有資源の使用時間が長い場合につ
いては、システム内にその処理を専門に行うプロセスを
1個だけ用意し、更に、そのプロセスに要求を送るため
のキューを用意する。そして、他の連続メディア処理を
行うプロセスは、周期駆動を開始する前に専用プロセス
に処理を依頼し、共有資源への処理が完了した後、周期
駆動に入る。処理要求は先のキューに入れる。専用プロ
セス内では、共有資源に対する処理を行うプロセスがシ
ステム内で1個であることが保証されるため、プリエン
プト可能状態のまま共有資源に対する処理を行うことが
でき、周期駆動プロセスと並行して動作することができ
る。
When the use time of the shared resource is long, only one process dedicated to the processing is prepared in the system, and a queue for sending a request to the process is prepared. Then, the process for performing another continuous media process requests a dedicated process for processing before starting the periodic drive, and enters the periodic drive after the process for the shared resource is completed. The processing request is put in the previous queue. In the dedicated process, it is guaranteed that there is only one process for processing the shared resource in the system. Therefore, the process for the shared resource can be performed in a preemptable state, and operates in parallel with the periodic drive process. can do.

【0020】これら二つのプロセス実行方法を組み合わ
せることで、複数のプロセスが並列に動作するマルチプ
ロセシング環境において、他の周期駆動を行っているプ
ロセスに影響を与えずに、共有資源を使用する複数のプ
ロセスを実行させることが可能となる。
By combining these two process execution methods, in a multiprocessing environment in which a plurality of processes operate in parallel, a plurality of processes using a shared resource can be used without affecting other processes which are periodically driven. The process can be executed.

【0021】[0021]

【発明の実施の形態】以下、本発明の実施形態を詳細に
説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail.

【0022】本発明に必要なモジュール群及びデータを
図1に示す。
FIG. 1 shows a group of modules and data necessary for the present invention.

【0023】図1において、10はプロセスを管理する
ためのテーブルであり、この中にアボート要求フラグ1
1、アボート禁止フラグ12、アボート禁止のネストを
カウントするためのカウンタ13を保持している。ま
た、20はプロセスを管理するプロセス管理部、21は
アボート禁止を行うためのインタフェース関数、22は
アボート禁止を解除にするためのインタフェース関数で
あり、200は共有資源の処理を必要としているプロセ
スである。なお、プロセス200内の共用資源を使用す
る関数40は作業領域23及び37を保持している。更
に、30は特願平8−97997に基づくプリエンプト
制御部であり、スケジューラ31、プリエンプト禁止関
数32、プリエンプト禁止解除関数33、スケジューリ
ング要求フラグ34、プリエンプト禁止フラグ35、プ
リエンプト禁止のネストをカウントするためのカウンタ
36を保持している。
In FIG. 1, reference numeral 10 denotes a table for managing a process, in which an abort request flag 1 is set.
1, an abort inhibition flag 12, and a counter 13 for counting the abort inhibition nest. Reference numeral 20 denotes a process management unit that manages a process, reference numeral 21 denotes an interface function for performing abort prohibition, reference numeral 22 denotes an interface function for releasing abort prohibition, and reference numeral 200 denotes a process that requires processing of a shared resource. is there. The function 40 using the shared resources in the process 200 holds the work areas 23 and 37. Reference numeral 30 denotes a preemption control unit based on Japanese Patent Application No. 8-97997, which counts the scheduler 31, the preemption prohibition function 32, the preemption prohibition release function 33, the scheduling request flag 34, the preemption prohibition flag 35, and the nest of preemption prohibition. Is held.

【0024】本発明を実現するためのプロセス内のアボ
ート禁止、プリエンプト禁止の制御の流れを図2に示
す。共有資源に関わる処理を行う場合、その処理を行う
プロセス200内の関数40は最初にアボート禁止関数
21を用いて自プロセスをアボート禁止にする(10
1)。そして、共有資源を使用する直前に自プロセスを
プリエンプト禁止部30内のプリエンプト禁止関数32
を用いてプリエンプト禁止にし(102)、共有資源を
利用する処理に入る(103)。共有資源に対する処理
を終了したら、直ちにプリエンプト禁止部30内のプリ
エンプト禁止解除関数33を用いてプリエンプト禁止を
解除する(104)。ここで、プリエンプト禁止から禁
止解除までの間(102〜104)のプリエンプト禁止
区間が設定できるのは、周期駆動性に影響を与えない時
間、例えば周期駆動を管理する最小単位時間の10%以
下の時間で終了する共有資源への処理に限られる。次の
プリエンプト禁止を宣言するまでの間はプリエンプト可
能状態で、割り当て資源に対する初期化等、処理に長い
時間を必要とする処理を行う(105)。この間は他の
プロセスがスケジュールされ、プロセス200の実行が
一時中断されてもよい。そして再び共有資源への処理が
必要になった場合は、再度プロセス200は自プロセス
をプリエンプト禁止状態にする(106)。そして、共
有資源への処理(107)を行った後、プリエンプト禁
止を解除する(108)。すべての処理が終了したら最
後にアボート禁止解除関数22を使ってアボート禁止を
解除する(109)。
FIG. 2 shows the flow of control for inhibiting abort and preemption in a process for realizing the present invention. When performing a process related to a shared resource, the function 40 in the process 200 that performs the process first uses the abort prohibition function 21 to prohibit the own process from being aborted (10
1). Then, immediately before using the shared resource, the own process is set to the preemption inhibition function 32 in the preemption inhibition unit 30.
, The preemption is prohibited (102), and the process for using the shared resource is started (103). As soon as the processing for the shared resource is completed, the preemption prohibition is released by using the preemption prohibition release function 33 in the preemption prohibition unit 30 (104). Here, the preemption prohibition section from the preemption prohibition to the prohibition release (102 to 104) can be set for a time that does not affect the periodic driving property, for example, 10% or less of the minimum unit time for managing the periodic driving. Limited to processing on shared resources that end in time. Until the next preemption is declared, preemption is possible, and processing that requires a long time for processing, such as initialization of allocated resources, is performed (105). During this time, another process may be scheduled and execution of the process 200 may be suspended. Then, when it becomes necessary to process the shared resource again, the process 200 sets its own process to the preemption prohibited state again (106). Then, after performing the process for the shared resource (107), the preemption prohibition is released (108). When all the processes are completed, the abort prohibition is finally released using the abort prohibition release function 22 (109).

【0025】図2の例では、アボート禁止からアボート
禁止解除までの間に2回のプリエンプト禁止区間が存在
するが、実際に存在するプリエンプト禁止区間の数は3
個以上でもよい。
In the example of FIG. 2, there are two preemption prohibited sections between the abort prohibition and the abort prohibition release, but the number of preemption prohibited sections actually present is three.
It may be more than one.

【0026】図3は図2におけるアボート禁止の手続き
101の内部処理を詳細に示したフローチャートであ
る。図3の処理は図1に示したアボート禁止関数21が
行う。まず、アボート禁止関数21は、プロセス200
を管理しているプロセス管理テーブル10内のアボート
禁止フラグ12がOFFの状態かどうかを調べる(12
0)。アボート禁止フラグ12がOFFであるならば、
これをONにする(121)。その後、カウンタ13の
値を1上げる(122)。図3の処理は、全体を不可分
に行う。
FIG. 3 is a flowchart showing in detail the internal processing of the abort prohibition procedure 101 in FIG. The process of FIG. 3 is performed by the abort prohibition function 21 shown in FIG. First, the abort prohibition function 21 executes the process 200
Is checked whether the abort prohibition flag 12 in the process management table 10 that manages the
0). If the abort prohibition flag 12 is OFF,
This is turned on (121). Thereafter, the value of the counter 13 is increased by one (122). The processing in FIG. 3 is performed inseparably as a whole.

【0027】図4は図2におけるプリエンプト禁止の手
続き102及び106の内部処理を詳細に示したフロー
チャートである。図4の処理は図1に示したプリエンプ
ト禁止関数31が行う。まず、プリエンプト禁止関数3
1は、プリエンプト制御部30内のプリエンプト禁止フ
ラグ35がOFFの状態かどうかを調べる(130)。
アボート禁止フラグ35がOFFであるならば、これを
ONにする(131)。その後、カウンタ36の値を1
上げる(132)。図4の処理は、全体を不可分に行
う。
FIG. 4 is a flowchart showing in detail the internal processing of the preemption prohibition procedures 102 and 106 in FIG. The processing in FIG. 4 is performed by the preemption prohibition function 31 shown in FIG. First, the preemption prohibition function 3
1 checks whether the preemption prohibition flag 35 in the preemption control unit 30 is in the OFF state (130).
If the abort prohibition flag 35 is OFF, it is turned ON (131). Then, the value of the counter 36 is set to 1
(132). The processing in FIG. 4 is performed inseparably as a whole.

【0028】図5は図2におけるプリエンプト禁止解除
の手続き104及び108の内部処理を詳細に示したフ
ローチャートである。図5の処理は図1に示したプリエ
ンプト禁止解除関数32が行う。まず、プリエンプト禁
止解除関数32は、第1引数で渡される関数のネストの
値(後述)がカウンタ36の値と一致してるか非かを調
べる(140)。もし、一致していないければ異常処理
を行う。一致している場合は、プリエンプト制御部30
内のカウンタ36の値を1減らす(141)。その結
果、カウンタ36の値が正の値ならば、そのまま処理を
終了する(142)。0又は負の値になったならば、プ
リエンプト禁止フラグをOFFにする(143)。次
に、プリエンプト制御部30内のスケジューリング要求
フラグ34を調べる(144)。OFFならば処理を終
了する。ONならばスケジューラ31を起動し(14
5)、プロセスのスケジューリング処理に入る。
FIG. 5 is a flowchart showing in detail the internal processing of the preemption prohibition canceling procedures 104 and 108 in FIG. The processing in FIG. 5 is performed by the preemption inhibition release function 32 shown in FIG. First, the preemption prohibition canceling function 32 checks whether the value of the nest of the function (described later) passed by the first argument matches the value of the counter 36 (140). If they do not match, abnormal processing is performed. If they match, the preempt control unit 30
The value of the counter 36 is decremented by one (141). As a result, if the value of the counter 36 is a positive value, the processing ends as it is (142). When the value becomes 0 or a negative value, the preemption inhibition flag is turned off (143). Next, the scheduling request flag 34 in the preemption control unit 30 is checked (144). If it is OFF, the process ends. If ON, the scheduler 31 is started (14
5) Enter the process scheduling process.

【0029】図6は図2におけるアボート禁止解除の手
続き109の内部処理を詳細に示したフローチャートで
ある。図6の処理は図1に示したアボート禁止解除関数
22が行う。まずアボート禁止解除関数22は、第1引
数で渡される関数のネストの値(後述)がカウンタ13
の値と一致してるか非かを調べる(150)。もし、一
致していないければ異常処理を行う。一致している場合
は、プロセス200を管理しているプロセス管理テーブ
ル10内のカウンタ13の値を1減らす(151)。そ
の結果、カウンタ13の値が正の値ならば、そのまま処
理を終了する(152)。0又は負の値になったなら
ば、アボート禁止フラグをOFFにする(153)。次
に、プロセス管理テーブル10内のアボート要求フラグ
11を調べる(154)。OFFならば処理を終了す
る。ONならばプロセス管理部20が起動し、プロセス
200のアボート処理に入る(155)。
FIG. 6 is a flowchart showing in detail the internal processing of the abort inhibition release procedure 109 in FIG. The process of FIG. 6 is performed by the abort inhibition release function 22 shown in FIG. First, the abort prohibition canceling function 22 counts the value of the nest of the function (described later) passed as the first argument
A check is made to see if the value matches the value (step 150). If they do not match, abnormal processing is performed. If they match, the value of the counter 13 in the process management table 10 managing the process 200 is decremented by 1 (151). As a result, if the value of the counter 13 is a positive value, the process ends as it is (152). When it becomes 0 or a negative value, the abort prohibition flag is turned off (153). Next, the abort request flag 11 in the process management table 10 is checked (154). If it is OFF, the process ends. If it is ON, the process management unit 20 is started and the abort process of the process 200 is started (155).

【0030】また、図6において、アボート要求フラグ
11がOFFの状態で処理が終了した場合、プロセス管
理部20はプリエンプト禁止部30内のスケジューラ3
1を起動し、プロセスの再スケジューリングを行う。
In FIG. 6, when the process ends with the abort request flag 11 being OFF, the process management unit 20 sets the scheduler 3
1 and reschedule the process.

【0031】図1において、アボート禁止フラグ12が
ONになっている間、すなわち、アボート禁止関数21
が呼び出されてアボート禁止フラグ12がONにされて
から、アボート禁止解除関数22が呼び出されてアボー
ト禁止フラグ12がOFFにされるまでの間がアボート
禁止区間となる。アボート禁止フラグ12はプロセス生
成時にはOFFになっており、アボート禁止関数21が
呼び出されることによって初めてONになる。プロセス
200がアボート禁止関数21を呼び出してアボート禁
止フラグ12をONにした後、アボート禁止区間内、す
なわち、アボート禁止フラグ12がONになっている間
にプロセス200の強制終了が発生した場合、プロセス
管理部20はアボート要求フラグ11をONにする処理
だけを行い、プロセス200の処理は続行させる。そし
て、プロセス200がアボート禁止解除関数22を呼び
出してアボート禁止フラグをOFFにした時に、プロセ
ス200の強制終了を行う。
In FIG. 1, while the abort inhibition flag 12 is ON, that is, the abort inhibition function 21
Is called and the abort prohibition flag 12 is turned on, and the abort prohibition release function 22 is called and the abort prohibition flag 12 is turned off. The abort prohibition flag 12 is OFF when a process is generated, and is turned ON only when the abort prohibition function 21 is called. After the process 200 calls the abort prohibition function 21 to turn on the abort prohibition flag 12, if the process 200 is forcibly terminated in the abort prohibition section, that is, while the abort prohibition flag 12 is on, The management unit 20 performs only the process of turning on the abort request flag 11, and continues the process of the process 200. Then, when the process 200 calls the abort prohibition release function 22 and turns off the abort prohibition flag, the process 200 is forcibly terminated.

【0032】また、図1において、プリエンプト禁止フ
ラグ35がONになっている間、すなわち、プリエンプ
ト禁止関数32が呼び出されてプリエンプト禁止フラグ
35がONにされてから、プリエンプト禁止解除関数3
3が呼び出されてプリエンプト禁止フラグ35がOFF
にされるまでの間がプリエンプト禁止区間となる。プリ
エンプト禁止フラグ35はシステム起動時にはOFFに
なっており、プリエンプト禁止関数32が呼び出される
ことによって初めてONになる。プロセス200がプリ
エンプト禁止関数32を呼び出してプリエンプト禁止フ
ラグをONにした後、プリエンプト禁止フラグ35がO
Nになっている間に他のプロセスへのスケジューリング
要求が発生した場合、スケジューラ31はスケジューリ
ング要求フラグ34をONにする処理だけを行い、他の
プロセスのスケジューリングは行わず、プロセス200
の処理を続行させる。そして、プロセス200がプリエ
ンプト禁止解除関数33を呼び出してプリエンプト禁止
フラグ35をOFFにした時に、スケジューラ31はス
ケジューリング要求フラグをOFFにし、プロセス20
0の実行を中断させ、他のプロセスをスケジュールす
る。
In FIG. 1, while the preemption inhibition flag 35 is ON, that is, after the preemption inhibition function 32 is called and the preemption inhibition flag 35 is turned ON, the preemption inhibition release function 3
3 is called and the preemption inhibition flag 35 is turned off
The period until the time is set to the preemption prohibited section. The preemption prohibition flag 35 is OFF when the system is started, and is turned ON only when the preemption prohibition function 32 is called. After the process 200 calls the preemption prohibition function 32 and turns on the preemption prohibition flag, the preemption prohibition flag 35 is turned off.
If a scheduling request to another process occurs during the period of N, the scheduler 31 performs only the process of turning on the scheduling request flag 34, does not perform scheduling of the other process, and executes the process 200.
Processing is continued. Then, when the process 200 calls the preemption prohibition release function 33 and turns off the preemption prohibition flag 35, the scheduler 31 turns off the scheduling request flag and sets the process 20
0 execution is interrupted and another process is scheduled.

【0033】図2において、102〜104及び106
〜108の間はプリエンプト禁止区間となり、CPU使用
権が他のプロセスへ移ることはないので、共有資源を使
用するのは走行中のプロセスだけとなる。したがって、
他のプロセスが共有資源を使用することはなく、資源の
排他処理が実現でき、共有資源を使用する連続メディア
処理のマルチプロセシングを行うことができる。また、
101〜109の間はアボート禁止区間となるため、強
制終了によってプロセスが資源を獲得したまま消滅し、
資源が永久に使用不能になることもない。
In FIG. 2, 102-104 and 106
Since the period from to 108 is a preemption prohibited section and the CPU usage right is not transferred to another process, only the running process uses the shared resource. Therefore,
Other processes do not use the shared resource, exclusive processing of the resource can be realized, and multi-processing of continuous media processing using the shared resource can be performed. Also,
Since the abort section is prohibited between 101 and 109, the process disappears while acquiring the resources due to the forced termination.
Resources are never permanently unavailable.

【0034】アボート禁止、アボート禁止解除は、それ
ぞれ以下のインタフェースにより行う。
Abort prohibition and cancellation of abort prohibition are performed by the following interfaces.

【0035】<関数名> abort_disable(*level) <引数> level:本関数と関数abort_enableで形成される対のネ
ストの深さが返される。
<Function name> abort_disable (* level) <Argument> level: The depth of the nest of a pair formed by this function and the function abort_enable is returned.

【0036】<説明>本関数は、実行中のプロセスをア
ボート禁止状態に遷移させる。本関数を発行してアボー
ト禁止状態に遷移してから関数abort_enalbeを発行して
アボート可能状態に復帰するまでの区間で、本関数と関
数abort_enableを対にして発行してもよい。すなわち、
本関数と関数abort_enableの対はネスト可能である。ネ
ストの内側で発行される本関数と関数abort_enableで
は、アボート禁止状態とアボート可能状態との間の状態
遷移は行わない。引数levelには、このネストの深さが
返る。
<Explanation> This function changes the running process to the abort prohibited state. This function and the function abort_enable may be issued as a pair in the interval from issuing this function to transition to the abort disabled state to issuing the function abort_enalbe and returning to the abort enabled state. That is,
The pair of this function and the function abort_enable can be nested. With this function and the function abort_enable issued inside the nest, the state transition between the abort disabled state and the abort enabled state is not performed. The argument level returns the depth of this nesting.

【0037】<関数名> abort_enable(level) <引数> level:本関数と対になる関数abort_disableが返したネ
スト・レベルを指定する。
<Function name> abort_enable (level) <Argument> level: Specifies the nesting level returned by the function abort_disable that is paired with this function.

【0038】<説明>本関数は、実行中のプロセスをア
ボート可能状態に復帰させる。関数abort_disableを発
行してアボート禁止状態に遷移してから本関数を発行し
てアボート可能状態に復帰するまでの区間で、関数abor
t_disableと本関数を対にして発行してもよい。すなわ
ち、関数abort_disableと本関数の対はネスト可能であ
る。ネストの内側で発行される関数abort_disableと本
関数では、アボート禁止状態とアボート可能状態との間
の状態遷移は行わない。引数levelには、このネストの
深さ、すなわち対となる関数abort_disableの発行によ
り得られたlevelの値を指定する。オペレーティング・
システム側でもこの値を保持しており、引数で指定され
たネストの深さと一致しない場合、エラーリターンす
る。
<Explanation> This function returns the running process to the abortable state. In the interval from issuing the function abort_disable to change to the abort disabled state and issuing this function to return to the abort enabled state, the function abor
t_disable and this function may be issued in pairs. That is, the pair of the function abort_disable and this function can be nested. The function abort_disable issued inside the nest and this function do not change the state between the abort disabled state and the abort enabled state. The argument level specifies the depth of this nesting, that is, the value of level obtained by issuing the paired function abort_disable. operating·
The system also holds this value. If the value does not match the nesting depth specified by the argument, an error return is returned.

【0039】プロセス200内の関数40がアボート禁
止関数21を使用する際には、アボート禁止関数21よ
り返される現在のネストの深さを自関数内の作業領域2
3に格納する。そして、アボート禁止解除関数22を発
行する際に、その作業領域に格納されている値を同関数
の引数として指定する。アボート禁止解除関数では、こ
の値と現在のネストの深さを比較し、両者が一致しない
場合はエラーリターンする。この機能により、アボート
禁止関数と対になるべきアボート禁止解除関数が存在し
ないというプログラムミスを容易に検出することができ
る。
When the function 40 in the process 200 uses the abort prohibition function 21, the current nest depth returned from the abort prohibition function 21 is set to the work area 2 in its own function.
3 is stored. Then, when issuing the abort prohibition release function 22, the value stored in the work area is specified as an argument of the function. The abort prohibition cancel function compares this value with the current nesting depth, and returns an error if they do not match. With this function, it is possible to easily detect a program error that there is no abort prohibition cancel function to be paired with the abort prohibition function.

【0040】また、プリエンプト禁止、プリエンプト禁
止解除の処理は、特願平8−97997において発明さ
れているプリエンプト禁止、プリエンプト禁止解除のイ
ンタフェースを使用して行う。すなわち、次のインタフ
ェースを使用する。
Further, the preemption prohibition and the preemption prohibition release processing are performed using the preemption prohibition and preemption prohibition release interface invented in Japanese Patent Application No. 8-97997. That is, the following interface is used.

【0041】<関数名> preempt_disable(*level ) <引数> level:本関数と関数 preempt_enable で形成される対
のネストの深さが返される。
<Function Name> preempt_disable (* level) <Argument> level: The nesting depth of the pair formed by this function and the function preempt_enable is returned.

【0042】<説明>本関数は実行中タスクをプリエン
プト禁止状態に遷移させる。本関数を発行しプリエンプ
ト禁止状態に遷移してから、関数 preempt_enable を発
行してプリエンプト可能状態に復帰するまでの区間で、
本関数と関数preempt_enableを対にして発行しても良
い。すなわち、本関数と関数 preempt_enable の対はネ
スト可能である。ネストの内側で発行される本関数と関
数 preempt_enable は、プリエンプト禁止状態とプリエ
ンプト可能状態との間の状態遷移は行なわない。level
には、このネストの深さが返る。
<Explanation> This function changes the running task to the preemption disabled state. In the interval from issuing this function and transiting to the preemption disabled state until issuing the function preempt_enable and returning to the preemption enabled state,
This function and the function preempt_enable may be issued as a pair. That is, the pair of this function and the function preempt_enable can be nested. This function and the function preempt_enable issued inside the nest do not change the state between the preemption disabled state and the preemption enabled state. level
Returns the nesting depth.

【0043】<関数名> preempt_enable(level) <引数> level:本関数と対となる関数 preempt_disable が返し
たネスト・レベルを指定する。
<Function Name> preempt_enable (level) <Argument> level: Specifies the nesting level returned by the function preempt_disable that is paired with this function.

【0044】<説明>本関数は実行中タスクをプリエン
プト可能状態に復帰させる。関数 preempt_disable を
発行しプリエンプト禁止状態に遷移してから、本関数を
発行してプリエンプト可能状態に復帰するまでの区間
で、関数 preempt_disable と本関数を対にして発行し
ても良い。すなわち、関数 preempt_disable と本関数
の対はネスト可能である。ネストの内側で発行される関
数 preempt_disable と本関数は、プリエンプト禁止状
態とプリエンプト可能状態との間の状態遷移は行なわな
い。level には、このネストの深さ、すなわち対となる
関数 preempt_enable の発行により得られた level の
値を指定する。カーネルもこのネストの深さを保持して
おり、引数で指定されたネストの深さと一致しない場合
には、エラーリターンする。
<Explanation> This function returns the running task to the preemptible state. The function preempt_disable and this function may be issued as a pair during the period from issuing the function preempt_disable and transitioning to the preemption disabled state until issuing this function and returning to the preemption enabled state. That is, the pair of the function preempt_disable and this function can be nested. The function preempt_disable and this function issued inside the nest do not change the state between the preemption disabled state and the preemption enabled state. For level, specify the depth of this nesting, that is, the value of level obtained by issuing the paired function preempt_enable. The kernel also holds this nesting depth, and returns an error if it does not match the nesting depth specified by the argument.

【0045】プロセス200内の関数40がプリエンプ
ト禁止関数31を使用する際には、プリエンプト禁止関
数31より返される現在のネストの深さを自関数内の作
業領域37に格納する。そして、プリエンプト禁止解除
関数32を発行する際に、その作業領域に格納されてい
る値を同関数の引数として指定する。プリエンプト禁止
解除関数では、この値と現在のネストの深さを比較し、
両者が一致しない場合はエラーリターンする。この機能
により、プリエンプト禁止関数と対になるべきプリエン
プト禁止解除関数が存在しないというプログラムミスを
容易に検出することができる。
When the function 40 in the process 200 uses the preemption prohibition function 31, the current depth of the nest returned from the preemption prohibition function 31 is stored in the work area 37 in the own function. Then, when issuing the preemption prohibition release function 32, the value stored in the work area is specified as an argument of the function. The preemption disable function compares this value with the current nesting depth,
If they do not match, an error is returned. With this function, it is possible to easily detect a program error that there is no preemption prohibition cancel function to be paired with the preemption prohibition function.

【0046】次に、共有資源の使用時間が長い場合の、
共有資源を使用するプロセスの実行方法の実施形態につ
いて説明する。
Next, when the use time of the shared resource is long,
An embodiment of a method of executing a process using a shared resource will be described.

【0047】このプロセス実行方法の実施形態では、周
期駆動を行うプロセスは、周期駆動開始前の周期駆動を
行っていない状態の時に、次に説明するプロセス実行方
法を用いて必要な資源の獲得等を行い、その処理が完了
した後、自プロセスの周期駆動を開始する。周期駆動開
始後は、次に説明するプロセス実行方法では資源の獲得
は行わない。
In this embodiment of the process execution method, the process for performing the periodic driving is to acquire necessary resources by using the process execution method described below when the periodic driving is not performed before the start of the periodic driving. After the processing is completed, the periodic driving of the own process is started. After the start of periodic driving, resources are not obtained in the process execution method described below.

【0048】本発明に必要なモジュール群を図7に示
す。
FIG. 7 shows a module group required for the present invention.

【0049】図7において210〜212は共有資源を
使用したいプロセスであり、220は特定の共有資源に
処理を行うことができる唯一のプロセスである。このプ
ロセスを以下逐次化プロセスと呼ぶ。逐次化プロセス2
20はシステム内に常駐している。300はプロセス2
10〜212の処理要求を逐次化プロセス220に通知
するための処理要求通知部であり、逐次化プロセス22
0に対してただ1個だけ存在し、逐次化プロセス220
と同様常にシステム内に常駐している。310〜312
はプロセス220からの処理完了通知をプロセス210
〜212に通知するための処理完了通知部であり、プロ
セス210〜212の生成時、または処理要求の発生時
に割り当てられる。処理要求通知部300及び処理完了
通知部310〜312はそれぞれ内部に待ち行列40
0、410〜412を持っている。
In FIG. 7, reference numerals 210 to 212 denote processes that want to use a shared resource, and reference numeral 220 denotes the only process that can perform processing on a specific shared resource. This process is hereinafter referred to as a serialization process. Serialization process 2
20 resides in the system. 300 is process 2
A processing request notification unit for notifying the serialization process 220 of the processing requests 10 to 212;
There is only one for 0 and the serialization process 220
As always, it resides in the system. 310-312
Sends a processing completion notification from the process 220 to the process 210
A process completion notification unit for notifying the processes 210 to 212, which is assigned when the processes 210 to 212 are generated or when a process request is generated. The processing request notification unit 300 and the processing completion notification units 310 to 312 each have a queue 40 inside.
0, 410-412.

【0050】次に、図7の処理を図8〜11のフローチ
ャートを使って説明する。
Next, the processing of FIG. 7 will be described with reference to the flowcharts of FIGS.

【0051】図8は、共有資源に対する処理を必要とす
るプロセス210〜212の処理を説明したフローチャ
ートである。プロセス210〜212はその共有資源に
処理を行うことができるプロセス220に処理を要求す
るため、処理要求通知部300に処理要求の通知を行う
(160)。通知終了後、通知を行ったプロセス210
〜212は直ちに処理完了受理待ちになる(161)。
処理完了通知部310〜312から処理完了が通知され
たら(161)、処理完了通知部310〜312内の待
ち行列410〜412から処理終了通知を受理し(16
2)、共有資源に対する処理を終了する。
FIG. 8 is a flowchart illustrating the processes of processes 210 to 212 that require a process for a shared resource. The processes 210 to 212 notify the processing request notifying unit 300 of the processing request in order to request the processing from the process 220 capable of performing processing on the shared resource (160). After the notification is completed, the process 210 that has performed the notification
.About.212 immediately wait for processing completion acceptance (161).
When the processing completion is notified from the processing completion notification units 310 to 312 (161), the processing completion notification is received from the queues 410 to 412 in the processing completion notification units 310 to 312 (16).
2) End the processing for the shared resource.

【0052】図9は、処理要求通知部300の処理を説
明したフローチャートである。処理要求通知部300は
常に処理要求通知の受信待ちになっている(171)。
そして、処理要求の通知を受け取ったら(170)、受
け付け順に処理要求を待ち行列400に入れ(17
1)、処理要求が発生したことをプロセス220に通知
する(172)。
FIG. 9 is a flowchart for explaining the processing of the processing request notification unit 300. The processing request notification unit 300 is always waiting to receive a processing request notification (171).
When the notification of the processing request is received (170), the processing requests are put into the queue 400 in the order of reception (17).
1) The process 220 is notified that a processing request has occurred (172).

【0053】図10は、共有資源に処理を行うことがで
きる逐次化プロセス220の処理を説明したフローチャ
ートである。逐次化プロセス220も処理要求通知部3
00と同様、常に処理要求通知の受信待ちになっている
(180)。処理要求通知部300から処理要求発生の
通知を受けると(180)、処理要求通知部300内の
待ち行列400から処理要求を受理し(181)、要求
に応じた共有資源に対する処理を行う(182)。処理
終了後、プロセス220は処理を要求したプロセス21
0〜212の処理完了通知部310〜312に処理完了
及び処理結果の通知を行う(183)。逐次化プロセス
220は、次の要求が通知されているかを調べ、通知さ
れている場合は次の要求処理を行う。通知がない場合は
次の要求受理待ちになる(180)。
FIG. 10 is a flowchart illustrating the processing of the serialization process 220 that can perform processing on the shared resource. The serialization process 220 is also the processing request notification unit 3
Similar to 00, the process request notification is always waiting (180). When a notification of the occurrence of a processing request is received from the processing request notifying unit 300 (180), a processing request is received from the queue 400 in the processing request notifying unit 300 (181), and processing is performed on the shared resource corresponding to the request (182). ). After the processing is completed, the process 220 is executed by the process 21
The completion of the processing and the processing result are notified to the processing completion notifying sections 310 to 312 of 0 to 212 (183). The serialization process 220 checks whether the next request has been notified, and if so, performs the next request processing. If there is no notification, the next request is awaited (180).

【0054】図11は、処理完了通知部310〜312
の処理を説明したフローチャートである。処理完了通知
部310〜312は、プロセス210〜212が処理要
求を発行したと同時に完了通知受信待ちになる(19
0)。そして、逐次化プロセス220から処理完了を受
信したら(190)、受理した処理完了通知と処理結果
を待ち行列410〜412に入れ(191)、プロセス
210〜212に処理完了を通知する(192)。
FIG. 11 shows the processing completion notifying sections 310 to 312.
5 is a flowchart illustrating the process of FIG. The processing completion notification units 310 to 312 wait for completion notification reception at the same time as the processes 210 to 212 issue the processing request (19).
0). Then, when the processing completion is received from the serialization process 220 (190), the received processing completion notification and the processing result are put into the queues 410 to 412 (191), and the processes 210 to 212 are notified of the processing completion (192).

【0055】図7の例では、共有資源の処理を要求する
プロセスが3個であったが、2個以下または4個以上の
場合でも処理は同じである。
In the example of FIG. 7, the number of processes requesting the processing of the shared resource is three. However, the processing is the same even when the number of processes is two or less or four or more.

【0056】図7における逐次化プロセス220は常に
プリエンプト可能状態のまま動作する。
The serialization process 220 in FIG. 7 always operates in a preemptable state.

【0057】また、プロセス210〜212は、上記の
処理(図8)を周期駆動開始前、すなわち、周期駆動に
関係のない状態の時に行い、上記処理の完了によって資
源の獲得等が完了した後、周期駆動を開始させる。
The processes 210 to 212 perform the above-described processing (FIG. 8) before the start of the periodic driving, that is, in a state irrelevant to the periodic driving. , To start periodic driving.

【0058】上記のような逐次化プロセスによるプロセ
ス実行方法を用いると、共有資源に直接処理を行うプロ
セスが逐次化プロセスただ1個であるため、共有資源の
排他制御を行う必要がない。また、共有資源に対する処
理を専用の独立したプリエンプト可能なプロセスが行う
ため、他の連続メディア処理を行うプロセスの周期駆動
性に影響を与えないプロセス実行が可能である。
When the process execution method based on the serialization process as described above is used, there is no need to perform exclusive control of the shared resource because only one serialization process directly processes the shared resource. In addition, since the process for the shared resource is performed by a dedicated and independent preemptable process, it is possible to execute a process that does not affect the periodic drive of another process that performs continuous media processing.

【0059】[0059]

【発明の効果】以上述べたように、本発明によれば、共
有資源を使用するマルチプロセシングの環境において、
連続メディア処理等を行うプロセスの周期駆動性に影響
を与えずに、プロセス間で共有資源を使用できる。
As described above, according to the present invention, in a multiprocessing environment using shared resources,
A shared resource can be used between processes without affecting the periodic driving of the process for performing continuous media processing or the like.

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

【図1】本発明に関わるモジュール群、及びデータの構
成図である。
FIG. 1 is a configuration diagram of a module group and data according to the present invention.

【図2】図1の実施例の処理手順を示すフローチャート
である。
FIG. 2 is a flowchart showing a processing procedure of the embodiment of FIG.

【図3】図1におけるアボート禁止関数21の処理手順
を示すフローチャートである。
FIG. 3 is a flowchart showing a processing procedure of an abort prohibition function 21 in FIG.

【図4】図1におけるプリエンプト禁止関数31の処理
手順を示すフローチャートである。
FIG. 4 is a flowchart showing a processing procedure of a preemption prohibition function 31 in FIG. 1;

【図5】図1におけるプリエンプト禁止解除関数32の
処理手順を示すフローチャートである。
FIG. 5 is a flowchart showing a processing procedure of a preemption prohibition canceling function 32 in FIG. 1;

【図6】図1におけるアボート禁止解除関数22の処理
手順を示すフローチャートである。
FIG. 6 is a flowchart showing a processing procedure of an abort inhibition release function 22 in FIG. 1;

【図7】他の実施形態に関わるモジュール群の構成図で
ある。
FIG. 7 is a configuration diagram of a module group according to another embodiment.

【図8】図7におけるプロセス210〜212の処理手
順を示すフローチャートである。
8 is a flowchart showing a processing procedure of processes 210 to 212 in FIG.

【図9】図7における処理要求通知部300の処理手順
を示すフローチャートである。
FIG. 9 is a flowchart illustrating a processing procedure of a processing request notifying unit 300 in FIG. 7;

【図10】図7における逐次化スレッド220の処理手
順を示すフローチャートである。
FIG. 10 is a flowchart illustrating a processing procedure of a serialization thread 220 in FIG. 7;

【図11】図7における処理完了通知部310〜312
の処理手順を示すフローチャートである。
FIG. 11 is a processing completion notifying unit 310 to 312 in FIG.
6 is a flowchart showing the processing procedure of FIG.

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

10……プロセス管理テーブル、11……アボート要求
フラグ、12……アボート禁止フラグ、20……プロセ
ス管理部、21……アボート禁止関数、22……アボー
ト禁止解除関数、30……プリエンプト制御部、31…
…スケジューラ、32……プリエンプト禁止関数、33
……プリエンプト禁止解除関数、34……スケジューリ
ング要求フラグ、35……プリエンプト禁止フラグ、2
20……逐次化プロセス
10 process management table, 11 abort request flag, 12 abort prohibition flag, 20 process management unit, 21 abort prohibition function, 22 abort prohibition release function, 30 preempt control unit, 31 ...
... scheduler, 32 ... preemption prohibition function, 33
... Preemption prohibition release function, 34... Scheduling request flag, 35... Preemption prohibition flag, 2
20 .... Serialization process

───────────────────────────────────────────────────── フロントページの続き (72)発明者 中野 隆裕 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 (72)発明者 芹沢 一 神奈川県川崎市麻生区王禅寺1099番地 株 式会社日立製作所システム開発研究所内 ──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Takahiro Nakano 1099 Ozenji Temple, Aso-ku, Kawasaki City, Kanagawa Prefecture Inside the Hitachi, Ltd.System Development Laboratory (72) Inventor Kazuto Serizawa 1099 Ozenji Temple, Aso-ku, Kawasaki City, Kanagawa Prefecture Stock Company Hitachi, Ltd. System Development Laboratory

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】複数のプロセスが並列に動作する計算機シ
ステムにおいて、共有資源を獲得し、資源を操作し、資
源を解放するプロセスの実行方法であって、 前記プロセスをアボート禁止にするとともにプリエンプ
ト禁止にした後、当該プロセスが使用する共有資源を獲
得し、 当該プロセスのプリエンプト禁止を解除するとともに共
有資源の操作を行った後、当該プロセスをプリエンプト
禁止にし、 当該プロセスが前記共有資源を解放した後、当該プロセ
スのプリエンプト禁止を解除するとともにアボート禁止
を解除し、 アボート禁止中に発生した当該プロセスの強制終了要求
をアボート禁止解除後に実行することを特徴とするプロ
セスの実行方法。
1. A method for executing a process of acquiring a shared resource, operating a resource, and releasing a resource in a computer system in which a plurality of processes operate in parallel, wherein the process is prohibited from being aborted and the preemption is prohibited. After obtaining the shared resources used by the process, canceling the preemption prohibition of the process and operating the shared resources, disabling the process preemption, and releasing the shared resources by the process A method of canceling the preemption prohibition of the process and canceling the abort prohibition, and executing a forced termination request of the process generated during the abort prohibition after the cancellation of the abort prohibition.
【請求項2】共有資源の操作を行うプロセスの実行完了
後、当該プロセスに関連する処理を周期的に駆動するマ
ルチプロセシング環境の計算機システムにおけるプロセ
スの実行方法であって、 前記共有資源の操作を要求するプロセスのキューを設
け、 前記共有資源に対する処理を要求する前記キューの先頭
のプロセスをマルチプロセシング環境で実行し、 前記プロセスの実行完了後、当該プロセスに関連する処
理を周期的に駆動すると共に、前記キューに登録された
プロセスを順次実行することを特徴とするプロセスの実
行方法。
2. A method of executing a process in a computer system in a multi-processing environment that periodically drives a process related to the process after the execution of the process for operating the shared resource is completed. Providing a queue of a requesting process, executing a process at the head of the queue requesting a process for the shared resource in a multi-processing environment, and after completion of the execution of the process, periodically driving a process related to the process. And sequentially executing the processes registered in the queue.
JP22640496A 1996-08-28 1996-08-28 How to run the process Expired - Lifetime JP3724075B2 (en)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP22640496A JP3724075B2 (en) 1996-08-28 1996-08-28 How to run the process
EP97114394A EP0834806B1 (en) 1996-08-28 1997-08-20 Process executing method and resource accessing method in computer system
CA002213371A CA2213371C (en) 1996-08-28 1997-08-20 Process executing method and resource accessing method in computer system
DE69738646T DE69738646T2 (en) 1996-08-28 1997-08-20 Method for carrying out a process and resource access method in a computer system
US08/917,477 US6253225B1 (en) 1996-08-28 1997-08-26 Process executing method and resource accessing method in computer system
US09/838,767 US6848102B2 (en) 1996-08-28 2001-04-20 Process executing method and resource accessing method in computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22640496A JP3724075B2 (en) 1996-08-28 1996-08-28 How to run the process

Publications (2)

Publication Number Publication Date
JPH1069392A true JPH1069392A (en) 1998-03-10
JP3724075B2 JP3724075B2 (en) 2005-12-07

Family

ID=16844596

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22640496A Expired - Lifetime JP3724075B2 (en) 1996-08-28 1996-08-28 How to run the process

Country Status (1)

Country Link
JP (1) JP3724075B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006127524A (en) * 2004-10-29 2006-05-18 Internatl Business Mach Corp <Ibm> Method, device and program for managing access to physical resource
US7191443B2 (en) 2001-01-25 2007-03-13 Matsushita Electric Industrial Co., Ltd. Digital device, task management method and program therefor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7191443B2 (en) 2001-01-25 2007-03-13 Matsushita Electric Industrial Co., Ltd. Digital device, task management method and program therefor
EP2256631A2 (en) 2001-01-25 2010-12-01 Panasonic Corporation Task management device, method and program therefor
JP2006127524A (en) * 2004-10-29 2006-05-18 Internatl Business Mach Corp <Ibm> Method, device and program for managing access to physical resource

Also Published As

Publication number Publication date
JP3724075B2 (en) 2005-12-07

Similar Documents

Publication Publication Date Title
Brandenburg Multiprocessor real-time locking protocols
CA2213371C (en) Process executing method and resource accessing method in computer system
JP2650965B2 (en) Computer system and task scheduling method thereof
JP2866241B2 (en) Computer system and scheduling method
US8612982B2 (en) Multi-tasking method according to simple priority inheritance scheme and embedded system therefor
JP3318455B2 (en) Method and system for managing ownership of a released synchronization mechanism
US20080072228A1 (en) System and method for delayed priority boost
JP5347451B2 (en) Multiprocessor system, conflict avoidance program, and conflict avoidance method
JP3717951B2 (en) Deadlock avoidance system and method
JPH0468461A (en) Resource management system
JPH11212810A (en) Time quantum sharing method and apparatus
US9792419B2 (en) Starvationless kernel-aware distributed scheduling of software licenses
JPH1069392A (en) How the process runs
CN111989651B (en) Method and device for managing kernel service in multi-core system
JP2597283B2 (en) Scheduling method for interrupt
Bordoloi Scheduling with shared resources
US20130042247A1 (en) Starvationless Kernel-Aware Distributed Scheduling of Software Licenses
Wu et al. Response Time Analysis of CIL-EDF Scheduling for ROS2 Multi-Threaded Executors
JP2001256065A (en) Exclusive control method and computer system
CN119576489A (en) A task running method, device, equipment and storage medium
JP2023091314A (en) Semiconductor device, semiconductor device control method and program
JPH05233561A (en) Shared resources control system
Stankovic et al. EDF Scheduling for Shared Resources
JPH1063514A (en) Information processor
JPH064323A (en) Multiprocessor system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041108

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041221

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050221

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050830

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050912

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080930

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090930

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090930

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100930

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110930

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120930

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130930

Year of fee payment: 8

EXPY Cancellation because of completion of term