JPH02171952A - Dispatching system for multiprocessor - Google Patents

Dispatching system for multiprocessor

Info

Publication number
JPH02171952A
JPH02171952A JP32579688A JP32579688A JPH02171952A JP H02171952 A JPH02171952 A JP H02171952A JP 32579688 A JP32579688 A JP 32579688A JP 32579688 A JP32579688 A JP 32579688A JP H02171952 A JPH02171952 A JP H02171952A
Authority
JP
Japan
Prior art keywords
task
processor
processing
queue
wait
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
JP32579688A
Other languages
Japanese (ja)
Inventor
Masaaki Iwasaki
正明 岩嵜
Yoshifumi Takamoto
良史 高本
Toshiharu Shinozaki
篠崎 俊春
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 JP32579688A priority Critical patent/JPH02171952A/en
Priority to DE1989625064 priority patent/DE68925064T2/en
Priority to EP19890109410 priority patent/EP0343646B1/en
Publication of JPH02171952A publication Critical patent/JPH02171952A/en
Priority to US07/940,347 priority patent/US5274809A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PURPOSE:To reduce the lock competition of a task control queue by eliminating task search processing for selecting a task to be successively dispatched in dispatch processing following POST processing and WAIT processing. CONSTITUTION:For a processor 902 and a processor 903, exclusive control processing such as task control queue 200, resource waiting queue 600 and processor waiting queue 400 and queue relating to dispatch processing are stored in a common memory 901. At the time of POST processing, a POST receiving task is dispatched without executing task search processing and a POST generating task losing the processor using right is registered in the processor waiting queue, and at the time of WAIT processing, the POST generating task registered in the processor waiting queue is dispatched and the task search processing is not executed. Consequently, the locking time of the task control queue at the time of dispatch processing can be shortened and overhead due to the lock competition of the task control queue can be reduced.

Description

【発明の詳細な説明】 [産業上の利用分野コ 本発明は複数のプロセッサが資源を共有したマルチプロ
セッサ・システムに係わり、特にマルチタスク方式のデ
ィスパッチ方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a multiprocessor system in which a plurality of processors share resources, and particularly relates to a multitasking dispatch method.

[従来の技術] 計算機システム内で実行される処理単位(タスク)は、
各種の共有リソースを使用する。マルチプロセッサ・シ
ステムのように複数のタスクが同時に動作するシステム
では、これらのタスク間で共有リソースの占有使用権に
関する競合(ロック競合)が発生するので、このための
排他制御が必要となる。例えば、オンライン・システム
で複数のタスクが「売上げ処理」を行っている場合、共
通の記憶域上にある「売上げ現在高jを、別々のタスク
が参照・更新する。この様な状況では、あるタスクがこ
の「売上げ現在高」を参照し、更新している間、別のタ
スクがこのデータにアクセスすることを禁止する必要が
ある。
[Prior art] A processing unit (task) executed within a computer system is
Use various shared resources. In a system such as a multiprocessor system in which a plurality of tasks operate simultaneously, contention (lock contention) regarding the right to exclusively use a shared resource occurs among these tasks, so exclusive control is required for this purpose. For example, when multiple tasks are processing sales in an online system, different tasks refer to and update current sales j stored in a common storage area. While a task is referencing and updating this "current sales amount", it is necessary to prohibit another task from accessing this data.

現在実用化されている計算機システムの多くは、この排
他制御をWAIT−PO3T方式(サスペンドφリジュ
ーム(Suspend lRe5u+++e )方式、
ブロック・アクティベート(Block−Activa
te)方式、スリーブ・ウェークアップ(Sleap−
Wakeuρ)方式等とも呼ばれる)により実現してい
る。WAIT・p o s ’r方式については、マグ
ロウヒル(McGrats Hill)より出版のワン
(K、 uwan) sブリッグス(F、 A、 Br
1gg5)共著「コンピュータアーキテクチャ アンド
 パラレル プロセッシング(Con+puter A
rchitecture and ParallelP
rocessing) Jに記載されている。
Many of the computer systems currently in practical use perform this exclusive control using the WAIT-PO3T method (Suspend φResume (Suspend lRe5u+++e) method,
Block-Activa
te) method, sleeve wake-up (Sleep-
This is realized by the Wakeup) method. Regarding the WAIT・pos'r method, please refer to Wang (K, uwan) S Briggs (F, A, Br) published by McGraw Hill.
1gg5) Co-authored “Computer Architecture and Parallel Processing (Con+puter A
architecture and ParallelP
rocessing) J.

WAIT−POST方式は、共有リソースがタスク1に
より占有中であった場合に、この共有リソースの占有に
失敗したタスク2を「待ち状態」にするWAIT処理と
、共有リソースを解放するタスク3(タスク3=タスク
1の場合もある)が、タスク2の[待ち状態」を解除す
るPOST処理によって、共有リソース占有使用権のタ
スク間排他制御を行なう。
The WAIT-POST method consists of a WAIT process that puts task 2, which has failed in occupying the shared resource, into a "waiting state" when the shared resource is being occupied by task 1, and task 3 (task 3) that releases the shared resource. 3=Task 1) performs inter-task exclusive control of the shared resource exclusive usage right by POST processing that releases the [waiting state] of Task 2.

以下、共有リソースの占有使用権を得る事をロックを取
る。ロック権を確保する等と表現する。
Hereafter, a lock is taken to obtain the exclusive right to use the shared resource. Expressed as securing lock rights, etc.

又、ロックを取ろうとして、他のタスクが占有使用中で
あった為にロックが取れなかった事を、ロック失敗、ロ
ック確保失敗等と表現する。
Further, when an attempt is made to take a lock, but the lock cannot be taken because the task is occupied by another task, this is expressed as a lock failure, lock acquisition failure, etc.

