JPH0612394A - Process schedule system - Google Patents

Process schedule system

Info

Publication number
JPH0612394A
JPH0612394A JP16722992A JP16722992A JPH0612394A JP H0612394 A JPH0612394 A JP H0612394A JP 16722992 A JP16722992 A JP 16722992A JP 16722992 A JP16722992 A JP 16722992A JP H0612394 A JPH0612394 A JP H0612394A
Authority
JP
Japan
Prior art keywords
resource
processes
block
processor
scheduler
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
JP16722992A
Other languages
Japanese (ja)
Inventor
Kazuyoshi Negishi
和義 根岸
Koichiro Ishihara
孝一郎 石原
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 JP16722992A priority Critical patent/JPH0612394A/en
Publication of JPH0612394A publication Critical patent/JPH0612394A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform exclusive control over a resource without any overhead of process switching by limiting the number of processes to be spun at the same time, prevent processor capability from wastefully being used owing to the spinning, and entering a resource wait state by a spinning system when the number of competition is small. CONSTITUTION:When requests to use a resource in a resource control table 3 are made from processes represented in process control tables 2a-2d at the same time, one process is allowed to use the resource and a predetermined number of processes from among the remaining processes are placed in the resource wait state by the spinning system; when there are still processes which are not included, the processes are suspended and switched to processes which do not other resources, thereby carrying on the processing on a processor.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はメモリを共用するマルチ
プロセッサシステムにおけるプロセスのスケジューリン
グ方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a process scheduling method in a multiprocessor system sharing a memory.

【0002】[0002]

【従来の技術】メモリを共用するマルチプロセッサシス
テムにおけるリソース競合時のプロセススケジューリン
グ方式として、従来は1個のプロセスのみがリソースを
使用し、残りのプロセスはプロセッサ上でループしてリ
ソースの開放を待つ方式(スピン方式)、および残りの
プロセスは処理を中断して、別のリソースを要求してい
ないプロセスに切り替えて実行を行う方式(サスペンド
方式)が採用されてきた。
2. Description of the Related Art As a process scheduling method in the case of resource competition in a multiprocessor system sharing a memory, conventionally only one process uses the resource, and the remaining processes loop on the processor to wait for the release of the resource. A method (spin method) and a method (suspend method) of interrupting the processing of the remaining processes and switching to another process not requesting the resource and executing the method have been adopted.

【0003】また、特開平1−261771に示すよう
に、スピン方式の改良案として、通常のリソース待ちに
はスピン方式を使用し、リソースを使用中のプロセスが
割り込み処理等により処理を中断した場合のみ、当該リ
ソースを要求するプロセスを中断する方式も提案されて
いる。
Further, as disclosed in Japanese Patent Laid-Open No. 1-2671771, when a spin method is used for waiting for a normal resource and a process using the resource interrupts the processing due to an interrupt process or the like, as an improvement plan of the spin method. Only, a method of interrupting the process requesting the resource is also proposed.

【0004】[0004]

【発明が解決しようとする課題】従来の方式の内、スピ
ン方式ではスピン中はプロセッサは何も有効な処理をせ
ず、リソースの占有時間が長いと、これによるプロセッ
サの処理能力の無駄が無視できない。また、サスペンド
方式では、リソースを占有して処理を行う時間に比較し
てプロセスの切り替えに要するオーバヘッドが大きい場
合、処理能力の無駄が無視できない。
Among the conventional methods, in the spin method, the processor does not perform any effective processing during the spin, and if the resource is occupied for a long time, the waste of the processing capacity of the processor is neglected. Can not. Further, in the suspend method, when the overhead required for process switching is large compared to the time for occupying resources and performing processing, waste of processing capacity cannot be ignored.

【0005】本発明の目的は、プロセスの切り替えに要
するオーバヘッドを少なくしたプロセススケジュール方
式を提供することにある。
It is an object of the present invention to provide a process scheduling method that reduces the overhead required for process switching.

