JP2000194573A - System and method for thread control - Google Patents

System and method for thread control

Info

Publication number
JP2000194573A
JP2000194573A JP10367838A JP36783898A JP2000194573A JP 2000194573 A JP2000194573 A JP 2000194573A JP 10367838 A JP10367838 A JP 10367838A JP 36783898 A JP36783898 A JP 36783898A JP 2000194573 A JP2000194573 A JP 2000194573A
Authority
JP
Japan
Prior art keywords
thread
value
priority
execution
execution priority
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
JP10367838A
Other languages
Japanese (ja)
Inventor
Takeshi Watakabe
健 渡壁
Yoshiro Hasegawa
義朗 長谷川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP10367838A priority Critical patent/JP2000194573A/en
Publication of JP2000194573A publication Critical patent/JP2000194573A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a thread control system which actively switches threads at intervals shorter than time slices of a computer system. SOLUTION: An execution priority setting part 202 has a function of resetting the execution priority of a specified thread in an executable state to a 1st value and a wait priority setting part 203 has a function of resetting the execution priority to a 2nd value lower than the 1st value. Then a schedule part 201 selects a thread to be executed next at each interval shorter than a time slice of the operating system 100, and resets the execution priority of the thread in an executed state to the 2nd value by using the wait priority setting part 230 and the execution priority of the selected thread to the 1st value by using the execution priority setting part 202, thereby making a thread management part 101 to switch the selected thread.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、CPUを割り当
てる際の制御単位となるスレッドに付与される実行優先
度を固定的に指定可能なオペレーティングシステム下で
動作するスレッド制御システムおよび同システムに適用
されるスレッド制御方法に係り、特に、オペレーティン
グシステムのタイムスライスよりも短い間隔でスレッド
の切り換えを発生させ、かつ、オペレーティングシステ
ムが受け付け可能な段階数よりも多くの段階数をもつ独
自の実行優先度をスレッドに付与することを可能とする
スレッド制御システムおよびスレッド制御方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention is applied to a thread control system operating under an operating system that can fixedly designate an execution priority given to a thread as a control unit when allocating a CPU, and to the thread control system. In particular, thread switching occurs at intervals shorter than the operating system time slice, and has its own execution priority that has more stages than the operating system can accept. The present invention relates to a thread control system and a thread control method that can be assigned to a thread.

【0002】[0002]

【従来の技術】近年、コンピュータの普及は目覚まし
く、様々なコンピュータシステムが開発されている。こ
れらのコンピュータシステムでは、CPUがプログラム
を実行制御することによりデータ処理を行なうが、複数
のデータ処理を公平かつ適切な順序で実行制御していく
ために、オペレーティングシステムがスレッド管理(ス
ケジューリング)を行なっている。
2. Description of the Related Art In recent years, the spread of computers has been remarkable, and various computer systems have been developed. In these computer systems, the CPU performs data processing by controlling the execution of a program, and the operating system performs thread management (scheduling) in order to control the execution of a plurality of data processing in a fair and appropriate order. ing.

【0003】スレッドとは、オペレーティングシステム
がプログラムにCPUを割り当てる際の制御単位となる
ものであり、オペレーティングシステムは、スレッドそ
れぞれに付与された実行優先度に基づき、タイムスライ
スなどと称される所定の間隔ごとにCPUを割り当てる
スレッドを切り換える。
A thread is a control unit when the operating system allocates a CPU to a program. The operating system determines a predetermined time called a time slice or the like based on the execution priority assigned to each thread. The thread to which the CPU is assigned is switched at each interval.

【0004】[0004]

【発明が解決しようとする課題】ところで、このオペレ
ーティングシステムによるスレッドの切り換えは、実行
状態にあるスレッドが実行権を放棄したとき、または、
タイムスライスが尽きたときにのみ実施されるものであ
り、また、イベント待ちが解けたスレッドと実行中のス
レッドとが同じ実行優先度であった場合に、直ちにイベ
ント待ちが解けたスレッドに切り換えるか否かは、オペ
レーティングシステムそれぞれの設計思想に依存してい
た。
By the way, thread switching by the operating system is performed when a thread in the execution state relinquishes the execution right, or
This is executed only when the time slice has expired, and if the thread that has released the event wait and the executing thread have the same execution priority, immediately switches to the thread that has released the event wait. Whether or not it depends on the design concept of each operating system.

【0005】したがって、イベント待ちが解けたスレッ
ドが実行権を得るのに、場合によっては、次回以降のス
ケジューリングを待たなければならず、長時間実行権を
得られない虞があるといった問題があった。
[0005] Therefore, there is a problem that, in some cases, the thread that has been released from waiting for an event obtains the execution right, and in some cases, must wait for the next and subsequent schedulings, and the execution right may not be obtained for a long time. .

【0006】また、オペレーティングシステムが受け付
け可能な実行優先度の段階数が少ない場合には、スレッ
ドへの実行優先度の付与を考慮しなければならないアプ
リケーションプログラムの実装が非常に困難になるとい
った問題があった。
In addition, when the number of execution priority levels that can be accepted by the operating system is small, there is a problem that it is very difficult to implement an application program that must consider giving execution priority to threads. there were.

【0007】これらの点を考慮すると、既存のオペレー
ティングシステム下においても、独自のスレッド切り換
え制御を実行することにより、同一優先度のスレッドに
は短い間隔で公平に、また、イベント待ちが解けたスレ
ッドには優先的に実行権を与えることを可能とすること
が望まれ、さらに、実行優先度の段階数もオペレーティ
ングシステムの制限にとらわれずに自由に設定すること
を可能とすることが望まれる。
In consideration of these points, even under the existing operating system, by executing the unique thread switching control, the threads of the same priority can be impartially distributed at short intervals, and the threads whose event wait has been released can be released. It is desirable to be able to give execution rights preferentially, and also to be able to freely set the number of stages of execution priority without being restricted by the operating system.

【0008】この発明はこのような実情を考慮してなさ
れたものであり、コンピュータシステムのタイムスライ
スよりも短い間隔でスレッドの切り換えを発生させ、か
つ、コンピュータシステムが受け付け可能な段階数より
も多くの段階数をもつ独自の実行優先度をスレッドに付
与することを可能とするスレッド制御システムを提供す
ることを目的とする。
The present invention has been made in view of such circumstances, and causes thread switching to occur at intervals shorter than the time slice of the computer system, and to increase the number of stages that can be accepted by the computer system. It is an object of the present invention to provide a thread control system capable of assigning a unique execution priority having a number of stages to a thread.

【0009】[0009]

【課題を解決するための手段】前述した目的を達成する
ために、この発明は、オペレーティングシステムが管理
する実行優先度の中のいずれか2つの値を利用し、実行
状態にあるスレッドの実行優先度を2つの値の中の低い
方の値に設定し直すとともに、次に実行すべき実行可能
状態にあるスレッドの実行優先度を2つの値の中の高い
方の値に設定し直すことにより、オペレーティングシス
テムによるスレッドの切り換えを能動的に発生させるよ
うにしたものである。
In order to achieve the above-mentioned object, the present invention utilizes any two of the execution priorities managed by an operating system to execute a thread in an execution state. By resetting the degree to the lower of the two values, and resetting the execution priority of the next executable thread to be executed to the higher of the two values. , The thread switching by the operating system is actively generated.

【0010】この発明によれば、オペレーティングシス
テムのタイムスライスよりも短い間隔で実行優先度の再
設定を行なうことにより、既存のオペレーティングシス
テム下においても、より細かなスレッド制御を実現する
ことが可能となる。
According to the present invention, by resetting the execution priority at intervals shorter than the time slice of the operating system, finer thread control can be realized even under the existing operating system. Become.

【0011】また、オペレーティングシステムが管理す
る実行優先度は2つの値しか利用せずに、このオペレー
ティングシステムが管理する実行優先度とは独立した独
自の優先度に基づいて次に実行すべきスレッドを選択す
ることにより、オペレーティングシステムが受け付け可
能な段階数よりも多くの段階数でスレッドそれぞれの優
先度を設定することが可能となる。
Further, the execution priority managed by the operating system uses only two values, and the next thread to be executed is determined based on a unique priority independent of the execution priority managed by the operating system. By making the selection, it is possible to set the priority of each thread in a greater number of stages than the operating system can accept.

【0012】さらに、前述した2つの値に加えて、イベ
ント待ちとなったスレッド用の値をもう1つ利用し、こ
の値を前述の2つの値よりも優先度の高い値とすること
によって、イベント待ちが解けたスレッドと実行中のス
レッドとが同じ実行優先度であった場合に、オペレーテ
ィングシステムの設計思想に関わらずに、直ちにイベン
ト待ちが解けたスレッドに切り換えることが可能とな
る。
Further, in addition to the above two values, another value for the thread waiting for the event is used, and this value is set to a value having a higher priority than the above two values. When the thread whose event wait has been released and the thread being executed have the same execution priority, it is possible to immediately switch to the thread whose event wait has been released regardless of the design concept of the operating system.

【0013】[0013]

【発明の実施の形態】以下、図面を参照してこの発明の
実施の形態を説明する。
Embodiments of the present invention will be described below with reference to the drawings.

【0014】(第1実施形態)まず、この発明の第1実
施形態について説明する。図1は、この第1実施形態に
係るコンピュータシステムの機器構成を示す図である。
(First Embodiment) First, a first embodiment of the present invention will be described. FIG. 1 is a diagram showing a device configuration of the computer system according to the first embodiment.

【0015】図1に示すように、このコンピュータシス
テムは、CPU1、システムメモリ2、外部記憶装置
3、入力装置4および出力装置5を備えている。
As shown in FIG. 1, the computer system includes a CPU 1, a system memory 2, an external storage device 3, an input device 4, and an output device 5.

【0016】CPU1は、システムメモリ2に格納され
たオペレーティングシステムやユーティリティを含む各
種プログラムを実行制御するものである。
The CPU 1 executes and controls various programs including an operating system and utilities stored in the system memory 2.