各タスクはロック失敗するとWAIT処理ルーチンへ制
御を渡す、WAIT処理ルーチンはロック失敗したタス
クを「待ち状態」にし、ディスパッチャを呼び出す。デ
ィスパッチャは、「待ち状態」となったタスクを実行し
ていたプロセッサに「実行可能状態」の別タスクを割り
当てる。「実行可能状態」のタスクが複数存在する場合
、ディスパッチャがどの「実行可能状態」のタスクを選
択してプロセッサを割り当てるかは、タスク毎にあらか
じめ設定された実行優先順位、およびディスパッチ処理
のアルゴリズムに依存する。
When each task fails to lock, it transfers control to the WAIT processing routine. The WAIT processing routine puts the task in which the lock has failed into a "wait state" and calls the dispatcher. The dispatcher assigns another task in the "ready state" to the processor that was executing the task in the "waiting state". When there are multiple tasks in the "ready state", the dispatcher selects which task in the "ready state" to allocate a processor to, depending on the execution priority set in advance for each task and the dispatch processing algorithm. Dependent.

一方、各タスクは共有リソース解放(アンロック)直前
に「待ち状態」のタスク(WA I Tタスク)の有無
を調べ、WAITタスクがあればPO5TO5用−チン
へ制御を渡す。POSTO8用−チンはWA I Tタ
スクを「実行可能状態」に戻す。「実行可能状態」に戻
されたタスクは、後にディスパッチャによってプロセッ
サを1113 )J当てられ、共有リソース占有使用権
を得て処理を再開する。
On the other hand, each task checks whether there is a "waiting" task (WAIT task) immediately before releasing (unlocking) the shared resource, and if there is a WAIT task, it passes control to the PO5TO5 task. For POSTO8, the WAIT task is returned to the "ready state". The task returned to the "executable state" is later assigned a processor (1113) by the dispatcher, obtains the right to exclusively use the shared resource, and resumes processing.

以下、POST処理を起動するタスクをPOST発行タ
スク、POST処理により「待ち状態」を解除されるW
A I TタスクをPO5T受理タスクと呼ぶ。POS
T発行タスク、POST受理タスク、WAITタスク等
は各タスクの固有名称ではない。各タスクがPOST発
行タスクになる場合もあれば、POST受理タスクにな
る場合もある。
Below, the task that starts the POST process is the POST issuing task, and the W that is released from the "waiting state" by the POST process.
The AIT task is called the PO5T receiving task. POS
T-issue task, POST acceptance task, WAIT task, etc. are not unique names of each task. Each task may be a POST issuing task or a POST receiving task.

[発明が解決しようとする課題] ところでこの方式には、タスクの実行に要する動的ステ
ップ数がタスク間のロック競合によって増加するという
問題点がある。即ちマルチプロセッサでは、単一プロセ
ッサでタスクを実行する場合に比較して、タスク当たり
の実行に要する動的ステップ数が増加する。
[Problems to be Solved by the Invention] However, this method has a problem in that the number of dynamic steps required to execute a task increases due to lock contention between tasks. That is, in a multiprocessor, the number of dynamic steps required for execution per task increases compared to when a task is executed by a single processor.

この動的ステップ数増加とは、ロック競合によるWAI
T処理とPOST処理のオーバーヘッド増加(1次的要
因)、及びこれに伴うディスパッチ処理のオーバーヘッ
ド増加(2次的要因)である。
This increase in the number of dynamic steps is due to WAI due to lock contention.
These are an increase in overhead for T processing and POST processing (primary factor), and an accompanying increase in overhead for dispatch processing (secondary factor).

1次的要因は、プロセッサ数増加に伴なって、同時に動
作するタスク数が増加するため、ロック取得失敗率が上
昇する事が原因である。このロック取得失敗率の上昇に
より、リトライ処理、即ちWAIT−POST処理のオ
ーバーヘッドが増加する。
The primary cause is that as the number of processors increases, the number of tasks operating simultaneously increases, resulting in an increase in the lock acquisition failure rate. This increase in the lock acquisition failure rate increases the overhead of retry processing, that is, WAIT-POST processing.

2次的要因は、WAIT−POST処理の増加に比例し
てタスク切替えが増加し、ディスパッチ処理回数が増加
する事が原因である。ディスバッチャは、複数の実行可
能状態タスクの中から次にディスパッチするタスクを選
択するまでの間、システム内の全タスクの状態、実行優
先順位等の制御情報を集中管理するタスク管理キューを
ロックしなければならない。このロックは、タスク管理
キューを更新するために本質的に不可避である。
A secondary factor is that task switching increases in proportion to the increase in WAIT-POST processing, and the number of dispatch processing increases. The dispatcher locks the task management queue that centrally manages control information such as the status and execution priority of all tasks in the system until it selects the next task to be dispatched from among multiple ready-to-run tasks. There must be. This lock is essentially unavoidable for updating the task management queue.

マルチプロセッサ方式では複数のプロセッサ上でディス
パッチャが同時に動作するため、ディスパッチ処理回数
の増加はタスク管理キューのロック競合につながる。こ
のロック競合は、ディスパッチ処理に要するステップ数
を増加させ、タスク当たりの動的ステップ数を更に増加
させる。
In a multiprocessor system, dispatchers operate on multiple processors simultaneously, so an increase in the number of dispatch processes leads to lock contention in the task management queue. This lock contention increases the number of steps required for dispatch processing, further increasing the number of dynamic steps per task.

本発明の目的は、ディスパッチ処理回数が増加する事が
原因で発生するタスク管理キューのロック競合を低減し
、ディスパッチ・オーバーヘッドが増加するという問題
を解決することにある。
SUMMARY OF THE INVENTION An object of the present invention is to reduce lock contention in a task management queue that occurs due to an increase in the number of dispatch processes, and to solve the problem of an increase in dispatch overhead.