【0006】[0006]

【課題を解決するための手段】この問題を解決するた
め、スピン方式の拡張として、スピン待ちしているプロ
セスの数を限定し、一定の個数以上のプロセスはサスペ
ンド方式により中断させる方式を提案した。
To solve this problem, as an extension of the spin method, a method has been proposed in which the number of processes waiting for spin is limited, and a certain number or more of processes are suspended by the suspend method. .

【0007】[0007]

【作用】スピン方式による待ちのオーバヘッドを限定す
る。サスペンドによりプロセスが切り替えられるオーバ
ヘッドよりスピンし続けたオーバヘッドの方が多くなる
ように、前記のスピンするプロセス数の最大値を設定す
る。
Function: The waiting overhead of the spin method is limited. The maximum value of the number of processes to be spun is set so that the overhead of continuously spinning is larger than the overhead of switching processes by suspending.

【0008】[0008]

【実施例】以下、本発明の一実施例を説明する。第1図
は本発明の概要を表す。プロセスは主メモリ上のプロセ
ッサ管理テーブル2a〜2dで管理される。プロセスス
ケジューラ5はプロセス管理テーブル2a〜2dのいず
れかをプロセッサ1a〜1bに対応付けることにより、
そのプロセスを当該プロセッサに実行させる。リソース
管理テーブル3は、リソースを管理するテーブルであ
り、リソース状態8(「使用中」または「未使用」に設
定される)を含む。プロセス管理テーブル2a〜2d中
のプロセス状態6a〜6dは各々、「リソース未使用実
行中」、「リソース使用実行中」、「リソース未使用実
行待ち」、「リソース使用実行待ちスピン」、「リソー
ス使用実行待ちサスペンド」の5状態のいずれかに設定
される。また、プロセススケジューラ5の処理を同時に
は1台のプロセッサにのみ許すようにするため、スケジ
ューラロック7(「使用中」または「未使用」に設定さ
れる)を使用する。
EXAMPLE An example of the present invention will be described below. FIG. 1 shows the outline of the present invention. The process is managed by the processor management tables 2a to 2d on the main memory. The process scheduler 5 associates any of the process management tables 2a to 2d with the processors 1a to 1b,
Causes the processor to execute the process. The resource management table 3 is a table for managing resources and includes a resource status 8 (set to “in use” or “unused”). The process states 6a to 6d in the process management tables 2a to 2d are respectively "resource unused execution", "resource usage executing", "resource unused execution waiting", "resource usage execution waiting spin", and "resource usage". It is set to one of the five states of "suspend for execution". Further, a scheduler lock 7 (set to “in use” or “not used”) is used to allow only one processor to process the process scheduler 5 at the same time.