【0017】システムメモリ2は、このシステムの主記
憶となるメモリデバイスであり、CPU1によって実行
制御されるオペレーティングシステムやユーティリティ
を含む各種プログラムおよび各種データを格納する。
The system memory 2 is a memory device serving as a main memory of the system, and stores various programs including an operating system and utilities executed and controlled by the CPU 1 and various data.

【0018】外部記憶装置3は、たとえば磁気ディスク
装置などであり、このシステムの補助記憶となるメモリ
デバイスである。
The external storage device 3 is, for example, a magnetic disk device or the like, and is a memory device serving as auxiliary storage of this system.

【0019】入力装置4は、たとえばキーボードやマウ
スなどであり、ユーザインタフェースのインプットを司
るものである。
The input device 4 is, for example, a keyboard or a mouse, and controls input of a user interface.

【0020】そして、出力装置5は、たとえばディスプ
レイ装置やプリンタなどであり、ユーザインタフェース
のアウトプットを司るものである。
The output device 5 is, for example, a display device or a printer, and controls the output of a user interface.

【0021】図2は、このコンピュータシステムのスレ
ッド制御に関する機能ブロックを示す図である。
FIG. 2 is a diagram showing functional blocks relating to thread control of the computer system.

【0022】図2に示すように、このコンピュータシス
テムのスレッド制御は、オペレーティングシステム10
0と、このオペレーティングシステム100下で動作す
るスレッド制御システム200とにより実行される。ま
た、これらは外部記憶装置3からシステムメモリ2にロ
ードされてCPU1によって実行制御されるプログラム
として構成されるものである。
As shown in FIG. 2, the thread control of the computer system is performed by the operating system 10.
0 and the thread control system 200 operating under the operating system 100. These are configured as programs that are loaded from the external storage device 3 into the system memory 2 and that are executed and controlled by the CPU 1.

【0023】オペレーティングシステム100は、この
システム全体の制御を司るものであり、スレッドの切り
換えを制御するスレッド管理部101を備えている。こ
のスレッド管理部101は、実行状態にあるスレッドが
実行権を放棄したとき、または、タイムスライスが尽き
たときに、次に実行すべきスレッドをそれぞれに付与さ
れた実行優先度に基づいて選択し、その選択したスレッ
ドにCPUを割り当てるべくスレッドの切り換えを実行
する。
The operating system 100 controls the entire system, and includes a thread management unit 101 for controlling thread switching. When the thread in the execution state relinquishes the execution right or when the time slice expires, the thread management unit 101 selects a thread to be executed next based on the execution priority assigned to each thread. Then, thread switching is performed to allocate a CPU to the selected thread.

【0024】一方、スレッド制御システム200は、オ
ペレーティングシステム100のスレッド管理部101
によるスレッドの切り換えを能動的に発生させるための
ものであり、スケジュール部201、実行優先度設定部
202および待機優先度設定部203を備えている。
On the other hand, the thread control system 200 includes a thread management unit 101 of the operating system 100.
This is for actively generating the thread switching by the program, and includes a schedule unit 201, an execution priority setting unit 202, and a standby priority setting unit 203.

【0025】スケジュール部201は、実行優先度設定
部202と待機優先度設定部203の機能を呼び出し
て、実行状態にあるスレッドと実行可能状態にあるスレ
ッドとの間の実行優先度の高低関係を逆転させることに
より、オペレーティングシステム100のスレッド管理
部101にスレッドの切り換えを指示する。
The schedule unit 201 calls the functions of the execution priority setting unit 202 and the standby priority setting unit 203, and determines the high / low relationship of the execution priority between the thread in the execution state and the thread in the executable state. By inverting the thread, the thread management unit 101 of the operating system 100 is instructed to switch threads.

【0026】実行優先度設定部202は、スケジュール
部201より指示された実行可能状態にあるスレッドの
実行優先度の値を予め定められた値に設定し直す。この
実行優先度設定部202が設定する実行優先度の値は、
待機優先度設定部203が設定する優先度の値よりも優
先度が高い値となっている。
The execution priority setting unit 202 resets the value of the execution priority of the thread in the executable state designated by the schedule unit 201 to a predetermined value. The value of the execution priority set by the execution priority setting unit 202 is
The priority has a higher value than the priority value set by the standby priority setting unit 203.

【0027】そして、待機優先度設定部203は、スケ
ジュール部201より指示された実行状態にあるスレッ
ドの実行優先度の値を予め定められた値に設定し直す。
この待機優先度設定部203が設定する実行優先度の値
は、実行優先度設定部202が設定する優先度の値より
も優先度が低い値となっている。
Then, the standby priority setting unit 203 resets the value of the execution priority of the thread in the execution state specified by the schedule unit 201 to a predetermined value.
The execution priority value set by the standby priority setting unit 203 has a lower priority than the priority value set by the execution priority setting unit 202.

【0028】すなわち、このコンピュータシステムは、
オペレーティングシステムが管理する実行優先度の中の
任意の2つの値のみを利用して、スレッドの切り換えを
適切に制御する点を特徴とするものである。
That is, this computer system
It is characterized in that thread switching is appropriately controlled by using only two arbitrary values among the execution priorities managed by the operating system.

【0029】以下、図3を参照しながらこのコンピュー
タシステムにおけるスレッド切り換えの動作原理を説明
する。
The operation principle of thread switching in this computer system will be described below with reference to FIG.

【0030】ここでは、実行優先度設定部202によっ
て設定される実行優先度の値を“24”、待機優先度設
定部20によって設定される実行優先度の値を“22”
とする。また、初期状態として、スレッドA,Bの2つ
のスレッドがあるものとする。
Here, the value of the execution priority set by the execution priority setting unit 202 is “24”, and the value of the execution priority set by the standby priority setting unit 20 is “22”.
And It is also assumed that there are two threads A and B in the initial state.