[課題を解決するための手段] 上記の課題を解決するために、いわゆるWAIT−PO
ST方式を用いて共有リソースの占有使用権のタスク間
排他制御を行なうマルチタスク方式のマルチプロセッサ
・システムにおいて、POST処理によりPO5T受理
タスクを実行可能状態に遷移させた後、POST発行タ
スクの実行を中断し、このPOST発行タスクに関する
制御情報を記憶手段(プロセッサ待ちキュー)に登録し
、p o s ’r発行タスクを実行していたプロセッ
サをPOST受理タスクに割り当てる。
[Means for solving the problem] In order to solve the above problem, so-called WAIT-PO
In a multitasking multiprocessor system that uses the ST method to perform exclusive inter-task control of exclusive usage rights to shared resources, after the PO5T receiving task is transitioned to an executable state by POST processing, the POST issuing task is executed. The POST issuing task is interrupted, the control information regarding this POST issuing task is registered in the storage means (processor waiting queue), and the processor that was executing the POST issuing task is assigned to the POST receiving task.

さらに、共有リソースの占有使用権の確保に失敗したタ
スク(WAIT発行タスク)をWA I T処理により
待ち状態とし、前記の記憶手段(プロセッサ待ちキュー
)から、これに登録されているPOST発行タスクに関
する制御情報を取り出し、このPOST発行タスクにW
AIT発行タスクを実行していたプロセッサを割り当て
る。
Furthermore, the task (WAIT issuing task) that has failed to secure the exclusive right to use the shared resource is placed in a waiting state by WAIT processing, and the POST issuing task registered therein is retrieved from the storage means (processor wait queue). Extract the control information and apply W to this POST issuing task.
Assign the processor that was executing the AIT issue task.

[作用コ 本発明の方式は、POST処理、WAIT処理に引き続
くディスパッチ処理において、複数の実行可能状態タス
クの中から次にディスパッチするタスクを選択する処理
(以下タスクサーチ処理と記す)を省くことができる。
[Operations] The method of the present invention makes it possible to omit the process of selecting the next task to be dispatched from among a plurality of executable tasks (hereinafter referred to as task search process) in the dispatch process that follows the POST process and the WAIT process. can.

これにより、−同のタスク管理キューのロック時間を短
縮することにより、タスク管理キューのロック競合を低
減する。
This reduces the lock contention of task management queues by shortening the locking time of the same task management queue.

即ち、POSTO8時には、タスクサーチ処理を行なわ
ずPOST受理タスクをディスパッチし、プロセッサ使
用権を失ったPOST発行タスクをプロセッサ待ちキュ
ーに登録する。WA I T処理時には、プロセッサ待
ちキューに登録されているPOST発行タスクをディス
パッチし、タスクサーチ処理を行なわない。以上によっ
てディスパッチ処理時のタスク管理キューのロック時間
を短縮し、タスク管理キューのロック競合によるオーバ
ーヘッドを低減できる。
That is, at POST8, the POST receiving task is dispatched without performing task search processing, and the POST issuing task that has lost the right to use the processor is registered in the processor waiting queue. During WAIT processing, POST issued tasks registered in the processor waiting queue are dispatched, and task search processing is not performed. As described above, the locking time of the task management queue during dispatch processing can be shortened, and the overhead caused by lock contention of the task management queue can be reduced.

[実施例] 以下、本発明の一実施例を第1図から第5図を使って説
明する。本実施例は、オンライン・データベース・シス
テムの例である。
[Example] An example of the present invention will be described below with reference to FIGS. 1 to 5. This embodiment is an example of an online database system.

本発明のディスパッチ方式について述べる前に、本実施
例のオンライン・データベース・システムの概略を説明
する。第1図は、システムの構成概略を表わす。第1の
プロセッサ902と第2のプロセッサ903を共有メモ
リ901を介して結合する。2つのプロセッサは各々共
有メモリ90〕−上のプログラムを動作させ、共有メモ
リ901上のデータを参照して、並列に処理を行なうこ
とができる。タスク管理キュー200. リソース待ぢ
キュー600、プロセッサ待ちキュー400などの排他
制御処理やディスパッチ処理に関係するキューも共有メ
モリ901上に格納する。各プロセッサは、通信制御装
置904を介して、端末装置906とデータの送受を行
なうことができる。また、各プロセッサはディスク制御
装置905を介して、ディスク上のデータベース907
ヘアクセスできる。
Before describing the dispatch method of the present invention, an overview of the online database system of this embodiment will be explained. FIG. 1 shows a schematic configuration of the system. A first processor 902 and a second processor 903 are coupled via a shared memory 901. The two processors can each run a program on the shared memory 90] and refer to data on the shared memory 901 to perform processing in parallel. Task management queue 200. Queues related to exclusive control processing and dispatch processing, such as a resource waiting queue 600 and a processor waiting queue 400, are also stored on the shared memory 901. Each processor can send and receive data to and from the terminal device 906 via the communication control device 904 . Each processor also uses a database 907 on the disk via the disk controller 905.
can be accessed.

以下本明細書では、オンライン・データベース・システ
ムにおけるーまとまりのデータ参照・更新処理をトラン
ザクションと呼ぶ。例えば、「預金の引出し要求に対し
、預金残高を確認し、預金残高から引出し額を差引き、
データベース内の預金残高を更新する」といった一連の
処理をトランザクションと呼ぶ。トランザクションは、
端末装置906からのデータ送信を契機として開始する
Hereinafter, in this specification, a group of data reference/update processing in an online database system will be referred to as a transaction. For example, "In response to a deposit withdrawal request, check the deposit balance, subtract the withdrawal amount from the deposit balance,
A series of processes such as "updating the deposit balance in the database" is called a transaction. The transaction is
It starts with data transmission from the terminal device 906 as a trigger.

次にタスクの基本的な管理方式について説明する。トラ
ンザクシコンが入力されると、スーパーバイザがこのト
ランザクションに対応する1個以上のタスクを生成する
。具体的には、スーパーバイザが、タスクの生成時にタ
スク毎の制御情報を格納したタスク制御ブロックT C
B (TaskControl BLock) 300
を作成し、これらのTCBをトランザクションの終了時
までタスク管理キュー200に登録して管理する。
Next, the basic task management method will be explained. When a transaction is entered, the supervisor creates one or more tasks corresponding to this transaction. Specifically, when a supervisor generates a task, the supervisor creates a task control block T C that stores control information for each task.
B (Task Control Block) 300
These TCBs are registered and managed in the task management queue 200 until the end of the transaction.