【0009】第2図はプロセスがリソースを要求した時
の、プロセススケジューラの処理の流れを示す。まず、
後述のスケジューラロッの確保サブルーチンをコールし
てスケジューラロックを確保する(ブロック211)。
次に、リソースが他のプロセスにより使用中かどうかを
チェックし(ブロック212)、使用中でなければリソ
ース状態を使用中に変更し(ブロック211)、自プロ
セスの状態を「リソース使用中実行中」に変更し(ブロ
ック222)、スケジューラロックを未使用に設定し
(ブロック223)、プロセスの実行を続行する(ブロ
ック224)。また、リソースが使用中の場合は、すで
に「リソース使用実行待ちスピン」状態で待っているプ
ロセスの個数があらかじめ定められたプロセススピン上
限数より小さいかをチェックする(ブロック213)。
前者が小さい場合は、プロセスの状態を「リソース使用
実行待ちスピン」状態とし(ブロック214)、スケジ
ューラロックを未使用に設定し(ブロック215)、定
められた時間スピンした後(ブロック216)、ブロッ
ク211に戻り、スケジューラロックを再度確保した
後、リソースが開放されているかをチェックする。ブロ
ック213において、前者が大きいか等しい場合は、プ
ロセスを中断し、もし再度起動された場合本ルーチンの
スタート箇所より処理を再開するように設定し(ブロッ
ク201)、プロセスの状態を「リソース使用実行待ち
サスペンド」とし(ブロック202)、他にプロセス状
態が「リソース未使用実行待ち」状態のプロセスがない
かチェックする(ブロック203)。このようなプロセ
スがない場合、スケジューラロックを未使用に設定し
(ブロック217)、プロセッサはアイドル状態となる
(ブロック218)。ブロック203の条件に合うプロ
セスが存在する場合、見つけたプロセスの状態を「リソ
ース使用実行中」に変更し(ブロック204)、スケジ
ューラロックを未使用に設定し(ブロック205)、そ
のプロセスの実行を開始する(ブロック206)。
FIG. 2 shows a process flow of the process scheduler when a process requests a resource. First,
A scheduler lock reservation subroutine, which will be described later, is called to reserve a scheduler lock (block 211).
Next, it is checked whether the resource is being used by another process (block 212), and if it is not being used, the resource state is changed to being used (block 211), and the state of the own process is changed to "resource in use executing". (Block 222), sets the scheduler lock to unused (block 223), and continues execution of the process (block 224). If the resource is in use, it is checked whether the number of processes waiting in the "resource use execution waiting spin" state is smaller than the predetermined process spin upper limit number (block 213).
If the former is small, the process state is set to the "resource use execution waiting spin" state (block 214), the scheduler lock is set to unused (block 215), and after spinning for a predetermined time (block 216), the block Returning to step 211, after securing the scheduler lock again, it is checked whether the resource is released. In block 213, if the former is greater than or equal to, the process is interrupted, and if it is restarted, it is set to restart the process from the start point of this routine (block 201), and the process state is set to "resource use execution". It is set to "suspend wait" (block 202), and it is checked whether there is any other process whose process status is "waiting for resource unused execution" (block 203). If there is no such process, the scheduler lock is set to unused (block 217) and the processor goes idle (block 218). If there is a process that meets the conditions of block 203, the status of the found process is changed to "resource in use" (block 204), the scheduler lock is set to unused (block 205), and the process is executed. Begin (block 206).

【0010】第3図はリソース使用中のプロセスがリソ
ースを開放した場合の処理の流れを示す。まず、サブル
ーチンのコールによりスケジューラロックを確保する
(ブロック311)。次に、他のプロセスで状態が「リ
ソース使用実行待ちスピン」のプロセスがないかチェッ
クする(ブロック312)。このようなプロセスがあれ
ば、自プロセスの状態を「リソース未使用実行中」に変
更し、次に実行するプロセスとする(ブロック31
5)。さらに、アイドル中のプロセッサがあり(ブロッ
ク314)、プロセスの状態が「リソース未使用実行待
ち」のプロセスがあれば(ブロック315)、見つけた
プロセスの状態を「リソース未使用実行中」に変更し、
アイドル中のプロセッサの一つに実行を開始させる(ブ
ロック316)。そして、ブロック314に戻りチェッ
クを繰り返す。ブロック314またはブロック315で
条件を満たすプロセッサまたはプロセスが存在しない場
合、スケジューラロックを未使用に設定し(ブロック3
01)、先に次に実行することに決定したプロセスの処
理を開始する(ブロック302)。また、ブロック31
2で条件を満たすプロセスがなければ、次にプロセス状
態が「リソース使用実行待ちサスペンド」のプロセスが
ないかチェックし(ブロック321)、なければブロッ
ク313へ行く。もし、このようなプロセスがあれば、
見つけたプロセスの状態を「リソース使用実行中」に変
更して次に実行するプロセスとし(ブロック322)、
もとのプロセスの状態を「リソース未使用実行待ち」に
変更し(ブロック323)、ブロック314のチェック
へ行く。
FIG. 3 shows the flow of processing when a process using a resource releases the resource. First, a scheduler lock is secured by calling a subroutine (block 311). Next, it is checked whether there is another process whose status is "spin for resource use execution" (block 312). If there is such a process, the status of the own process is changed to “resource unused execution”, and the process is executed next (block 31).
5). Furthermore, if there is an idle processor (block 314) and there is a process whose status is "waiting for resource unused execution" (block 315), the status of the found process is changed to "resource unused running". ,
Cause one of the idle processors to begin execution (block 316). Then, the process returns to block 314 and the check is repeated. If there is no processor or process that meets the conditions in block 314 or block 315, set the scheduler lock to unused (block 3
01), the processing of the process which is first decided to be executed next is started (block 302). Also, block 31
If there is no process satisfying the condition in 2, then it is checked whether or not there is a process whose process status is "suspension of use of resource waiting" (block 321). If there is no process, the process proceeds to block 313. If there is such a process,
The state of the found process is changed to "resource in use" and the next process is executed (block 322).
The state of the original process is changed to "waiting for resource unused execution" (block 323), and the process goes to the check in block 314.