【0031】いま、[スレッドA]は実行中、[スレッ
ドB]は待機状態であるとする。この時点での実行優先
度の値は、[スレッドA]が“24”、[スレッドB]
が“22”である。そして、スケジュール部201は、
次に実行すべきスレッドとして[スレッドB]を選択し
たとする。このとき、スケジュール部201は、実行優
先度設定部202を用いて[スレッドB]の優先度(シ
ステム実行優先度)を“24”に設定し直す。その結
果、[スレッドB]は[スレッドB′]となる。
Now, it is assumed that [Thread A] is executing and [Thread B] is in a standby state. At this point, the execution priority value is [24] for [Thread A] and [Thread B]
Is "22". Then, the schedule unit 201
It is assumed that [Thread B] is selected as a thread to be executed next. At this time, the scheduling unit 201 resets the priority (system execution priority) of [Thread B] to “24” using the execution priority setting unit 202. As a result, [Thread B] becomes [Thread B '].

【0032】また、このとき、スケジュール部201
は、待機優先度設定部203を用いて[スレッドA]の
優先度(システム待機優先度)を“22”に設定し直
す。その結果、[スレッドA]は[スレッドA′]とな
る。
At this time, the schedule unit 201
Resets the priority (system standby priority) of [Thread A] to “22” using the standby priority setting unit 203. As a result, [Thread A] becomes [Thread A '].

【0033】このスケジュール部201による実行優先
度の操作により、オペレーティングシステム100のス
レッド管理部101は、優先度の高い[スレッドB′]
を実行すべくスレッドの切り換えを実行する。
Due to the operation of the execution priority by the schedule unit 201, the thread management unit 101 of the operating system 100 causes the high priority [thread B '].
Perform a thread switch to execute

【0034】このように、実行優先度を操作することに
より、タイムスライスの終了を待つことなくスレッドの
切り換えを能動的に発生させることができ、より細かい
スレッド制御が可能となる。
As described above, by controlling the execution priority, thread switching can be actively generated without waiting for the end of the time slice, and finer thread control can be performed.

【0035】(第2実施形態)次に、この発明の第2実
施形態について説明する。なお、この第2実施形態に係
るコンピュータシステムの機器構成は、第1実施形態と
同様である。
(Second Embodiment) Next, a second embodiment of the present invention will be described. The device configuration of the computer system according to the second embodiment is the same as that of the first embodiment.

【0036】図4は、このコンピュータシステムのスレ
ッド制御に関する機能ブロックを示す図である。
FIG. 4 is a diagram showing functional blocks relating to thread control of the computer system.

【0037】図4に示すように、このコンピュータシス
テムのスレッド制御は、オペレーティングシステム10
0と、このオペレーティングシステム100下で動作す
るスケジュールスレッド300およびスケジュール起動
スレッド310とにより実行される。また、これらは外
部記憶装置3からシステムメモリ2にロードされてCP
U1によって実行制御されるプログラムとして構成され
るものであり、オペレーティングシステム100は、第
1実施形態と同様のものである。
As shown in FIG. 4, the thread control of this computer system is controlled by the operating system 10.
0 and a schedule thread 300 and a schedule activation thread 310 operating under the operating system 100. These are loaded from the external storage device 3 into the system memory 2 and
It is configured as a program whose execution is controlled by U1, and the operating system 100 is the same as in the first embodiment.

【0038】一方、スケジュールスレッド300は、オ
ペレーティングシステム100のスレッド管理部101
によるスレッドの切り換えを能動的に発生させるための
ものであり、スケジュール部301は、実行優先度設定
部302、待機優先度設定部303、タイマ待ち部30
4およびイベント待ち部305の機能を呼び出して実行
する。
On the other hand, the schedule thread 300 is provided by the thread management unit 101 of the operating system 100.
The schedule unit 301 includes an execution priority setting unit 302, a standby priority setting unit 303, and a timer waiting unit 30.
4 and the function of the event waiting unit 305 are called and executed.

【0039】このうち、スケジュール部301、実行優
先度設定部302および待機優先度設定部303は、第
1実施形態で説明したスケジュール部201、実行優先
度設定部202および待機優先度設定部203にそれぞ
れ該当するものである。すなわち、このスケジュールス
レッド300は、第1実施形態で説明したスレッド制御
手法を適用したものである。そして、タイマ待ち部30
4は、オペレーティングシステム100のスライスタイ
ムよりも短い間隔でスケジュール部301を繰り返し起
動させるものであり、イベント待ち部305は、予め定
められたイベントが発生したときにスケジュール部30
1を起動させるものである。
The schedule unit 301, the execution priority setting unit 302, and the standby priority setting unit 303 are the same as the schedule unit 201, the execution priority setting unit 202, and the standby priority setting unit 203 described in the first embodiment. Each is applicable. That is, the schedule thread 300 is obtained by applying the thread control method described in the first embodiment. Then, the timer waiting unit 30
Reference numeral 4 denotes a unit for repeatedly activating the schedule unit 301 at intervals shorter than the slice time of the operating system 100, and the event wait unit 305 sets the schedule unit 30 when a predetermined event occurs.
1 is started.

【0040】また、スケジュール起動スレッド310
は、スケジュールイベント発生部311を備えており、
自身が実行される度に、このスケジュールイベント発生
部311を用いてイベント待ち部305がスケジュール
部301を起動させる契機とするイベントを発生させ
る。
The schedule activation thread 310
Has a schedule event generation unit 311,
Each time it is executed, the event waiting unit 305 generates an event that triggers the activation of the schedule unit 301 by using the schedule event generation unit 311.

【0041】そして、このスケジュールスレッド300
には、実行優先度設定部302が設定する優先度の値よ
りも優先度の高い値の実行優先度が付与され、一方、ス
ケジュール起動スレッド310には、実行優先度設定部
302が設定する優先度の値よりも優先度が低く、待機
優先度設定部303が設定する優先度の値よりも優先度
が高い値の実行優先度が付与される。
Then, the schedule thread 300
Is given a higher execution priority than the value of the priority set by the execution priority setting unit 302, while the schedule activation thread 310 has the priority set by the execution priority setting unit 302. The execution priority of a value having a lower priority than the value of the degree and a higher priority than the value of the priority set by the standby priority setting unit 303 is assigned.

【0042】すなわち、このコンピュータシステムは、
オペレーティングシステムが管理する実行優先度の中の
任意の4つの値のみを利用して、スレッドの切り換えを
適切に制御する点を特徴とするものである。
That is, this computer system
It is characterized in that thread switching is appropriately controlled by using only four arbitrary values among the execution priorities managed by the operating system.

【0043】以下、図5を参照しながらこのコンピュー
タシステムにおけるスレッド切り換えの動作原理を説明
する。
The operation principle of thread switching in this computer system will be described below with reference to FIG.

【0044】ここでは、スケジュールスレッド300に
付与される実行優先度の値を“25”、実行優先度設定
部302によって設定されるスレッドの実行優先度の値
を“24”、スケジュール起動スレッド310に付与さ
れる実行優先度の値を“23”、待機優先度設定部30
3によって設定されるスレッドの実行優先度の値を“2
2”とする。したがって、初期状態としては、優先度値
“25”が付与されたスケジュールスレッド300、優
先度値“23”が付与されたスケジュール起動スレッド
310、スケジュールスレッド300とスケジュール起
動スレッド310によって優先度値が設定されるスレッ
ドA,Bの2つのスレッド(たとえばアプリケーション
の実行プログラム)があるものとする。
Here, the value of the execution priority given to the schedule thread 300 is “25”, the value of the execution priority of the thread set by the execution priority setting unit 302 is “24”, and The value of the execution priority to be assigned is “23”, and the standby priority setting unit 30
The value of the thread execution priority set by 3 is “2”.
Therefore, as the initial state, the schedule thread 300 to which the priority value “25” is assigned, the schedule start thread 310 to which the priority value “23” is assigned, the schedule thread 300, and the schedule start thread 310 It is assumed that there are two threads A and B (for example, an application execution program) for which priority values are set.

【0045】いま、[スレッドA]が実行中、[スレッ
ドB]が待機状態であるとする。この時点での実行優先
度の値は、[スレッドA]が“24”、[スレッドB]
が“22”である。そして、この[スレッドA]から
[スレッドB]に実行権が移行する場合としては、大き
く2つの場合が考えられる。 (1)スケジューリングによって実行権が移行する場
合。 (2)実行状態にあるスレッドがイベント待ち状態にな
ったために実行権が移行する場合。
Now, suppose that [Thread A] is executing and [Thread B] is in a standby state. At this point, the execution priority value is [24] for [Thread A] and [Thread B]
Is "22". There are two cases in which the execution right is transferred from [Thread A] to [Thread B]. (1) When the execution right is transferred by scheduling. (2) When the execution right is transferred because the thread in the execution state has entered the event waiting state.

【0046】まず、(1)のスケジューリングによって
実行権が移行する場合の動作原理を説明する。なお、以
下の説明で[ ]( )の表現は図4と図5を併用して
説明するものである。
First, the operation principle when the execution right is transferred by the scheduling of (1) will be described. In the following description, the expressions [] () will be described with reference to FIGS. 4 and 5.

【0047】[スレッドA]が実行状態にあるとき、ス
ケジュールスレッド300のスケジュール部301は、
タイマ待ち部304およびイベント待ち部305のいず
れかからの起動を待機している状態にある。
When [Thread A] is in the execution state, the schedule unit 301 of the schedule thread 300
It is in a state of waiting for activation from one of the timer waiting unit 304 and the event waiting unit 305.

【0048】ここで、タイマ待ち部304から起動され
ると、スケジュール部301の指示によってオペレーテ
ィングシステム100のスレッド管理部101は、優先
度が1番高い[スケジュールスレッド](300)を実
行すべくスレッドの切り換えを実行する。このことは、
スケジュールスレッド300が実行されることを意味す
る。
Here, when started from the timer waiting unit 304, the thread management unit 101 of the operating system 100 instructs the thread management unit 101 of the operating system 100 to execute the [schedule thread] (300) having the highest priority according to the instruction of the schedule unit 301. Switch. This means
This means that the schedule thread 300 is executed.

【0049】スケジュールスレッド300では、その実
行処理において、スケジュール部301が、たとえば次
に実行すべきスレッドとして待機中の[スレッドB]を
選択したとする。このとき、スケジュール部301は、
実行中スレッドの優先度とするため、実行優先度設定部
302を用いて[スレッドB]の優先度を“24”に設
定し直す。その結果、[スレッドB]は[スレッド
B′]となる。
In the schedule thread 300, in the execution process, it is assumed that the schedule unit 301 selects, for example, [Thread B] in standby as the thread to be executed next. At this time, the schedule unit 301
In order to set the priority of the currently executing thread, the priority of [Thread B] is reset to “24” using the execution priority setting unit 302. As a result, [Thread B] becomes [Thread B '].

【0050】また、このとき、スケジュール部301
は、待機/イベント待ちスレッドの優先度とするため、
待機優先度設定部303を用いて[スレッドA]の優先
度を“22”に設定し直す。その結果、[スレッドA]
は[スレッドA′]となる。
At this time, the schedule unit 301
Is the priority of the waiting / event waiting thread,
The priority of [Thread A] is reset to “22” using the standby priority setting unit 303. As a result, [Thread A]
Becomes [thread A '].

【0051】そして、これらの処理が終了すると、[ス
ケジュールスレッド]300は、実行権を放棄する。
When these processes are completed, the [schedule thread] 300 relinquishes the execution right.

【0052】この[スケジュールスレッド](300)
の実行権が放棄されたことにより、オペレーティングシ
ステム100のスレッド管理部101は、この時優先度
の一番高い[スレッドB′]を実行すべくスレッドの切
り換えを実行する。これにより、[スレッドB′]が実
行される。
This [schedule thread] (300)
Has been abandoned, the thread management unit 101 of the operating system 100 executes thread switching to execute [Thread B '] having the highest priority at this time. Thus, [Thread B '] is executed.

【0053】次に、(2)の実行状態にあるスレッドが
イベント待ち状態になったために実行権が移行する場合
の動作原理を説明する。
Next, a description will be given of the operation principle in the case where the execution right is transferred because the thread in the execution state of (2) enters the event waiting state.

【0054】[スレッドA]が実行状態にあるとき、最
も優先度の高い[スケジュールスレッド](300)
は、タイマ待ち304およびイベント待ち部305のい
ずれかからの起動を待機している状態にある。すなわ
ち、スケジュールスレッド300は動作していない。
When [Thread A] is in the execution state, [Schedule Thread] having the highest priority (300)
Is in a state of waiting for activation from one of the timer waiting unit 304 and the event waiting unit 305. That is, the schedule thread 300 is not operating.

【0055】ここで、[スレッドA]が、たとえばイベ
ント待ちなどにより実行権を放棄したとすると、オペレ
ーティングシステム100のスレッド管理部101は、
その時点で実行優先度が1番高い[スケジュール起動ス
レッド](310)を実行すべくスレッドの切り換えを
実行する。すなわち、スケジュール起動スレッド310
が動作することになる。
Here, assuming that [Thread A] has abandoned the execution right due to, for example, waiting for an event, the thread management unit 101 of the operating system 100
At that time, the thread is switched to execute the [schedule start thread] (310) having the highest execution priority. That is, the schedule activation thread 310
Will work.

【0056】スケジュール起動スレッド310では、ス
ケジュールイベント発生部311が、スケジュールスレ
ッド300のイベント待ち部305を起動し、これによ
り、スケジュール部301を起動する契機とするイベン
トを発生させ、[スケジュールスレッド](300)を
起動させる。
In the schedule start thread 310, the schedule event generation unit 311 starts the event waiting unit 305 of the schedule thread 300, thereby generating an event that triggers the start of the schedule unit 301, and generates a schedule thread (schedule thread) ( 300) is started.

【0057】[スケジュールスレッド](300)は、
優先度が最も高いので、オペレーティングシステム10
0のスレッド管理部101は、実行中の[スケジュール
起動スレッド](310)から[スケジュールスレッ
ド](300)へのスレッドの切り換えを実行する。す
なわち、スケジュールスレッド300が動作することに
なる。
[Schedule thread] (300)
Because the priority is the highest, the operating system 10
The thread management unit 101 of “0” switches the thread from the currently running “schedule start thread” (310) to the “schedule thread” (300). That is, the schedule thread 300 operates.

【0058】スケジュールスレッド300では、その実
行処理において、スケジュール部301が、たとえば次
に実行すべきスレッドとして待機中の[スレッドB]を
選択したとする。このとき、スケジュール部301は、
実行中スレッドの優先度とするため、実行優先度設定部
302を用いて[スレッドB]の優先度を“24”に設
定し直す。その結果、[スレッドB]は[スレッド
B′]となる。
In the execution process of the schedule thread 300, it is assumed that the schedule unit 301 selects, for example, the waiting [Thread B] as the next thread to be executed. At this time, the schedule unit 301
In order to set the priority of the currently executing thread, the priority of [Thread B] is reset to “24” using the execution priority setting unit 302. As a result, [Thread B] becomes [Thread B '].

【0059】また、このとき、スケジュール部301
は、待機/イベント待ちスレッドの優先度とするため、
待機優先度設定部303を用いて[スレッドA]の優先
度を“22”に設定し直す。その結果、[スレッドA]
は[スレッドA′]となる。
At this time, the schedule unit 301
Is the priority of the waiting / event waiting thread,
The priority of [Thread A] is reset to “22” using the standby priority setting unit 303. As a result, [Thread A]
Becomes [thread A '].

【0060】そして、これらの処理が終了すると、[ス
ケジュールスレッド]300は、実行権を放棄する。
When these processes are completed, the [schedule thread] 300 relinquishes the execution right.

【0061】この[スケジュールスレッド](300)
の実行権が放棄されたことにより、オペレーティングシ
ステム100のスレッド管理部101は、この時優先度
の一番高い[スレッドB′]を実行すべくスレッドの切
り換えを実行する。これにより、[スレッドB′]が実
行される。
This [schedule thread] (300)
Has been abandoned, the thread management unit 101 of the operating system 100 executes thread switching to execute [Thread B '] having the highest priority at this time. Thus, [Thread B '] is executed.

【0062】このように、定期的または実行状態のスレ
ッドがイベント待ち状態になったことを検出した際、実
行優先度を操作することにより、タイムスライスの終了
を待つことなくスレッドの切り換えを能動的に発生させ
ることができ、より細かいスレッド制御が可能となる。
As described above, when it is detected that a thread in the regular or running state has entered the event waiting state, the execution priority is manipulated to actively switch the thread without waiting for the end of the time slice. And thread control can be performed more finely.

【0063】(第3実施形態)次に、この発明の第3実
施形態について説明する。この第3実施形態に係るコン
ピュータシステムは、第2実施形態のコンピュータシス
テムのスレッド制御にイベント待ちが解けたスレッドの
取り扱いを別途考慮させたものである。
(Third Embodiment) Next, a third embodiment of the present invention will be described. In the computer system according to the third embodiment, the thread control of the computer system according to the second embodiment is made to separately consider handling of a thread whose event wait has been released.

【0064】図6は、このコンピュータシステムのスレ
ッド制御に関する機能ブロックを示す図である。
FIG. 6 is a diagram showing functional blocks relating to thread control of the computer system.

【0065】図6に示すように、このコンピュータシス
テムは、第2実施形態のスケジュールスレッド300
に、さらにイベント待ち優先度設定部306とイベント
待ち解除時処理部307とを加えたものである。
As shown in FIG. 6, the computer system has a schedule thread 300 according to the second embodiment.
Further, an event waiting priority setting unit 306 and an event waiting canceling processing unit 307 are added.

【0066】イベント待ち優先度設定部306は、スケ
ジュール部301より指示されたスレッドの実行優先度
の値を予め定められた値に設定し直すことができる。こ
のイベント待ち優先度設定部306が設定する実行優先
度の値は、スケジュールスレッド300に付与された優
先度の値よりも優先度が高い値(最も高い優先度)とな
っている。
The event waiting priority setting unit 306 can reset the value of the execution priority of the thread specified by the schedule unit 301 to a predetermined value. The value of the execution priority set by the event waiting priority setting unit 306 is a value having a higher priority than the value of the priority assigned to the schedule thread 300 (highest priority).

【0067】そして、イベント待ち解除時処理部307
は、待機状態が解除されて実行状態に移行したスレッド
から呼び出されるモジュールであり、自身を呼び出した
スレッドや自身を呼び出したスレッドの直前に実行状態
から実行可能状態に移行したスレッドの優先度などを適
切に設定し直すためのものである。
Then, the event wait release time processing unit 307
Is a module that is called by a thread that has been released from the standby state and transitioned to the execution state, and has the priority of the thread that called itself and the thread that transitioned from the execution state to the executable state immediately before the thread that called itself. It is for re-setting properly.

【0068】すなわち、このコンピュータシステムは、
オペレーティングシステムが管理する実行優先度の中の
任意の5つの値のみを利用して、スレッドの切り換えを
適切に制御する点を特徴とするものである。
That is, this computer system
It is characterized in that thread switching is appropriately controlled by using only five arbitrary values of the execution priority managed by the operating system.

【0069】以下、図7を参照しながらこのコンピュー
タシステムにおけるスレッド制御の動作原理を説明す
る。
Hereinafter, the operation principle of thread control in this computer system will be described with reference to FIG.

【0070】ここでは、イベント待ち優先度設定部30
6によって設定されるイベント待ち優先度を“26”、
スケジュールスレッド300に付与される実行優先度の
値を“25”、実行優先度設定部302によって設定さ
れる実行優先度の値を“24”、スケジュール起動スレ
ッド310に付与される実行優先度の値を“23”、待
機優先度設定部303によって設定される実行優先度の
値を“22”とする。また、初期状態としては、第2実
施形態と同様に、スケジュールスレッド300、スケジ
ュール起動スレッド310、およびスレッドA,Bの2
個のスレッドがあるものとする。
Here, the event wait priority setting unit 30
The event waiting priority set by 6 is “26”,
The value of the execution priority assigned to the schedule thread 300 is “25”, the value of the execution priority set by the execution priority setting unit 302 is “24”, and the value of the execution priority assigned to the schedule activation thread 310 Is “23”, and the value of the execution priority set by the standby priority setting unit 303 is “22”. As the initial state, as in the second embodiment, the schedule thread 300, the schedule start thread 310, and the threads A and B
Assume that there are threads.

【0071】いま、[スレッドA]が実行中、[スレッ
ドB]が待機状態であるとする。この時点での実行優先
度の値は、実行優先度設定部302により[スレッド
A]が“24”、待機優先度設定部303により[スレ
ッドB]が“22”にそれぞれ設定されている。
Now, it is assumed that [Thread A] is in execution and [Thread B] is in a standby state. At this point, the execution priority value is set to "24" for [Thread A] by the execution priority setting unit 302, and to "22" for [Thread B] by the standby priority setting unit 303.

【0072】このコンピュータシステムにおけるスレッ
ド制御の動作について、前述した第2実施形態と異なる
のは、実行中のスレッドがイベント待ち状態になった場
合の動作である。したがって、以下では、この場合の動
作原理を説明する。
The operation of the thread control in this computer system is different from that of the second embodiment described above in the operation when the currently executing thread is in the event waiting state. Therefore, the operation principle in this case will be described below.

【0073】[スレッドA]が実行状態にあるとき、
[スケジュールスレッド](300)は、タイマ待ち部
304およびイベント待ち部305のいずれかからの起
動を待機している状態にある。すなわち、スケジュール
スレッド300は動作していない。
When [Thread A] is in the execution state,
The [schedule thread] (300) is in a state of waiting for activation from one of the timer waiting unit 304 and the event waiting unit 305. That is, the schedule thread 300 is not operating.

【0074】ここで、[スレッドA]が、イベント待ち
により実行権を放棄すると、オペレーティングシステム
100のスレッド管理部101は、その時点で優先度が
1番高い[スケジュール起動スレッド](310)を実
行すべくスレッドの切り換えを実行する。すなわち、ス
ケジュール起動スレッド310が動作することになる。
Here, when [Thread A] relinquishes the execution right due to waiting for an event, the thread management unit 101 of the operating system 100 executes the [Schedule Start Thread] (310) having the highest priority at that time. Perform thread switching to achieve this. That is, the schedule activation thread 310 operates.

【0075】スケジュール起動スレッド310では、ス
ケジュールイベント発生手段311が、スケジュールス
レッド300のイベント待ち部305を起動し、これに
よりスケジュール部301を起動する契機とするイベン
トを発生させ、[スケジュールスレッド](300)を
起動させる。
In the schedule start thread 310, the schedule event generating means 311 starts the event waiting unit 305 of the schedule thread 300, thereby generating an event that triggers the start of the schedule unit 301, and generates a schedule thread (300) ).

【0076】[スケジュールスレッド](300)は、
優先度が[スケジュール起動スレッド](310)より
も高いので、オペレーティングシステム100のスレッ
ド管理部101は、実行中の[スケジュール起動スレッ
ド](310)から[スケジュールスレッド](30
0)へのスレッドの切り換えを実行する。すなわち、ス
ケジュールスレッド300が動作することになる。
[Schedule thread] (300)
Since the priority is higher than the [schedule start thread] (310), the thread management unit 101 of the operating system 100 changes the running [schedule start thread] (310) to the [schedule thread] (30).
Perform a thread switch to 0). That is, the schedule thread 300 operates.

【0077】スケジュールスレッド300では、スケジ
ュール部301が、次に実行すべきスレッドとして[ス
レッドB]を選択したとする。このとき、スケジュール
部301は、実行優先度設定部302を用いて[スレッ
ドB]の優先度を“24”に設定し直す。その結果、
[スレッドB]は[スレッドB′]となる。
In the schedule thread 300, it is assumed that the schedule unit 301 has selected [thread B] as the next thread to be executed. At this time, the scheduling unit 301 resets the priority of [Thread B] to “24” using the execution priority setting unit 302. as a result,
[Thread B] becomes [Thread B '].

【0078】また、このとき、スケジュール部301
は、イベント待ちが解けた後にイベント待ち解除時処理
部307が呼び出されるように、このイベント待ち解除
時処理部307に[スレッドA]をセットするととも
に、イベント待ち優先度設定部306を用いて[スレッ
ドA]の優先度を“26”に設定し直す。その結果[ス
レッドA]は[スレッドA′]となる。
At this time, the schedule unit 301
Sets [Thread A] in the event wait release processing unit 307 so that the event wait release processing unit 307 is called after the event wait is released, and sets the [Thread A] using the event wait priority setting unit 306 [ The priority of the thread A] is reset to “26”. As a result, [Thread A] becomes [Thread A '].

【0079】そして、これらの処理が終了すると、[ス
ケジュールスレッド]300は、実行権を放棄する。
When these processes are completed, the [schedule thread] 300 relinquishes the execution right.

【0080】この[スケジュールスレッド](300)
の実行権が放棄されたことにより、オペレーティングシ
ステム100のスレッド管理部101は、この時点で優
先度の一番高い[スレッドB′]を実行すべくスレッド
の切り換えを実行する。これにより、[スレッドB′]
が実行される。
This [schedule thread] (300)
Has been abandoned, the thread management unit 101 of the operating system 100 switches threads to execute [Thread B '] having the highest priority at this time. Thereby, [Thread B ']
Is executed.

【0081】その後、[スレッドB′]の実行中に[ス
レッドA′]が待っていたイベントが発生したとする
と、スケジュールスレッド300のイベント待ち解除時
処理部307が呼び出される。そして、このイベント待
ち解除時処理部307は、スレッド管理部101が持つ
[スレッドA′]と[スレッドB′]との優先度を比較
して、たとえばスレッドAの優先度が高ければ[スレッ
ドB′]から[スレッドA′]への切り換えを実行する
ため、[スレッドA′]の優先度を“24”に設定し直
す。その結果[スレッドA′]は[スレッドA″]とな
る。
Thereafter, if an event that [Thread A '] has been waiting for occurs during the execution of [Thread B'], the event waiting cancellation processing unit 307 of the schedule thread 300 is called. Then, the event-wait-release processing unit 307 compares the priorities of [Thread A '] and [Thread B'] of the thread management unit 101. If the priority of the thread A is high, for example, the [Thread B] '] To [Thread A'], the priority of [Thread A '] is reset to "24". As a result, [thread A '] becomes [thread A "].

【0082】また、イベント待ち解除時処理部307
は、[スレッドB′]の優先度を“22”に設定し直
す。その結果[スレッドB′]は[スレッドB″]とな
り、再び待機状態となる。
Further, the event wait release time processing unit 307
Resets the priority of [thread B '] to "22". As a result, [Thread B '] becomes [Thread B "] and enters the standby state again.

【0083】これにより、この時点で優先度が1番高い
のは、[スレッドA″]であるので、オペレーティング
システム100のスレッド管理部101によりスレッド
の切り換えが行なわれ、待ちが解けた以降の[スレッド
A″]の処理が継続される。
At this point, the thread having the highest priority at this point is [Thread A ″]. Therefore, the thread is switched by the thread management unit 101 of the operating system 100 and [Thread A] after the waiting is released. The processing of the thread A ″] is continued.

【0084】一方、[スレッドA′]と[スレッド
B′]との優先度の比較において、[スレッドB′]の
優先度が高い状態では、イベント待ち解除時処理部30
7は、[スレッドA′]の優先度を“22”に設定し直
す。この実施形態では、実行中スレッドが[スレッド
B′]のままであるので、継続して[スレッドB′]が
実行される。
On the other hand, when comparing the priorities of [Thread A '] and [Thread B'], when the priority of [Thread B '] is high, the event waiting release processing unit 30
7 resets the priority of [Thread A '] to "22". In this embodiment, since the currently executing thread remains [Thread B '], [Thread B'] is continuously executed.

【0085】このように、第2実施形態のコンピュータ
システムによるスレッド制御と比較して、イベント待ち
が解けたことを検出した際に、より細かいスレッドの切
り換え制御が可能となる。
As described above, in comparison with the thread control performed by the computer system according to the second embodiment, more detailed thread switching control can be performed when it is detected that the event wait has been released.

【0086】(第4実施形態)次に、この発明の第4実
施形態について説明する。この第4実施形態のコンピュ
ータシステムは、前述したこの発明のスレッド制御手法
を適用して、オペレーティングシステムが受け付け可能
な段階数よりも多くの段階数をもつ独自の実行優先度を
スレッドに付与することを可能としたものである。
(Fourth Embodiment) Next, a fourth embodiment of the present invention will be described. The computer system according to the fourth embodiment applies the above-described thread control method of the present invention to give a thread a unique execution priority having a greater number of stages than the operating system can accept. Is made possible.

【0087】図8に、オペレーティングシステムが管理
する優先度(システム優先度)とこのオペレーティング
システムが管理する優先度とは独立した独自の優先度
(独自優先度)との例を示す。ここでは、オペレーティ
ングシステムが、16段階の優先度をもち、そのうちの
下位8段階を可変優先度、上位8段階を固定優先度とし
ているものとする。したがって、通常であれば、スレッ
ドは8から15までの優先度しか使用することができな
いことになる。そこで、このコンピュータシステムで
は、独自優先度を提供することによって、スレッドが8
から255までの優先度を使用できるようにする。これ
により、アプリケーションプログラムは、より細かな動
作制御を行なうことを可能とする。
FIG. 8 shows an example of a priority managed by the operating system (system priority) and a unique priority independent of the priority managed by the operating system (unique priority). Here, it is assumed that the operating system has 16 levels of priority, of which the lower 8 levels are variable priorities and the upper 8 levels are fixed priorities. Therefore, normally, the thread can use only the priority of 8 to 15. Thus, in this computer system, by providing a unique priority, the number of threads is reduced to eight.
To 255 can be used. This allows the application program to perform more detailed operation control.

【0088】図9は、このコンピュータシステムの実行
優先度の付与に関する機能ブロックを示す図である。
FIG. 9 is a diagram showing functional blocks related to giving execution priorities of the computer system.

【0089】図9に示すように、このコンピュータシス
テムにおける実行優先度の付与は、スレッド制御システ
ム400によって制御される。なお、このスレッド制御
システム400は、第1実施形態乃至第3実施形態で説
明したスレッド制御手法を実践する機構をスケジュール
部401として備えているものとする。そして、このス
レッド制御システム400は、さらに、優先度情報保持
部402および優先度管理部403を備えているものと
する。
As shown in FIG. 9, the assignment of the execution priority in this computer system is controlled by a thread control system 400. It is assumed that the thread control system 400 includes, as the schedule unit 401, a mechanism for practicing the thread control method described in the first to third embodiments. The thread control system 400 further includes a priority information holding unit 402 and a priority management unit 403.

【0090】このスレッド制御システム400における
実行優先度の付与の動作は、大別して次の2つである。 (1)スレッドが独自優先度を設定する場合 (2)スレッドが独自優先度を取得する場合 まず、(1)のスレッドが独自優先度を設定する場合の
動作原理を説明する。
The operation of giving the execution priority in the thread control system 400 is roughly classified into the following two operations. (1) When a Thread Sets Unique Priority (2) When a Thread Acquires Unique Priority First, the operation principle when the thread of (1) sets a unique priority will be described.

【0091】アプリケーションプログラムは、生成する
スレッドについて優先度の設定を独自優先度である8〜
255の中の任意の値を指定して要求するが、スレッド
制御システム400では、この要求を優先度管理部40
3にて受け付け、この受け付けたスレッドの独自優先度
を優先度情報保持部402に格納する。
The application program sets the priority of the thread to be generated to the unique priority of 8 to
The thread control system 400 makes a request by designating an arbitrary value from among the 255 values.
The received priority is stored in the priority information holding unit 402.

【0092】以後、この優先度情報保持部403に保持
された独自優先度は、スケジュール部401が次に実行
すべきスレッドを選択するための基礎情報として利用さ
れることになる。
Thereafter, the unique priority held in the priority information holding unit 403 is used as basic information for the schedule unit 401 to select a thread to be executed next.

【0093】次に、(2)のスレッドが独自優先度を取
得する場合の動作原理を説明する。
Next, the principle of operation when the thread (2) acquires the unique priority will be described.

【0094】アプリケーションプログラムは、生成する
スレッドについて優先度の取得をスレッド制御システム
400に要求するが、スレッド制御システム400で
は、この要求を優先度管理部403にて受け付け、独自
優先度である8〜255の中の適切な値を割り当ててス
レッドに返すとともに、この割り当てた独自優先度を優
先度情報保持部402に格納する。
The application program requests the thread control system 400 to acquire the priority of the thread to be generated. In the thread control system 400, the request is accepted by the priority management unit 403, and the priority is set to 8 to An appropriate value in 255 is assigned and returned to the thread, and the assigned unique priority is stored in the priority information holding unit 402.

【0095】以後、この優先度情報保持部403に保持
された独自優先度は、スケジュール部401が次に実行
すべきスレッドを選択するための基礎情報として利用さ
れることになる。
Thereafter, the unique priority held in the priority information holding unit 403 is used as basic information for the scheduling unit 401 to select a thread to be executed next.

【0096】したがって、このコンピュータシステム
が、たとえば第2実施形態で説明したスレッド制御手法
を適用する場合、オペレーティングシステムが管理する
優先度の値の中の4つの値のみを利用することから、シ
ステム優先度の固定優先度として用意される8つの値の
中の4つの値を利用するのみで、ユーザには独自の優先
度として8〜255の値を提供することが可能となる。
Therefore, when this computer system applies, for example, the thread control method described in the second embodiment, only four of the priority values managed by the operating system are used. It is possible to provide the user with a value of 8 to 255 as a unique priority only by using four of the eight values prepared as the fixed priority of the degree.

【0097】このように、オペレーティングシステムが
受け付け可能な段階数よりも多くの段階数の優先度をス
レッドに提供することが可能となり、アプリケーション
プログラムは、この独自優先度に基づいたより細かなス
レッド制御が可能となる。
As described above, it is possible to provide a thread with a higher number of priorities than the number of stages that can be accepted by the operating system, and the application program can perform finer thread control based on this unique priority. It becomes possible.

【0098】(第5実施形態)次に、この発明の第5実
施形態について説明する。この第5実施形態のコンピュ
ータシステムは、第4実施形態のコンピュータシステム
を、独自優先度の利用に対応していないアプリケーショ
ンプログラムが生成するスレッドへの優先度の付与につ
いても制御可能としたものである。
(Fifth Embodiment) Next, a fifth embodiment of the present invention will be described. The computer system according to the fifth embodiment enables the computer system according to the fourth embodiment to control the assignment of a priority to a thread generated by an application program that does not support the use of a unique priority. .

【0099】図10に、オペレーティングシステムが管
理する優先度(システム優先度)とこのオペレーティン
グシステムが受け付け可能な優先度とは独立した独自の
優先度(独自優先度)との対応例を示す。この対応表に
よれば、独自優先度の利用に対応していないアプリケー
ションプログラムが、たとえば、生成するスレッドにつ
いて優先度の設定をシステム優先度12を指定して要求
した場合、独自優先度140として以降のスレッド切り
換えを制御すればよいことがわかる。
FIG. 10 shows an example of correspondence between the priority managed by the operating system (system priority) and a unique priority independent of the priority that can be accepted by the operating system (unique priority). According to this correspondence table, when an application program that does not support the use of the unique priority requests the setting of the priority for the thread to be created by designating the system priority 12, for example, It is understood that it is sufficient to control the thread switching.

【0100】図11は、このコンピュータシステムの実
行優先度の付与に関する機能ブロックを示す図である。
FIG. 11 is a diagram showing functional blocks related to giving execution priorities of the computer system.

【0101】図11に示すように、このコンピュータシ
ステムは、第4実施形態のスレッド制御システム400
に、さらに優先度変換部404と優先度対応表405と
を加えたものである。
As shown in FIG. 11, this computer system has a thread control system 400 according to the fourth embodiment.
And a priority conversion unit 404 and a priority correspondence table 405.

【0102】このスレッド制御システム400における
実行優先度の付与の動作であって第4実施形態のスレッ
ド制御システム400と異なる動作は、大別して次の2
つである。 (1)スレッドがシステム優先度を設定する場合 (2)スレッドがシステム優先度を取得する場合 まず、(1)のスレッドがシステム優先度を設定する場
合の動作原理を説明する。
The operation of giving an execution priority in the thread control system 400 and different from the operation of the thread control system 400 of the fourth embodiment is roughly classified into the following two operations.
One. (1) When the thread sets the system priority (2) When the thread acquires the system priority First, the operation principle when the thread of (1) sets the system priority will be described.

【0103】アプリケーションプログラムは、生成する
スレッドについて優先度の設定をシステム優先度である
8〜15の中の任意の値を指定して要求するが、スレッ
ド制御システム400では、この要求を優先度変換部4
04にて受け付け、図10に示したような内容をもつ優
先度対応表405に基づいて独自優先度に変換する。そ
して、優先度変換部404は、この変換後の独自優先度
を優先度管理部403に引き渡し、さらに、優先度管理
部403が、この引き渡された独自優先度を優先度情報
保持部402に格納する。
The application program requests the setting of the priority of the thread to be created by specifying an arbitrary value from 8 to 15 which is the system priority. The thread control system 400 converts this request into a priority conversion. Part 4
04, and is converted to a unique priority based on the priority correspondence table 405 having contents as shown in FIG. Then, the priority conversion unit 404 transfers the converted unique priority to the priority management unit 403, and the priority management unit 403 stores the transferred unique priority in the priority information holding unit 402. I do.

【0104】以後、この優先度情報保持部403に保持
された独自優先度は、スケジュール部401が次に実行
すべきスレッドを選択するための基礎情報として利用さ
れることになる。
Thereafter, the unique priority held in the priority information holding unit 403 is used as basic information for the schedule unit 401 to select a thread to be executed next.

【0105】次に、(2)のスレッドがシステム優先度
を取得する場合の動作原理を説明する。
Next, the operation principle when the thread (2) acquires the system priority will be described.

【0106】アプリケーションプログラムは、生成する
スレッドについて優先度の取得をスレッド制御システム
400に要求するが、スレッド制御システム400で
は、この要求を優先度変換部403にて受け付け、独自
優先度である8〜255の中の値であって、優先度対応
表405上でシステム優先度と対応づけられている値の
中の適切な値を割り当て、この割り当てた独自優先度に
対応するシステム優先度をスレッドに返すとともに、こ
の割り当てた独自優先度を優先度管理部403に引き渡
す。そして、この独自優先度は、優先度管理部403に
よって優先度情報保持部402に格納される。
The application program requests the thread control system 400 to acquire the priority of the thread to be generated. In the thread control system 400, the request is accepted by the priority conversion unit 403, and the original priority of 8 to 255, and assigns an appropriate value among the values associated with the system priority on the priority correspondence table 405, and assigns the system priority corresponding to the assigned unique priority to the thread. And returns the assigned unique priority to the priority management unit 403. Then, the unique priority is stored in the priority information holding unit 402 by the priority management unit 403.

【0107】以後、この優先度情報保持部403に保持
された独自優先度は、スケジュール部401が次に実行
すべきスレッドを選択するための基礎情報として利用さ
れることになる。
Thereafter, the unique priority held in the priority information holding unit 403 is used as basic information for the schedule unit 401 to select a thread to be executed next.

【0108】したがって、オペレーティングシステムが
管理するシステム優先度と独自優先度との相互変換が可
能となり、独自優先度の利用に対応したアプリケーショ
ンプログラムが生成するスレッドと独自優先度の利用に
対応していないアプリケーションプログラムが生成する
スレッドとを混在させても、適切な優先度の付与が制御
可能となる。
Therefore, the system priority managed by the operating system and the unique priority can be mutually converted, and the thread generated by the application program corresponding to the use of the unique priority and the use of the unique priority are not supported. Even if a thread generated by an application program is mixed, it is possible to control the assignment of an appropriate priority.

【0109】[0109]

【発明の効果】以上詳述したように、この発明によれ
ば、オペレーティングシステムのタイムスライスよりも
短い間隔で実行優先度の再設定を行なうことにより、既
存のオペレーティングシステム下においても、より細か
なスレッド制御を実現することを可能とする。
As described above in detail, according to the present invention, the execution priority is reset at intervals shorter than the time slice of the operating system, so that even under the existing operating system, finer details can be obtained. Thread control can be realized.

【0110】また、オペレーティングシステムが管理す
る実行優先度とは独立した独自の優先度に基づいて次に
実行すべきスレッドを選択することにより、オペレーテ
ィングシステムが受け付け可能な段階数よりも多くの段
階数でスレッドそれぞれの優先度を設定することを可能
とする。
Further, by selecting a thread to be executed next based on a unique priority independent of the execution priority managed by the operating system, the number of stages larger than the number of stages that can be accepted by the operating system is selected. To set the priority of each thread.

【0111】さらに、イベント待ちとなったスレッドに
実行状態にあるスレッドよりも優先度の高い値の優先度
を付与することによって、イベント待ちが解けたスレッ
ドと実行中のスレッドとが同じ実行優先度であった場合
に、オペレーティングシステムの設計思想に関わらず
に、直ちにイベント待ちが解けたスレッドに切り換える
ことを可能とする。
Further, by assigning a higher priority to the thread waiting for the event than the thread in the execution state, the thread that has released the event and the thread that is executing have the same execution priority. In this case, it is possible to immediately switch to the thread whose event wait has been released, regardless of the design concept of the operating system.

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

【図1】この発明の第1実施形態に係るコンピュータシ
ステムの機器構成を示す図。
FIG. 1 is an exemplary view showing a device configuration of a computer system according to a first embodiment of the present invention.

【図2】同第1実施形態のコンピュータシステムのスレ
ッド制御に関する機能ブロックを示す図。
FIG. 2 is an exemplary view showing functional blocks relating to thread control of the computer system according to the first embodiment;

【図3】同第1実施形態のコンピュータシステムにおけ
るスレッド制御の動作原理を説明するための図。
FIG. 3 is an exemplary view for explaining the operation principle of thread control in the computer system according to the first embodiment;

【図4】同第2実施形態のコンピュータシステムのスレ
ッド制御に関する機能ブロックを示す図。
FIG. 4 is an exemplary view showing functional blocks relating to thread control of the computer system according to the second embodiment;

【図5】同第2実施形態のコンピュータシステムにおけ
るスレッド制御の動作原理を説明するための図。
FIG. 5 is an exemplary view for explaining the operation principle of thread control in the computer system of the second embodiment.

【図6】同第3実施形態のコンピュータシステムのスレ
ッド制御に関する機能ブロックを示す図。
FIG. 6 is an exemplary view showing functional blocks relating to thread control of the computer system according to the third embodiment;

【図7】同第3実施形態のコンピュータシステムにおけ
るスレッド制御の動作原理を説明するための図。
FIG. 7 is an exemplary view for explaining the operation principle of thread control in the computer system of the third embodiment.

【図8】同第4実施形態におけるオペレーティングシス
テムが管理する優先度(システム優先度)とこのオペレ
ーティングシステムが管理する優先度とは独立した独自
の優先度(独自優先度)との例を示す図。
FIG. 8 is a diagram illustrating an example of a priority (system priority) managed by an operating system and a unique priority (unique priority) independent of the priority managed by the operating system in the fourth embodiment. .

【図9】同第4実施形態のコンピュータシステムの実行
優先度の付与に関する機能ブロックを示す図。
FIG. 9 is an exemplary view showing functional blocks relating to the assignment of an execution priority of the computer system according to the fourth embodiment;

【図10】同第5実施形態のオペレーティングシステム
が管理する優先度(システム優先度)とこのオペレーテ
ィングシステムが管理する優先度とは独立した独自の優
先度(独自優先度)との対応例を示す図。
FIG. 10 shows an example of correspondence between the priority managed by the operating system of the fifth embodiment (system priority) and a unique priority independent of the priority managed by the operating system (unique priority). FIG.

【図11】同第5実施形態のコンピュータシステムの実
行優先度の付与に関する機能ブロックを示す図。
FIG. 11 is an exemplary functional block diagram of the computer system according to the fifth embodiment;

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

1…CPU 2…システムメモリ 3…外部記憶装置 4…入力装置 5…出力装置 100…オペレーティングシステム 101…スレッド管理部 200,400…スレッド制御システム 201,301,401…スケジュール部 202,302…実行優先度設定部 203,303…待機優先度設定部 304…タイマ待ち部 305…イベント待ち部 306…イベント待ち優先度設定部 307…イベント待ち解除時処理部 310…スケジュール起動スレッド 311…スケジュールイベント発生部 402…優先度情報保持部 403…優先度管理部 404…優先度変換部 405…優先度対応表 DESCRIPTION OF SYMBOLS 1 ... CPU 2 ... System memory 3 ... External storage device 4 ... Input device 5 ... Output device 100 ... Operating system 101 ... Thread management unit 200, 400 ... Thread control system 201, 301, 401 ... Schedule unit 202, 302 ... Execution priority Degree setting units 203, 303 ... Waiting priority setting unit 304 ... Timer waiting unit 305 ... Event waiting unit 306 ... Event waiting priority setting unit 307 ... Event waiting cancellation processing unit 310 ... Schedule start thread 311 ... Schedule event generating unit 402 Priority information holding unit 403 Priority management unit 404 Priority conversion unit 405 Priority correspondence table

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 CPUを割り当てる際の制御単位となる
スレッドに付与される実行優先度を固定的に指定可能な
オペレーティングシステム下で動作するスレッド制御シ
ステムであって、 実行状態にあるスレッドの実行優先度を第1の値に設定
し直す第1の設定手段と、 実行可能状態にあるスレッドの実行優先度を前記第1の
値よりも優先度の高い第2の値に設定し直す第2の設定
手段と、 次に実行すべきスレッドをすべてのスレッドの中から選
択し、この選択したスレッドの実行優先度を前記第2の
設定手段を用いて前記第2の値に設定し直すとともに、
実行状態にあるスレッドの実行優先度を前記第1の設定
手段を用いて前記第1の値に設定し直すことにより、前
記オペレーティングシステムに前記選択したスレッドへ
の切り換えを実行させるスケジュール手段とを具備する
ことを特徴とするスレッド制御システム。
1. A thread control system operating under an operating system capable of fixedly specifying an execution priority given to a thread as a control unit when allocating a CPU, wherein the execution priority of a thread in an execution state is provided. First setting means for resetting the degree to the first value, and second setting for resetting the execution priority of the thread in the executable state to a second value higher in priority than the first value. Setting means, selecting a thread to be executed next from all threads, resetting the execution priority of the selected thread to the second value using the second setting means,
Scheduling means for causing the operating system to execute switching to the selected thread by resetting the execution priority of the thread in the execution state to the first value using the first setting means. A thread control system.
【請求項2】 CPUを割り当てる際の制御単位となる
スレッドに付与される実行優先度を固定的に指定可能な
オペレーティングシステム下で動作し、第1の値の実行
優先度が付与される前記スレッドの切り換えを発生させ
るためのスケジュールスレッドと、前記第1の値よりも
優先度の低い第2の値の実行優先度が付与される前記ス
ケジュールスレッドを起動させるためのスケジュール起
動スレッドとからなるスレッド制御システムであって、 前記スケジュールスレッドは、 実行可能状態または待機状態にあるスレッドの実行優先
度を前記第1の値よりも優先度が低く前記第2の値より
も優先度の高い第3の値に設定し直す第1の設定手段
と、 実行状態にあるスレッドの実行優先度を前記第2の値よ
りも優先度の低い第4の値に設定し直す第2の設定手段
と、 次に実行すべきスレッドを実行可能状態にあるすべての
スレッドの中から選択し、この選択したスレッドの実行
優先度を前記第1の設定手段を用いて前記第3の値に設
定し直すとともに、前記実行状態のスレッドの実行優先
度を前記第2の設定手段を用いて前記第4の値に設定し
直すことにより、前記オペレーティングシステムに前記
選択したスレッドへの切り換えを実行させるスケジュー
ル手段とを具備することを特徴とするスレッド制御シス
テム。
2. The thread which operates under an operating system in which an execution priority given to a thread as a control unit when allocating a CPU can be fixedly designated, and which is given a first value of execution priority. And a schedule start thread for starting the schedule thread to be given a second value execution priority lower in priority than the first value. The system, wherein the schedule thread sets an execution priority of a thread in an executable state or a standby state to a third value having a lower priority than the first value and a higher priority than the second value. First setting means for resetting the execution priority of the thread in the execution state to a fourth value lower in priority than the second value A second setting unit, and a thread to be executed next is selected from all the threads in an executable state, and the execution priority of the selected thread is set to the third thread by using the first setting unit. By resetting the execution priority of the thread in the execution state to the fourth value by using the second setting means, the operating system switches the execution thread to the selected thread. A thread control system comprising: a scheduler for executing the thread control.
【請求項3】 CPUを割り当てる際の制御単位となる
スレッドに付与される実行優先度を固定的に指定可能な
オペレーティングシステム下で動作し、第1の値の実行
優先度が付与される前記スレッドの切り換えを発生させ
るためのスケジュールスレッドと、前記第1の値よりも
優先度の低い第2の値の実行優先度が付与される前記ス
ケジュールスレッドを起動させるためのスケジュール起
動スレッドとからなるスレッド制御システムであって、 前記スケジュールスレッドは、 実行状態でイベント待ちスレッドの実行優先度を前記第
1の値よりも優先度の高い第3の値に設定し直す第1の
設定手段と、 実行可能状態または待機状態にあるスレッドの実行優先
度を前記第1の値よりも優先度が低く前記第2の値より
も優先度の高い第4の値に設定し直す第2の設定手段
と、 実行状態にあるスレッドの実行優先度を前記第2の値よ
りも優先度の低い第5の値に設定し直す第3の設定手段
と、 前記イベント待ちが解放されたときに予め呼び出される
ように設定され、前記第3の優先度の値に設定されたス
レッドの実行優先度を前記第4の値または第5の値に設
定し直す第4の設定手段と、 実行状態から待機状態に移行したスレッドがあるとき
に、このスレッドの実行優先度を前記第1の設定手段を
用いて前記第3の値に設定し直し、次に実行すべきスレ
ッドを実行可能状態にあるすべてのスレッドの中から選
択し、この選択したスレッドの実行優先度を前記第2の
設定手段を用いて前記第4の値に設定し、前記第3の値
に設定されたスレッドが待機状態から解放されて実行状
態に戻った際、前記第3の値に設定されたスレッドと前
記第4の値に設定されたスレッドとの優先度に基づき、
その実行優先度を前記第4の設定手段を用いて前記第4
または第5の値に設定し直し、これにより前記第3の値
のスレッドが第4の値に設定される場合には、前記第4
の値に設定されたスレッドの実行優先度を前記第4の設
定手段を用いて前記第5の値に設定し直すことにより、
前記オペレーティングシステムに前記選択したスレッド
への切り換えを実行させるスケジュール手段とを具備す
ることを特徴とするスレッド制御システム。
3. The thread which operates under an operating system in which an execution priority given to a thread as a control unit when allocating a CPU can be fixedly designated, and to which a first value of execution priority is given And a schedule start thread for starting the schedule thread to be given a second value execution priority lower in priority than the first value. A scheduler, wherein the schedule thread resets an execution priority of an event waiting thread in an execution state to a third value having a higher priority than the first value, and an executable state. Alternatively, the execution priority of the thread in the waiting state is set to a fourth value having a lower priority than the first value and a higher priority than the second value. Second setting means for resetting; third setting means for resetting the execution priority of the thread in the execution state to a fifth value lower in priority than the second value; A fourth setting unit that is set so as to be called in advance when the thread is released, and resets the execution priority of the thread set to the third priority value to the fourth value or the fifth value When there is a thread that has transitioned from the execution state to the standby state, the execution priority of this thread is reset to the third value using the first setting means, and the next thread to be executed is executed. A thread selected from all threads in the enabled state, the execution priority of the selected thread is set to the fourth value using the second setting means, and the thread set to the third value is set. Was released from standby and returned to running Based on the priority of said third and set thread value the fourth set thread value,
The execution priority is set to the fourth setting value using the fourth setting means.
Alternatively, when the thread of the third value is set to the fourth value, the fourth value is set to the fourth value.
By resetting the execution priority of the thread set to the value of to the fifth value using the fourth setting means,
Scheduling means for causing the operating system to execute switching to the selected thread.
【請求項4】 前記スケジュールスレッドは、 前記オペレーティングのタイムスライスよりも短い予め
定められた間隔で前記スケジュール手段を繰り返し起動
させるタイマ起動手段と、 予め定められたイベントが発生したことを前記スケジュ
ール起動スレッドによって判断されたことを受けて前記
スケジュール手段を起動させるイベント起動手段とをさ
らに具備することを特徴とする請求項2または3記載の
スレッド制御システム。
4. The schedule thread, wherein the schedule thread comprises: timer activation means for repeatedly activating the schedule means at a predetermined interval shorter than a time slice of the operating; and a schedule activation thread for notifying that a predetermined event has occurred. 4. The thread control system according to claim 2, further comprising an event activating means for activating said scheduling means in response to the determination made by the thread control means.
【請求項5】 前記オペレーティングシステムが管理す
る実行優先度とは独立した独自の優先度をスレッドそれ
ぞれに付与するための独自優先度管理手段をさらに具備
し、 前記スケジュール手段は、前記独自優先度管理手段によ
り管理された独自の優先度に基づいて次に実行すべきス
レッドを選択することを特徴とする請求項1、2、3ま
たは4記載のスレッド制御システム。
5. An independent priority management unit for assigning a unique priority to each thread independently of an execution priority managed by the operating system, wherein the scheduling unit performs the unique priority management. 5. The thread control system according to claim 1, wherein a thread to be executed next is selected based on a unique priority managed by the means.
【請求項6】 前記オペレーティングシステムが管理す
る実行優先度と前記独自の優先度との対応関係を保持
し、前記オペレーティングシステムが管理する実行優先
度を前記独自の優先度に変換する優先度変換手段をさら
に具備することを特徴とする請求項5記載のスレッド制
御システム。
6. A priority conversion means for maintaining a correspondence between an execution priority managed by the operating system and the unique priority, and converting an execution priority managed by the operating system into the unique priority. The thread control system according to claim 5, further comprising:
【請求項7】 CPUを割り当てる際の制御単位となる
スレッドに付与される実行優先度を固定的に指定可能な
オペレーティングシステム下で動作するスレッド制御シ
ステムに適用されるスレッド制御方法であって、 次に実行すべきスレッドをすべてのスレッドの中から選
択し、この選択したスレッドの実行優先度を第1の値に
設定し直すとともに、実行状態にあるスレッドの実行優
先度を前記第1の値よりも優先度の低い第2の値に設定
し直すことにより、前記オペレーティングシステムに前
記選択したスレッドへの切り換えを実行させることを特
徴とするスレッド制御方法。
7. A thread control method applied to a thread control system operating under an operating system capable of fixedly specifying an execution priority given to a thread as a control unit when allocating a CPU, comprising: The thread to be executed is selected from among all the threads, the execution priority of the selected thread is reset to the first value, and the execution priority of the thread in the execution state is changed from the first value. A thread control method for causing the operating system to execute switching to the selected thread by resetting the operating system to a second value having a lower priority.
【請求項8】 CPUを割り当てる際の制御単位となる
スレッドに付与される実行優先度を固定的に指定可能な
オペレーティングシステム下で動作し、第1の値の実行
優先度が付与される前記スレッドの切り換えを発生させ
るためのスケジュールスレッドと、前記第1の値よりも
優先度の低い第2の値の実行優先度が付与される前記ス
ケジュールスレッドを起動させるためのスケジュール起
動スレッドと、実行可能状態または待機状態にあるスレ
ッドの実行優先度を前記第1の値よりも優先度が低く前
記第2の値よりも優先度の高い第3の値に設定し直す第
1の設定手段と、実行状態にあるスレッドの実行優先度
を前記第2の値よりも優先度の低い第4の値に設定し直
す第2の設定手段とからなるスレッド制御システムに適
用されるスレッド制御方法であって、 次に実行すべきスレッドを実行可能状態にあるすべての
スレッドの中から選択し、この選択したスレッドの実行
優先度を前記第1の設定手段を用いて前記第3の値に設
定し直すとともに、前記実行状態のスレッドの実行優先
度を前記第2の設定手段を用いて前記第4の値に設定し
直すことにより、前記オペレーティングシステムに前記
選択したスレッドへの切り換えを実行させることを特徴
とするスレッド制御方法。
8. The thread which operates under an operating system in which an execution priority given to a thread as a control unit when allocating a CPU can be fixedly designated, and to which an execution priority of a first value is given. A schedule thread for causing the switching of the schedule thread, a schedule start thread for starting the schedule thread to which a second value of execution priority lower than the first value is given, and an executable state Or first setting means for resetting the execution priority of the thread in the standby state to a third value lower in priority than the first value and higher in priority than the second value; and And a second setting means for resetting the execution priority of the thread in the second step to a fourth value lower in priority than the second value. A thread to be executed next is selected from all threads in an executable state, and the execution priority of the selected thread is set to the third value by using the first setting means. And the operating system switches to the selected thread by resetting the execution priority of the thread in the execution state to the fourth value using the second setting means. A thread control method.
【請求項9】 CPUを割り当てる際の制御単位となる
スレッドに付与される実行優先度を固定的に指定可能な
オペレーティングシステム下で動作し、第1の値の実行
優先度が付与される前記スレッドの切り換えを発生させ
るためのスケジュールスレッドと、前記第1の値よりも
優先度の低い第2の値の実行優先度が付与される前記ス
ケジュールスレッドを起動させるためのスケジュール起
動スレッドと、実行状態でイベント待ちスレッドの実行
優先度を前記第1の値よりも優先度の高い第3の値に設
定し直す第1の設定手段と、実行可能状態または待機状
態にあるスレッドの実行優先度を前記第1の値よりも優
先度が低く前記第2の値よりも優先度の高い第4の値に
設定し直す第2の設定手段と、実行状態にあるスレッド
の実行優先度を前記第2の値よりも優先度の低い第5の
値に設定し直す第3の設定手段と、前記イベント待ちが
解放されたときに予め呼び出されるように設定され、前
記第3の優先度の値に設定されたスレッドの実行優先度
を前記第4の値または第5の値に設定し直す第4の設定
手段とからなるスレッド制御システムに適用されるスレ
ッド制御方法であって、 実行状態から待機状態に移行したスレッドがあるとき
に、このスレッドの実行優先度を前記第1の設定手段を
用いて前記第3の値に設定し直し、次に実行すべきスレ
ッドを実行可能状態にあるすべてのスレッドの中から選
択し、この選択したスレッドの実行優先度を前記第2の
設定手段を用いて前記第4の値に設定し、前記第3の値
に設定されたスレッドが待機状態から解放されて実行状
態に戻った際、前記第3の値に設定されたスレッドと前
記第4の値に設定されたスレッドとの優先度に基づき、
その実行優先度を前記第4の設定手段を用いて前記第4
または第5の値に設定し直し、これにより前記第3の値
のスレッドが前記第4の値に設定される場合には、前記
第4の値に設定されたスレッドの実行優先度を前記第4
の設定手段を用いて前記第5の値に設定し直すことによ
り、前記オペレーティングシステムに前記選択したスレ
ッドへの切り換えを実行させることを特徴とするスレッ
ド制御方法。
9. The thread which operates under an operating system in which an execution priority given to a thread as a control unit when allocating a CPU can be fixedly designated, and to which an execution priority of a first value is given A schedule thread for causing the switching of the schedule thread, a schedule start thread for starting the schedule thread to which a second value of the execution priority lower than the first value is given, and First setting means for resetting the execution priority of the event waiting thread to a third value higher in priority than the first value; and setting the execution priority of the thread in the executable state or the standby state to the third value. A second setting unit for resetting the priority to a fourth value having a lower priority than the value of 1 and a higher priority to the second value; and setting the execution priority of the thread in the execution state to the fourth value. A third setting means for resetting to a fifth value lower in priority than the second value, and a third priority value set to be called in advance when the event wait is released And a fourth setting means for resetting the execution priority of the thread set to the fourth value or the fifth value to a thread control system, the method comprising: When there is a thread that has transitioned to the state, the execution priority of this thread is reset to the third value using the first setting means, and all the threads to be executed next are set to the executable state. A thread is selected from the threads, and the execution priority of the selected thread is set to the fourth value by using the second setting means, and the thread set to the third value is released from the standby state. Return to the running state Based on the priority of the thread set to the third value and the thread set to the fourth value,
The execution priority is set to the fourth setting value using the fourth setting means.
Alternatively, when the thread having the third value is set to the fourth value, the execution priority of the thread set to the fourth value is changed to the fifth value. 4
And causing the operating system to execute switching to the selected thread by resetting the thread to the fifth value using the setting means.
JP10367838A 1998-12-24 1998-12-24 System and method for thread control Pending JP2000194573A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10367838A JP2000194573A (en) 1998-12-24 1998-12-24 System and method for thread control

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10367838A JP2000194573A (en) 1998-12-24 1998-12-24 System and method for thread control

Publications (1)

Publication Number Publication Date
JP2000194573A true JP2000194573A (en) 2000-07-14

Family

ID=18490329

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10367838A Pending JP2000194573A (en) 1998-12-24 1998-12-24 System and method for thread control

Country Status (1)

Country Link
JP (1) JP2000194573A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002196939A (en) * 2000-12-27 2002-07-12 Nec Corp Start/finish control device of resident process and its control method and recording medium for recording method
JP2008538043A (en) * 2005-04-13 2008-10-02 クゥアルコム・インコーポレイテッド Technology for setting events in a multithreaded system
CN112306657A (en) * 2020-10-30 2021-02-02 上海二三四五网络科技有限公司 Control method and device for realizing linear countdown of multiple events based on priority sequencing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002196939A (en) * 2000-12-27 2002-07-12 Nec Corp Start/finish control device of resident process and its control method and recording medium for recording method
JP2008538043A (en) * 2005-04-13 2008-10-02 クゥアルコム・インコーポレイテッド Technology for setting events in a multithreaded system
US8255912B2 (en) 2005-04-13 2012-08-28 Qualcomm Incorporated Techniques for setting events in a multi-threaded system
CN112306657A (en) * 2020-10-30 2021-02-02 上海二三四五网络科技有限公司 Control method and device for realizing linear countdown of multiple events based on priority sequencing

Similar Documents

Publication Publication Date Title
US8468540B2 (en) Interrupt and exception handling for multi-streaming digital processors
KR20050030871A (en) Method and system for performing real-time operation
JPH0954699A (en) Process scheduler of computer
US6795873B1 (en) Method and apparatus for a scheduling driver to implement a protocol utilizing time estimates for use with a device that does not generate interrupts
JP5726006B2 (en) Task and resource scheduling apparatus and method, and control apparatus
JP2001306341A (en) Computer system and computer readable recording medium
EP0913770A2 (en) Method and apparatus for sharing a time quantum
JP2000194573A (en) System and method for thread control
JP2001117786A (en) Process scheduling device and process scheduling method
JP3893136B2 (en) Embedded computer control program, recording medium recording the program, and embedded system
JPH08152903A (en) Multiprocessor system
CN114035926A (en) Application thread scheduling method and device, storage medium and electronic equipment
JP2009541852A (en) Computer micro job
KR100651722B1 (en) Method of configuring Linux kernel for supporting real time performance and test method for supporting real time performance
JP2019079336A (en) Numerical control device
JPH09251389A (en) Data processor
WO2000070482A1 (en) Interrupt and exception handling for multi-streaming digital processors
JPH1063515A (en) Scheduling method for multitask control
JPH01292539A (en) Task schedule device
JP2836468B2 (en) Cooperative scheduling method for parallel jobs
CN110109743B (en) Real-time process scheduling method
JPS60181934A (en) Task priority degree controlling system
JP2001229038A (en) Multi-operating computer system
JPH0877029A (en) Processing request execution order control system based upon load rate
Wang et al. Providing real-time support in the Linux kernel