タスク管理キュー200に登録中の各タスクは。Each task being registered in the task management queue 200.

「待ち状態」、「実行可能状態」、「中断状態」または
「実行状態」のいずれかの状態をとる。
It can be in any of the following states: "wait state", "ready state", "suspended state", or "execution state".

「待ち状態」のタスクは、待ち原因となっている事象が
完了して「実行可能状態」となるまで、プロセッサを割
り付けて実行できない。「実行可能状態」のタスクは、
システム内のいずれかのプロセッサが空き次第、プロセ
ッサを割り付けて、「実行状態」に遷移させることがで
きる。「中断状態」のタスクとは、POSTマクロを発
行してPOST受理タスクにプロセッサ使用権を譲渡し
、プロセッサ待ちキュー400に登録されているタスク
である。「実行状態」のタスクとはプロセッサ使用権を
得て実行中のタスクである。
A task in a "waiting state" cannot be executed by assigning a processor until the event that caused it to wait is completed and the task is in an "executable state." A task in the “ready state” is
As soon as any processor in the system becomes free, the processor can be assigned and transitioned to the "running state." A task in a “suspended state” is a task that issues a POST macro, transfers the right to use the processor to a POST receiving task, and is registered in the processor waiting queue 400. A task in the "execution state" is a task that has obtained the right to use the processor and is being executed.

ディスパッチャは「実行可能状態」のタスクにプロセッ
サを割り付ける。「実行可能状態」のタスクが複数ある
場合に1よ、タスク毎に割り当てた実行優先順位に従っ
て選択したタスクにプロセッサを割り付ける。
The dispatcher allocates processors to tasks that are "ready to run." If there are multiple tasks in the "executable state", a processor is assigned to the selected task according to the execution priority assigned to each task.

次に各キューや管理ブロックのデータ構造について説明
する。これらのキューや管理ブロックは共有メモリ90
1上に配置し、システム内の全プロセッサからアクセス
可能とする。
Next, the data structure of each queue and management block will be explained. These queues and management blocks are stored in shared memory 90.
1 and accessible from all processors in the system.

タスク管理キュー200は、各タスクの制御に必要な情
報を管理するキューで、第2図に示すとおり、1個のタ
スク管理キューヘッダ210と0個以上のタスク制御ブ
ロックTCB 300の連鎖で構成する。タスク管理キ
ュー200はシステム全体にひとつだけ設ける。タスク
管理キューヘッダ210は、タスク管理キュー・ロック
ワード201、タスク管理キュー先頭ポインタ202.
タスク管理キュー末尾ホインタ203で構成する。
The task management queue 200 is a queue for managing information necessary for controlling each task, and as shown in FIG. 2, it is composed of one task management queue header 210 and a chain of zero or more task control blocks TCB 300. . Only one task management queue 200 is provided in the entire system. The task management queue header 210 includes a task management queue lock word 201, a task management queue head pointer 202.
It consists of a task management queue end pointer 203.

タスク管理キュー・ロックワード201は、タスク管理
キュー200の排他アクセス制御に用いる。
The task management queue lock word 201 is used for exclusive access control of the task management queue 200.

タスク制御ブロックTCB300には第2図に示すとお
り以下の情報を格納する。
The task control block TCB300 stores the following information as shown in FIG.

(1)タスク状態 301 前述のタスク状態(待ち状態、実行可能状態。(1) Task status 301 The task states mentioned above (wait state, executable state).

中断状態または実行状態)を格納する。(suspended or running state).

(2)実行優先順位 302 該タスクに割り当てた実行優先順位を格納する。(2) Execution priority 302 Stores the execution priority assigned to the task.

(3)次TCBポインタ 303 TCBを連鎖してタスク管理キューを構成する際、次の
TCBアドレスを格納する。タスク管理キュー先頭のT
CBの場合は本フィールドは0を格納する。
(3) Next TCB pointer 303 Stores the next TCB address when chaining TCBs to form a task management queue. T at the head of the task management queue
In the case of CB, this field stores 0.

(4)タスク情報退避領域 304 タスクの実行を中断する場合に、該タスクの再開ができ
るように、PSW(プログラム状態語)、レジスタ等の
内容を退避するために用いる。
(4) Task information save area 304 Used to save the contents of PSW (program status word), registers, etc. so that the task can be restarted when execution of a task is interrupted.

リソース待ちキュー600は、共有リソースのロックに
失敗したタスクを登録するキューで、第3図に示すとお
り、ひとつのウェイト制御ブロックWCB (WAIT
 Control BLock) 700と0個以上の
ロック要求プロ7りL RB (Lock Reque
stBLock) 800の連鎖で構成する。リソース
待ちキュー600は各共有リソース毎にひとつ設ける。
The resource waiting queue 600 is a queue in which tasks that have failed to lock a shared resource are registered, and as shown in FIG.
Control BLock) 700 and 0 or more lock requests Pro 7riL RB (Lock Reque
stBlock) Consists of 800 chains. One resource waiting queue 600 is provided for each shared resource.

ウェイト制御ブロックWCB700には第3図に示すと
おり以下の情報を格納する。
The weight control block WCB700 stores the following information as shown in FIG.

(1)リソース待ちキュー・ロックワード701WCB
自身の更新の排他制御に用いる。当WCBが占有中は1
を格納し、解放中は0を格納する。
(1) Resource wait queue lock word 701WCB
Used for exclusive control of own updates. 1 if occupied by this WCB
is stored, and 0 is stored during release.

(2)リソース・ロックワード 702排他制御の対象
となる共有リソースの占有状態を表わす。共有リソース
が占有中は1を格納し、解放中はOを格納する。
(2) Resource lock word 702 Indicates the occupied state of a shared resource that is subject to exclusive control. Stores 1 when the shared resource is occupied, and stores O when the shared resource is released.