【0011】第4図はスケジューラロックの確保を行う
サブルーチンの処理の流れを表す。まずスケジューラロ
ックの状態をチェックし、未使用なら使用中に変更する
(ブロック401)。このチェツクと設定の処理は、メ
モリ共用のマルチプロセッサで一般に用いられるTes
t and Set命令などにより他のプロセッサによ
り割り込まれることなしに、実行する必要がある。も
し、スケジューラロックが未使用で上記処理が成功すれ
ば、そのままコール元へリターンする(ブロック40
3)。もし、スケジューラロックが使用中で、上記処理
が失敗すれば、定められた時間スピンした後、再度ブロ
ック401の設定を試みる(ブロック402)。
FIG. 4 shows a processing flow of a subroutine for securing a scheduler lock. First, the status of the scheduler lock is checked, and if it is not used, it is changed to being used (block 401). This check and setting process is performed by Tes which is generally used in a multiprocessor sharing a memory.
It must be executed without being interrupted by another processor, such as by a t and Set instruction. If the scheduler lock is unused and the above process is successful, the process directly returns to the call source (block 40).
3). If the scheduler lock is in use and the above process fails, the setting of block 401 is tried again after spinning for a predetermined time (block 402).

【0012】[0012]

【発明の効果】リソースに対して同時にスピン待ちに入
ることのできるプロセス数が限定されるため、長時間の
スピン待ちが防止され、適切なオーバヘッドにより、デ
ータベースの処理が実行可能である。
Since the number of processes that can enter the spin wait for the resource at the same time is limited, the spin wait for a long time is prevented, and the database processing can be executed with an appropriate overhead.

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

【図1】プロセススケジューラのシステム構成図を示
す。
FIG. 1 shows a system configuration diagram of a process scheduler.

【図2】プロセスのリソース要求時の処理の流れを示
す。
FIG. 2 shows a process flow when a process resource is requested.

【図3】プロセスのリソース開放時の処理の流れを示
す。
FIG. 3 shows a process flow when releasing resources of a process.

【図4】スケジューラロックの確保時の処理の流れを示
す。
FIG. 4 shows a flow of processing when securing a scheduler lock.

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