(3)リソース待ちキュー先頭ポインタ 703リソー
ス待ちキュー先頭のLRBのアドレスを格納する。リソ
ース待ちキューが空の場合はOを格納する。
(3) Resource waiting queue head pointer 703 Stores the address of the LRB at the head of the resource waiting queue. If the resource waiting queue is empty, O is stored.

(4)リソース待ちキュー末尾ポインタ 704リソー
ス待ちキュー末尾のLRBのアドレスを格納する。リソ
ース待ちキューが空の場合は0を格納する。
(4) Resource waiting queue end pointer 704 Stores the address of the LRB at the end of the resource waiting queue. If the resource waiting queue is empty, 0 is stored.

(5)占有タスクTCポインタ 705共有リソースを
占有中のタスクのTCBアドレスを格納する。共有リソ
ースが解放中は当フィールドは意味を持たない。
(5) Occupied task TC pointer 705 Stores the TCB address of the task occupying the shared resource. This field has no meaning while the shared resource is being released.

ロック要求ブロックLRB800には第3図に示すとお
り以下の情報を格納する。
The lock request block LRB800 stores the following information as shown in FIG.

(1) E CB (Event Control B
lock) 801一般にWAIT−POST方式にお
いてposT発行タスクとWA I Tタスクの間で、
待ち事象の発生・未発生を管理する制御情報である。P
O5TビットがOの時は事象未発生、1の時は事象発生
完了を示す。WAITビットがOの時は未WAIT、1
の時はWAIT中を示す。本実施例では、共有リソース
の解放を通知する為に用いる。
(1) E CB (Event Control B
lock) 801 Generally, in the WAIT-POST method, between the posT issuing task and the WAIT task,
This is control information that manages the occurrence or non-occurrence of a waiting event. P
When the O5T bit is O, it indicates that no event has occurred, and when it is 1, it indicates that the event has occurred. When the WAIT bit is O, it is not WAIT, 1
When , it indicates WAIT. In this embodiment, it is used to notify the release of shared resources.

(2)次LRBポインタ 802 LRBを連鎖してリソース待ちキューを構成する際1次
のLRBのアドレスを格納する。
(2) Next LRB pointer 802 Stores the address of the first LRB when chaining LRBs to form a resource waiting queue.

(3)WAITタスクTCBポインタ 803当LRB
に対応するWAITタスクのTCBアドレスを格納する
(3) WAIT task TCB pointer 803 current LRB
The TCB address of the WAIT task corresponding to the WAIT task is stored.

プロセッサ待ちキュー400は、PO3T発行によって
プロセッサの使用権を失ったタスクを登録するキューで
、第4図に示すとおり、プロセッサ待ちキューヘッダ4
10と0個以上のプロセッサ要求ブロックP RB (
Processor RequestBLock) 5
00の連鎖で構成する。プロセッサ待ちキュー400は
システム全体にひとつだけ設ける。プロセッサ待ちキュ
ーヘッダ410は、プロセッサ待ちキュー・ロックワー
ド401、プロセッサ待ちキュー先頭ポインタ402、
プロセッサ待ちキュー末尾ポインタ402で構成する。
The processor waiting queue 400 is a queue in which tasks that have lost the right to use the processor due to PO3T issuance are registered, and as shown in FIG. 4, the processor waiting queue header 4
10 and 0 or more processor request blocks P RB (
Processor Request BLock) 5
It consists of a chain of 00. Only one processor waiting queue 400 is provided in the entire system. The processor wait queue header 410 includes a processor wait queue lock word 401, a processor wait queue head pointer 402,
It consists of a processor wait queue end pointer 402.

プロセッサ待ちキュー・ロックワード401は、プロセ
ッサ待ちキュー400の排他アクセス制御に用いる。
The processor wait queue lock word 401 is used for exclusive access control of the processor wait queue 400.

プロセッサ要求ブロックPRB500には第4図に示す
とおり以下の情報を格納する。
The processor request block PRB500 stores the following information as shown in FIG.

(1)次FRBポインタ 501 FRBを連鎖してプロセッサ待ちキューを構成する際、
次のFRBのアドレスを格納する。
(1) Next FRB pointer 501 When configuring a processor wait queue by chaining FRBs,
Stores the address of the next FRB.

(2)プロセッサ待ちタスクTCBポインタ 502当
FRBに対応するプロセッサ待ちタスクのTCBアドレ
スを格納する。
(2) Processor-waiting task TCB pointer 502 Stores the TCB address of the processor-waiting task corresponding to the current FRB.

以上のタスク管理キュー200.リソース待ちキュー6
00、プロセッサ待ちキュー400の関係を第1図に示
す。リソース待ちキュー600中のLRB 800.プ
ロセッサ待ちキュー400中のPRB500は、それぞ
れタスク管理キュー200中のTCB 300へのポイ
ンタを有している。このポインタを辿ることにより、リ
ソース待ちキュー600から取り出したLRB800に
対応するTCB 300を、タスク管理キュー200を
サーチすることなく見つけることができる。また、プロ
セッサ待ちキュー400から取り出したPRB500に
対応するTCB 300も同様にタスク管理キュー20
0をサーチすることなく見つけることができる。
The above task management queue 200. Resource waiting queue 6
00 and the processor waiting queue 400 are shown in FIG. LRB 800 in resource waiting queue 600. Each PRB 500 in the processor wait queue 400 has a pointer to a TCB 300 in the task management queue 200. By following this pointer, the TCB 300 corresponding to the LRB 800 retrieved from the resource waiting queue 600 can be found without searching the task management queue 200. Further, the TCB 300 corresponding to the PRB 500 taken out from the processor waiting queue 400 is also stored in the task management queue 20.
You can find it without searching for 0.

これにより、POSTO8時は、リソース待ちキュー6
00から取り出したLRB800に対応するタスク(P
OST受理タスク)にプロセッサ使用権を渡せば、タス
ク管理キュー200をサーチすることなくディスパッチ
処理を行なうことができる。同様に、WAIT処理時は
、プロセッサ待ちキュー400から取り出したPRB5
00に対応するタスク(POST発行タスク)にプロセ
ッサ使用権を渡せば、タスク管理キュー200をサーチ
することなくディスパッチ処理を行なうことができる。
As a result, at POST8, resource waiting queue 6
Task (P) corresponding to LRB800 extracted from 00
If the right to use the processor is given to the OST receiving task (OST receiving task), dispatch processing can be performed without searching the task management queue 200. Similarly, during WAIT processing, PRB5 taken out from the processor wait queue 400
If the processor usage right is given to the task corresponding to 00 (POST issued task), dispatch processing can be performed without searching the task management queue 200.

最後に第5図を用いてこのディスパッチ方式について詳
しく説明する。
Finally, this dispatch method will be explained in detail using FIG.

まずロック処理について説明する。各タスク100は共
有リソースをロックする場合、LOCKマクロ101を
発行し、ロック処理ルーチン103を呼び出す。必要な
共有リソースが他タスクによって占有使用中の為に確保
できない場合、LOCKマクロ101を発行したタスク
をリソース待ちキュー600に登録しく処理108)、
ス−パーバイザ内のWAIT処理ルーチンを呼出して、
このタスクのTCB 300内のタスク状態301を「
待ち状態」にする(処理109)。
First, lock processing will be explained. When each task 100 locks a shared resource, it issues a LOCK macro 101 and calls a lock processing routine 103. If the necessary shared resource cannot be secured because it is being exclusively used by another task, the task that issued the LOCK macro 101 is registered in the resource waiting queue 600 (108);
- Call the WAIT processing routine in the supervisor,
The task status 301 in the TCB 300 of this task is
Waiting state" (process 109).

処理108のリソース待ちキュー600へのタスクの登
録とは、このタスクのTCB300を指すLRB800
を作成し、これをリソース待ちキュー600のLRBの
連鎖に繋ぐ事である。この時、リソース待ちキュー末尾
ポインタ703を更新するための排他制御は、リソース
待ちキュー・ロックワード701を用いて行なう。
Registration of a task in the resource waiting queue 600 in process 108 means that the LRB 800 pointing to the TCB 300 of this task is
, and connect it to the LRB chain of the resource waiting queue 600. At this time, exclusive control for updating the resource waiting queue end pointer 703 is performed using the resource waiting queue lock word 701.

「待ち状態」となったタスクは、他のタスクが発行する
PO5T処理(処理117)によって「実行可能状態」
に戻されるまで「待ち状態」を継続する。
The task in the "waiting state" is changed to the "ready state" by PO5T processing (process 117) issued by another task.
The "wait state" will continue until it is returned to.

次にプロセッサ待ちキュー400にプロセッサ待ちタス
ク、即ち「中断状態」のタスクが登録されているか調べ
る(処理110)。もし「中断状態」のタスクがあれば
、プロセッサ待ちキュー400から取り出しく処理11
1)、高速ディスパッチャを呼び出して(処理112)
、このタスクにプロセッサを割り付け「実行状態」にす
る(処理106)。
Next, it is checked whether a processor-waiting task, that is, a "suspended" task is registered in the processor-waiting queue 400 (process 110). If there is a task in the “suspended state”, the process 11 takes it out from the processor waiting queue 400.
1) Call the high-speed dispatcher (process 112)
, assigns a processor to this task and puts it in the "execution state" (processing 106).

処理111のプロセッサ待ちキュー400からのタスク
の取り出しとは、このタスクのTCB300を指すPR
B500をプロセッサ待ちキュー400のPRBの連鎖
からはずす事である。この時、プロセッサ待ちキュー先
頭ポインタ403を更新するための排他制御は、プロセ
ッサ待ちキュー・ロックワード401を用いて行なう。
Retrieval of a task from the processor waiting queue 400 in process 111 refers to the PR pointing to the TCB 300 of this task.
B500 is removed from the PRB chain of the processor wait queue 400. At this time, exclusive control for updating the processor wait queue head pointer 403 is performed using the processor wait queue lock word 401.

「中断状態」のタスクがない場合は、ディスパッチYを
呼び出しく処理113)、タスクサーチ(処理121)
によって「実行可能状態」のタスクの中からディスパッ
チするタスクを選択し、プロセッサを割り当てる(処理
124)。このタスクサーチ(処理113)は、タスク
管理キュー200に繋がれているTCHの連鎖を順番に
辿りながら、タスク状態301が「実行可能状態」とな
っているTCBを探す処理である。タスクサーチ処理を
行なっている間、他のプロセッサがタスク管理キュー2
00に連鎖しているTCB 300を更新しない様に、
タスク管理キュー・ロックワード201を用いて排他制
御を行なう。
If there is no task in "suspended state", call dispatch Y (process 113), task search (process 121)
A task to be dispatched is selected from among the tasks in the "executable state" and a processor is assigned to it (processing 124). This task search (process 113) is a process of sequentially tracing the chain of TCHs connected to the task management queue 200 and searching for a TCB whose task status 301 is "executable". While task search processing is being performed, other processors are using task management queue 2.
In order not to update TCB 300 which is chained to 00,
Exclusive control is performed using the task management queue lock word 201.

プロセッサを割当てられたタスクは「実行状態」となり
、割込み等によりプロセッサ使用権を奪われるまで処理
を継続する。
A task to which a processor is assigned enters the "execution state" and continues processing until the right to use the processor is taken away due to an interrupt or the like.

次にアンロック処理について説明する。共有リソースを
占有使用していたタスク100は、共有リソースを解放
する場合、UNLOCKマクロ102を発行し、アンロ
ック処理ルーチン104を呼び出す。アンロック処理ル
ーチン104では、リソース待ちキュー600に「待ち
状態」のタスクが登録されているかどうか調べる(処理
114)。
Next, unlock processing will be explained. When the task 100 that has been using the shared resource exclusively issues the UNLOCK macro 102 and calls the unlock processing routine 104 to release the shared resource. In the unlock processing routine 104, it is checked whether a task in a "waiting state" is registered in the resource waiting queue 600 (processing 114).