1a〜1b:プロセッサ、2a〜2d:プロセス管理ブ
ロック、3:ロック管理テーブル、4:主メモリ、5:
プロセススケジューラ。
1a-1b: Processor, 2a-2d: Process management block, 3: Lock management table, 4: Main memory, 5:
Process scheduler.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】主メモリを共用するマルチプロセッサ上
で、複数のプロセスとこれをスケジュールするプロセス
スケジューラを有し、各プロセスは1個しかない資源
(リソース)を使用する処理と使用しない処理を交互に
プロセッサ上で実行し、プロセッサ上で実行中の複数の
プロセスが同時にリソースを使用しようとした時、1個
のプロセスのみがリソースを使用して処理を行い、残り
のプロセスのうちあらかじめ定められた個数を上限とす
るプロセスはループによりプロセッサ上でリソースの使
用終了を待ち、上限数を越える残りのプロセスは処理を
中断して別のリソースを使用しないプロセスを捜し、も
しあればこのプロセスに切り替えてプロセッサ上での処
理を継続することを特徴とするプロセススケジュール方
式。
1. A multiprocessor that shares a main memory, has a plurality of processes and a process scheduler that schedules the processes, and each process alternates a process that uses only one resource and a process that does not use it. When multiple processes running on the processor try to use the resource at the same time, only one process uses the resource for processing, and among the remaining processes, the predetermined process is performed. A process with a maximum number of processes waits for resources to be used on the processor in a loop, and the remaining processes that exceed the maximum number of processes stop processing and search for a process that does not use another resource, and switch to this process if any. A process scheduling method characterized by continuing processing on a processor.
JP16722992A 1992-06-25 1992-06-25 Process schedule system Pending JPH0612394A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16722992A JPH0612394A (en) 1992-06-25 1992-06-25 Process schedule system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16722992A JPH0612394A (en) 1992-06-25 1992-06-25 Process schedule system

Publications (1)

Publication Number Publication Date
JPH0612394A true JPH0612394A (en) 1994-01-21

Family

ID=15845849

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16722992A Pending JPH0612394A (en) 1992-06-25 1992-06-25 Process schedule system

Country Status (1)

Country Link
JP (1) JPH0612394A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011129024A (en) * 2009-12-21 2011-06-30 Renesas Electronics Corp Data processing system and data processing method
WO2011096163A1 (en) * 2010-02-03 2011-08-11 日本電気株式会社 Information processing system, exclusive control method, and program for exclusive control
JP2016530625A (en) * 2013-08-14 2016-09-29 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, system, and program for efficient task scheduling using a locking mechanism

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011129024A (en) * 2009-12-21 2011-06-30 Renesas Electronics Corp Data processing system and data processing method
WO2011096163A1 (en) * 2010-02-03 2011-08-11 日本電気株式会社 Information processing system, exclusive control method, and program for exclusive control
JP2016530625A (en) * 2013-08-14 2016-09-29 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, system, and program for efficient task scheduling using a locking mechanism
US10579413B2 (en) 2013-08-14 2020-03-03 International Business Machines Corporation Efficient task scheduling using a locking mechanism

Similar Documents

Publication Publication Date Title
US5390329A (en) Responding to service requests using minimal system-side context in a multiprocessor environment
JP5324934B2 (en) Information processing apparatus and information processing method
US7926062B2 (en) Interrupt and exception handling for multi-streaming digital processors
US7765546B2 (en) Interstream control and communications for multi-streaming digital processors
US20040139306A1 (en) Partial and start-over threads in embedded real-time kernel
JPH0628323A (en) Process execution control method
JPH0612394A (en) Process schedule system
JP2001117786A (en) Process scheduling device and process scheduling method
JP3005562B1 (en) Task management device and task scheduling method
WO2000070482A1 (en) Interrupt and exception handling for multi-streaming digital processors
JPH05108380A (en) Data processing system
JPH05113887A (en) Computer system
JPH0644234B2 (en) Task management device
JPH11249917A (en) Parallel computers, their batch processing method, and storage medium
JP2000047881A (en) Real-time system
JPH087689B2 (en) Task control method
JPH06214811A (en) Scheduling system
JPS59170950A (en) Task priority control system
CN117850995A (en) Coroutine scheduling method, coroutine scheduling device and storage medium
JPH01261730A (en) Cpu resource averaging system
JPH064323A (en) Multiprocessor system
JPH04338837A (en) Process schedule system
JPH01216432A (en) Multitask system
JPH04312132A (en) Task scheduling system
JPS60147845A (en) System for controlling load of circulating pipeline type data flow computer