もし「待ち状態」のタスクがなければ、リソースを解放
しリターンする。「待ち状態」のタスクがある場合、こ
のタスクをリソース待ちキュー600から取り出しく処
理116)、共有リソース解放を通知する為にPOST
O8用−チンを呼び出す(処理117)。
If there are no "waiting" tasks, release the resources and return. If there is a task in the "waiting state", the task is taken out from the resource waiting queue 600 (116), and POST is performed to notify the release of the shared resource.
A command for O8 is called (process 117).

処理116のリソース待ちキュー600からのタスクの
取り出しとは、このタスクのTCB300を指すロック
要求ブロックLRB800をリソース待ちキュー600
のLRB 800の連鎖からはずす事である。この時、
リソース待ちキュー先頭ポインタ704を更新するため
の排他制御は、リソース待ちキュー・ロックワード70
1を用いて行なう。
Retrieval of a task from the resource waiting queue 600 in process 116 means that the lock request block LRB 800 pointing to the TCB 300 of this task is taken out from the resource waiting queue 600.
It is to remove it from the LRB 800 chain. At this time,
Exclusive control for updating the resource waiting queue head pointer 704 is performed using the resource waiting queue lock word 70.
This is done using 1.

POSTO8用−チンは、POST発行タスクを「実行
状態」から「実行可能状態」に移し、POST受理タス
クを「待ち状態」から「実行可能状態」に移す。これら
は、各タスクのTCB300内のタスク状態301を更
新することで行なう。
The POST 8-chin moves the POST issuing task from the "execution state" to the "executable state" and moves the POST receiving task from the "waiting state" to the "executable state". These are performed by updating the task status 301 in the TCB 300 of each task.

次にPOST発行タスクを「実行可能状態」から「中断
状態」に移してプロセッサ待ちキュー400に登録しく
処理118)、高速ディスパッチャを呼び出して(処理
119)POST受理タスクにプロセッサを割り付け「
実行状態」にする(処理106)。
Next, move the POST issuing task from the "executable state" to the "suspended state" and register it in the processor waiting queue 400 (process 118), call the high-speed dispatcher (process 119), and allocate a processor to the POST receiving task.
"Execution state" (processing 106).

処理118のプロセッサ待ちキュー400へのタスクの
登録とは、このタスクのTCB 300を指すプロセッ
サ要求ブロックP RB 500を作成し、これをプロ
セッサ待ちキュー400のPRBの連鎖に繋ぐ事である
。この時、プロセッサ待ちキュー末尾ポインタ402を
更新するための排他制御は、プロセッサ待ちキュー・ロ
ックワード401を用いて行なう。
Registration of a task in the processor waiting queue 400 in process 118 means creating a processor request block PRB 500 pointing to the TCB 300 of this task and connecting it to the chain of PRBs in the processor waiting queue 400. At this time, exclusive control for updating the processor wait queue end pointer 402 is performed using the processor wait queue lock word 401.

プロセッサ使用権を与えられたPO5T受理タスクは、
共有リソースを占有して処理を再開することができる。
The PO5T receiving task that has been given the right to use the processor is
It is possible to monopolize shared resources and resume processing.

[発明の効果] 以上述べてきたように本発明の方式によれば、POST
処理、WAIT処理に引き続くディスパッチ処理におい
て、次にディスパッチするタスクを選択するタスクサー
チ処理をなくし、タスク管理キューのロック競合を低減
できる。
[Effect of the invention] As described above, according to the method of the present invention, POST
In dispatch processing that follows processing and WAIT processing, task search processing for selecting the next task to be dispatched can be eliminated, and lock contention in the task management queue can be reduced.

即ち、POST処理の後はリソース待ちキューに登録さ
れているタスクにプロセッサを割り当て、WAIT処理
の後はプロセッサ待ちキューに登録されているタスクに
プロセッサを割り当てる高速ディスパッチ処理によって
1次にディスパッチするタスクをタスク管理キューの中
から探すタスクサーチ処理を省くことができる。
That is, after POST processing, a processor is assigned to a task registered in the resource waiting queue, and after WAIT processing, a processor is assigned to a task registered in the processor waiting queue. Task search processing for searching from the task management queue can be omitted.

これにより、マルチタスク方式のマルチプロセッサ・シ
ステムにおけるディスパッチ処理オーバーヘッドを低減
させ、システム全体のスループット性能を向上させるこ
とができる。
As a result, dispatch processing overhead in a multitasking multiprocessor system can be reduced, and the throughput performance of the entire system can be improved.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図はタスク管理キュー、リソース待ちキュ、プロセ
ッサ待ちキューの関係と全体のシステム構成を示す図、
第2図はタスク管理キューの形式を示す図、第3図はリ
ソース待ちキューの形式を示す図、第4図はプロセッサ
待ちキューの形式を示す図、第5図は本発明のディスパ
ッチ方式の処理フローを示す図である。 200・・・タスク管理キュー 210・・・タスク管理キューヘッダ。 300・・・タスク制御ブロックTCB(Task C
ontrol BLock) 。 400・・・プロセッサ待ちキュー 410・・・プロセッサ待ちキューヘッダ。 500・・・プロセッサ要求ブロックP RB(Pro
cessor Request f31ock) 。 600・・・リソース待ちキュー 700・・・ウェイト制御ブロックWCB(w^IT 
Control Block) 。 800・・・ロック要求ブロックLRB(Lock R
equest Block)菊/2 /Iヂ
Figure 1 is a diagram showing the relationship among the task management queue, resource waiting queue, and processor waiting queue and the overall system configuration.
Fig. 2 shows the format of the task management queue, Fig. 3 shows the format of the resource waiting queue, Fig. 4 shows the format of the processor waiting queue, and Fig. 5 shows the dispatch method processing of the present invention. It is a figure showing a flow. 200...Task management queue 210...Task management queue header. 300...Task control block TCB (Task C
ontrol BLock). 400...Processor wait queue 410...Processor wait queue header. 500...Processor request block PRB (Pro
cessor Request f31ock). 600...Resource waiting queue 700...Wait control block WCB (w^IT
Control Block). 800...Lock request block LRB (Lock R
equest Block) Chrysanthemum/2 /Iji

Claims (1)

【特許請求の範囲】 1、共有リソースがタスク1により占有使用中であった
為に、該共有リソースの占有使用権の確保に失敗したタ
スク2を待ち状態に遷移させるWAIT処理と、該共有
リソースの使用を終了したタスク3が、前記タスク2を
実行可能状態に遷移させるPOST処理と、実行可能状
態のタスクにプロセッサ使用権を割り当てるディスパッ
チ処理とによって、共有リソースの占有使用権のタスク
間排他制御を行なうマルチタスク方式のマルチプロセッ
サ・システムにおいて、 POST処理によりタスク2を実行可能状態に遷移させ
た後、タスク3の実行を中断し、タスク3に関する制御
情報を記憶手段に登録し、タスク3を実行していたプロ
セッサをタスク2に割り当てるディスパッチ方式。 2、請求項1記載のディスパッチ方式において、共有リ
ソースの占有使用権の確保に失敗したタスク4をWAI
T処理により待ち状態とし、前記の記憶手段から、これ
に登録されているタスク3に関する制御情報を取り出し
、タスク3にタスク4を実行していたプロセッサを割り
当てるディスパッチ方式。
[Scope of Claims] 1. WAIT processing for transitioning task 2, which has failed to secure the right to exclusively use the shared resource because the shared resource was being exclusively used by task 1, to a waiting state, and the shared resource Task 3, which has finished using the shared resource, performs inter-task exclusive control of the exclusive usage rights of the shared resource through POST processing that transitions task 2 to an executable state and dispatch processing that allocates processor usage rights to tasks in the executable state. In a multiprocessor system using a multitasking method, after transitioning task 2 to an executable state by POST processing, execution of task 3 is interrupted, control information regarding task 3 is registered in a storage means, and task 3 is transferred to an executable state. A dispatch method that assigns the currently executing processor to task 2. 2. In the dispatch method according to claim 1, the task 4 that has failed to secure the exclusive right to use the shared resource is dispatched to the WAI
A dispatch method that places the task in a waiting state by processing T, retrieves control information related to task 3 registered in the storage means from the storage means, and assigns the processor that was executing task 4 to task 3.
JP32579688A 1988-05-26 1988-12-26 Dispatching system for multiprocessor Pending JPH02171952A (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP32579688A JPH02171952A (en) 1988-12-26 1988-12-26 Dispatching system for multiprocessor
DE1989625064 DE68925064T2 (en) 1988-05-26 1989-05-24 Task execution control method for a multiprocessor system with post / wait procedure
EP19890109410 EP0343646B1 (en) 1988-05-26 1989-05-24 Task execution control method for a multiprocessor system with enhanced post/wait procedure
US07/940,347 US5274809A (en) 1988-05-26 1992-09-03 Task execution control method for a multiprocessor system with enhanced post/wait procedure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32579688A JPH02171952A (en) 1988-12-26 1988-12-26 Dispatching system for multiprocessor

Publications (1)

Publication Number Publication Date
JPH02171952A true JPH02171952A (en) 1990-07-03

Family

ID=18180694

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32579688A Pending JPH02171952A (en) 1988-05-26 1988-12-26 Dispatching system for multiprocessor

Country Status (1)

Country Link
JP (1) JPH02171952A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005235228A (en) * 2004-02-20 2005-09-02 Sony Computer Entertainment Inc Method and apparatus for task management in multiprocessor system
JP2011521354A (en) * 2008-05-16 2011-07-21 マイクロソフト コーポレーション A local set of tasks in the scheduler
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 (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005235228A (en) * 2004-02-20 2005-09-02 Sony Computer Entertainment Inc Method and apparatus for task management in multiprocessor system
JP4526412B2 (en) * 2004-02-20 2010-08-18 株式会社ソニー・コンピュータエンタテインメント Task management method and apparatus in multiprocessor system
JP2011521354A (en) * 2008-05-16 2011-07-21 マイクロソフト コーポレーション A local set of tasks in the scheduler
US8566830B2 (en) 2008-05-16 2013-10-22 Microsoft Corporation Local collections of tasks in a scheduler
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
JP2866241B2 (en) Computer system and scheduling method
KR930000853B1 (en) Database processing system using multiprocessor system
US5010482A (en) Multi-event mechanism for queuing happened events for a large data processing system
US5274809A (en) Task execution control method for a multiprocessor system with enhanced post/wait procedure
US4779194A (en) Event allocation mechanism for a large data processing system
JP2514299B2 (en) Serialization method of interrupt handling for process level programming
US4796178A (en) Special purpose processor for off-loading many operating system functions in a large data processing system
US5333319A (en) Virtual storage data processor with enhanced dispatching priority allocation of CPU resources
JP2650965B2 (en) Computer system and task scheduling method thereof
JP2829078B2 (en) Process distribution method
Burns et al. A review of Ada tasking
JPS60128537A (en) Resouce access control
JPH03161859A (en) Request control method and access control system
JP2539352B2 (en) Hierarchical multi-computer system
EP0362903B1 (en) A special purpose processor for off-loading many operating system functions in a large data processing system
US5745757A (en) Multiprocessor system with microprogrammed means for dispatching processes to processors
EP0343646B1 (en) Task execution control method for a multiprocessor system with enhanced post/wait procedure
JP2804478B2 (en) Task control system and online transaction system
JP7346649B2 (en) Synchronous control system and method
JPH02171952A (en) Dispatching system for multiprocessor
Witt The functional structure of OS/360, Part II: Job and task management
JP3746826B2 (en) Resource lock control mechanism
US6704765B1 (en) System for allocating resources among agent processes
JPH02122365A (en) Processor assignment system
JP2535631B2 (en) Calling call control method