JP2511012B2 - Task termination method - Google Patents

Task termination method

Info

Publication number
JP2511012B2
JP2511012B2 JP1126287A JP1126287A JP2511012B2 JP 2511012 B2 JP2511012 B2 JP 2511012B2 JP 1126287 A JP1126287 A JP 1126287A JP 1126287 A JP1126287 A JP 1126287A JP 2511012 B2 JP2511012 B2 JP 2511012B2
Authority
JP
Japan
Prior art keywords
task
termination request
control program
termination
global resource
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.)
Expired - Lifetime
Application number
JP1126287A
Other languages
Japanese (ja)
Other versions
JPS63180135A (en
Inventor
林志 樋渡
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
Tokyo Shibaura Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tokyo Shibaura Electric Co Ltd filed Critical Tokyo Shibaura Electric Co Ltd
Priority to JP1126287A priority Critical patent/JP2511012B2/en
Publication of JPS63180135A publication Critical patent/JPS63180135A/en
Application granted granted Critical
Publication of JP2511012B2 publication Critical patent/JP2511012B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明はマルチCPUシステムにおけるタスクターミネ
ーション方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Field of Industrial Application) The present invention relates to a task termination method in a multi-CPU system.

(従来の技術) 従来の複数のCPUを有するマルチCPUシステムでは、第
3図に示す如くあるCPU1から他のCPU2に対して成される
要求が示される共有メモリ3上に、CPU1,2によりアクセ
スされる共有入出力装置上の共有データに関する制御情
報がグローバルリソース31として作成されている。ここ
で、CPU1上のタスク(処理プログラム)Aが、他のCPU2
上のタスク(処理プログラム)Bに対してターミネーシ
ョン要求を制御プログラム11を介してCPU2上の制御プロ
グラム21に行うことにより、制御プログラム11がタスク
Bに占有されているグローバルリソース31を開放する。
しかし、この方式では制御プログラム21はタスクBが占
有していたグローバルリソースがいつ開放されたかを認
識することができないので、誤動作を起こす不都合があ
つた。この不都合を解決すべく、タスクAは制御プログ
ラム11を介してタスクBに対するターミネーション要求
を共有メモリ3上にターミネーション要求リスト32とし
て作成し、これをタスクBが属する制御プログラム21が
取り出すことにより、前記タスクBに占有されているグ
ローバルリソース31を解放する方式が用いられる。しか
し、この方式では、制御プログラム11がターミネーショ
ン要求リスト32を共有メモリ3上に作成し、また制御プ
ログラム21がターミネーション要求リスト32を取り出
し、更に制御プログラム11がターミネーション要求リス
ト32を読み込むためのオーバーヘッドが非常に大きくな
るという欠点があった。なお、制御プログラム11は、タ
ーミネーション要求リスト32を読んで、制御プログラム
21が前記ターミネーション要求を取出したことを知るこ
とによって、グローバルリソース31が解放されたことを
知る。但し、第3図中、22はタスクBのタスクコントロ
ールブロック(TCB)を、23はタスクBにのみによって
占有されるタスクBのローカルリソースを示している。
(Prior Art) In a conventional multi-CPU system having a plurality of CPUs, CPUs 1 and 2 access a shared memory 3 indicating a request made from one CPU 1 to another CPU 2 as shown in FIG. Control information related to shared data on the shared input / output device is created as a global resource 31. Here, the task (processing program) A on CPU1 is
By issuing a termination request to the task (processing program) B above through the control program 11 to the control program 21 on the CPU 2, the control program 11 releases the global resource 31 occupied by the task B.
However, in this method, the control program 21 cannot recognize when the global resource occupied by the task B is released, which causes a malfunction. In order to solve this inconvenience, the task A creates a termination request for the task B on the shared memory 3 via the control program 11 as a termination request list 32, and the control program 21 to which the task B belongs extracts the termination request 32. A method of releasing the global resource 31 occupied by the task B is used. However, in this method, the control program 11 creates the termination request list 32 in the shared memory 3, the control program 21 fetches the termination request list 32, and the overhead for the control program 11 to read the termination request list 32 is added. It had the drawback of being very large. The control program 11 reads the termination request list 32 and
By knowing that 21 has fetched the termination request, it knows that the global resource 31 has been released. However, in FIG. 3, 22 indicates a task control block (TCB) of the task B, and 23 indicates a local resource of the task B which is occupied only by the task B.

(発明が解決しようとする問題点) 上記の如く制御プログラムがこれに属するタスクのグ
ローバルリソース解放を知り得るタスクターミネーショ
ン方式では、タスクAがタスクBに対してのターミネー
ション要求リストを作成し、タスクBが属する制御プロ
グラムがこれを取り出すためのオーバーヘッドが大きく
なる等の問題点があった。そこで本発明は上記の欠点を
除去するもので、制御プログラムがこれに属するタスク
のグローバルリソース解放を知り得且つオーバーヘッド
の少ないタスクターミネーション方式を提供することに
ある。
(Problems to be Solved by the Invention) In the task termination method in which the control program can know the global resource release of the task belonging to the task as described above, task A creates a termination request list for task B, and task B creates a termination request list. There is a problem that the overhead for the control program to which this belongs to take out becomes large. Therefore, the present invention eliminates the above drawbacks and provides a task termination method in which a control program can know global resource release of a task belonging to the control program and has less overhead.

[発明の構成] (問題点を解決するための手段) 本発明は、独立に動作する複数のCPU上のタスクより
アクセスされる共有メモリ上に前記複数のCPUによりア
クセスされる共有装置を制御するグローバルリソースを
持ち、第1のタスクから第2のタスクへターミネーショ
ン要求が出されると、前記第2のタスクに占有されてい
る前記グローバルリソースを前記第2のタスクから解放
する処理を行うタスクターミネーション方式において、
前記共有装置にアクセスするタスクに対応するタスクコ
ントロールブロックを前記共有メモリ上に設け、前記タ
ーミネーション要求を出されたタスクに対応する前記タ
スクコントロールブロックにターミネーション要求情報
を書き込み、且つ、タスクケジューリング時に前記タス
クコントロールブロックから前記タスクターミネーショ
ン要求情報を見つけると、ターミネーション要求を出さ
れたタスクが占有する前記グローバルリソースを解放す
る制御を行う制御プログラムを各CPU毎に設けた方式を
採用している。
[Configuration of Invention] (Means for Solving Problems) The present invention controls a shared device accessed by a plurality of CPUs on a shared memory accessed by a task on a plurality of independently operating CPUs. A task termination method having a global resource and performing processing of releasing the global resource occupied by the second task from the second task when a termination request is issued from the first task to the second task At
A task control block corresponding to a task to access the shared device is provided on the shared memory, termination request information is written to the task control block corresponding to the task for which the termination request is issued, and at the time of task scheduling. When the task termination request information is found from the task control block, a control program for controlling each CPU to release the global resource occupied by the task that issued the termination request is provided for each CPU.

(作用) 本発明のタスクターミネーション方式において、前記
制御プログラムは、自己に所属するタスクから他の制御
プログラムに所属する別のタスクのタスクターミネーシ
ョン要求が出されると、前記共有メモリ上に設けられた
前記別のタスクのタスクコントロールブロックにターミ
ネーション要求情報を書き込む。前記他の制御プログラ
ムはタスクケジューリング時に前記タスクコントロール
ブロックから前記タスクターミネーション要求情報を見
つけると、自己に属する前基別のタスクが専用するグロ
ーバルリソースを解放する処理を行う。
(Operation) In the task termination method of the present invention, the control program is provided on the shared memory when a task belonging to another control program issues a task termination request for another task belonging to the control program. Write termination request information to the task control block of another task. When the other control program finds the task termination request information from the task control block during task scheduling, it performs a process of releasing the global resource dedicated to the task of the previous group belonging to itself.

(実施例) 以下本発明の一実施例を従来例と同一部には同一符号
を付して図面を参照して説明する。第1図は本発明のタ
スクターミネーション方式を適用したマルチCPUシステ
ムの一例を示したブロック図である。1,2はタスクが走
るCPU、3はCPU1,2により共通にアクセスされる共有メ
モリ、4はCPU1のみによってアクセスされる専用メモ
リ、5はCPU1に対する入出力装置、6はCPU2のみによっ
てアクセスされる専用メモリ、7はCPU2に対する入出力
装置、8はCPU1,2により共通にアクセスされる共有入出
力装置(ディスク等)である。
(Embodiment) An embodiment of the present invention will be described below with reference to the drawings in which the same parts as those in the conventional example are designated by the same reference numerals. FIG. 1 is a block diagram showing an example of a multi-CPU system to which the task termination method of the present invention is applied. 1, 2 are CPUs on which tasks run, 3 is a shared memory commonly accessed by CPUs 1 and 2, 4 is a dedicated memory accessed only by CPU1, 5 is an input / output device for CPU1, and 6 is accessed only by CPU2 Dedicated memory, 7 is an input / output device for the CPU 2, and 8 is a shared input / output device (disk or the like) commonly accessed by the CPUs 1 and 2.

次に本実施例の動作について説明する。CPU1,2は専用
メモリ4,6及び入出力装置5,7をそれぞれ独立に使用して
独立した処理を行う。この際、各CPU1,2のどちらか一方
が共有メモリ3上のグローバルリソースを占有して共有
入出力装置8を使用する。このようなマルチCPUシステ
ムにて、CPU1上を走る第2図に示すタスクAより、CPU2
上を走るタスクBに対してターミネーション要求が出さ
れた場合は以下に述べるような処理が行われる。即ち、
制御プログラム11はタスクAよりタスクBに対するター
ミネーション要求を受けると、このプログラム11は共有
メモリ3上に設けられているタスクBのタスクコントロ
ールブロック(TCB)33に前記ターミネーション要求が
生じている旨の情報(1ビット)を書き込む。この時点
で、タスクAは前記ターミネーション要求を終了とし、
次の処理に移る。タスクBが所属するCPU2上の制御プロ
グラム21はタスクスケジュール処理中にTCB33を見て、
ターミネーション要求情報があった場合にタスクBに占
有されているグローバルリソースを解放する等のターミ
ネーション処理を行った後、共有メモリ3上のタスクB
のTCB33の内容をクリアする。制御プログラム11はタス
クBのTCB33がクリアされたことを知って、タスクBに
占有されているグローバルリソース31が解放されたこと
を知る。
Next, the operation of this embodiment will be described. The CPUs 1 and 2 independently use the dedicated memories 4 and 6 and the input / output devices 5 and 7 to perform independent processing. At this time, one of the CPUs 1 and 2 occupies the global resource on the shared memory 3 and uses the shared input / output device 8. In such a multi-CPU system, the task A running on the CPU1 from the task A shown in FIG.
When a termination request is issued to task B running above, the following processing is performed. That is,
When the control program 11 receives a termination request from the task A for the task B, the program 11 informs the task control block (TCB) 33 of the task B provided on the shared memory 3 that the termination request has been issued. Write (1 bit). At this point, task A ends the termination request,
Move on to the next process. The control program 21 on the CPU2 to which the task B belongs looks at the TCB33 during the task schedule processing,
When the termination request information is present, after performing termination processing such as releasing the global resource occupied by task B, task B on shared memory 3
Clear the contents of TCB33. The control program 11 knows that the TCB 33 of task B has been cleared, and that the global resource 31 occupied by task B has been released.

本実施例によれば、タスクBが属する制御プログラム
21によりタスクBに占有されているグローバルリソース
31を解放するため、制御プログラム21はタスクBのグロ
ーバルリソース31の解放を知ることができる。また、制
御プログラム11はタスクBのTCB33に1ビットのターミ
ネーション要求情報を書くのみであり、また制御プログ
ラム21はタスクスケジュール処理中に前記TCB33を読み
込んでタスクターミネーション処理へ制御を移すため、
この間のオーバーヘッドを著しく減少させることができ
る。更に、制御プログラム11はタスクスケジュール処理
中にタスクBのTCB33の内容がクリアされたか否かを知
ることにより、タスクBに占有されていたグローバルリ
ソースの解放を知ることができるため、この間のオーバ
ーヘッドをも減少させることができる。
According to this embodiment, the control program to which task B belongs
Global resource occupied by task B by 21
Since the control program 21 releases the global resource 31, the control program 21 can know that the global resource 31 of the task B is released. Further, the control program 11 only writes 1-bit termination request information to the TCB33 of the task B, and the control program 21 reads the TCB33 during the task schedule processing and transfers control to the task termination processing.
The overhead during this time can be significantly reduced. Further, the control program 11 can know the release of the global resource occupied by the task B by knowing whether the content of the TCB33 of the task B has been cleared during the task schedule processing, and the overhead during this period can be reduced. Can also be reduced.

[発明の効果] 以上記述した如く本発明のタスクターミネーション方
式によれば、制御プログラムがこれに属するタスクのグ
ローバルリソース解放を知り得且つオーバーヘッドを少
なくし得る効果がある。
[Effects of the Invention] As described above, according to the task termination method of the present invention, there is an effect that the control program can know the global resource release of the task belonging to the control program and can reduce the overhead.

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

第1図は本発明のタスクターミネーション方式を適用し
たマルチCPUシステムの一実施例を示したブロック図、
第2図は本発明のタスクターミネーション方式を説明す
るブロック図、第3図は従来のタスクターミネーション
方式を説明するブロック図である。 1,2……CPU、3……共有メモリ 8……共有入出力装置、11,21……制御プログラム 31……タスクBのグローバルリソース 33……タスクBのタスクコントロールブロック A,B……タスク
FIG. 1 is a block diagram showing an embodiment of a multi-CPU system to which the task termination method of the present invention is applied,
FIG. 2 is a block diagram for explaining the task termination method of the present invention, and FIG. 3 is a block diagram for explaining the conventional task termination method. 1,2 ... CPU, 3 ... shared memory 8 ... shared input / output device, 11,21 ... control program 31 ... task B global resource 33 ... task B task control block A, B ... task

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】独立に動作する複数のCPU上のタスクより
アクセスされる共有メモリ上に前記複数のCPUによりア
クセスされる共有装置を制御するグローバルリソースを
持ち、第1のタスクから第2のタスクへターミネーショ
ン要求が出されると、前記第2のタスクに占有されてい
る前記グローバルリソースを前記第2のタスクから開放
する処理を行うタスクターミネーション方式において、
前記共有装置にアクセスするタスクに対応するタスクコ
ントロールブロックを前記共有メモリ上に設け、前記タ
ーミネーション要求を出されたタスクに対応する前記タ
スクコントロールブロックにターミネーション要求情報
を書き込み、且つ、タスクスケジューリング時に前記タ
スクコントロールブロックから前記ターミネーション要
求情報を見つけると、ターミネーション要求が出された
タスクが占有する前記グローバルリソースを開放する制
御を行う制御プログラムを各CPU毎に設けたことを特徴
とするタスクターミネーション方式。
1. A global memory for controlling a shared device accessed by a plurality of CPUs on a shared memory accessed by a task on a plurality of independently operating CPUs, and a first task to a second task. When a termination request is issued, in a task termination method for performing processing of releasing the global resource occupied by the second task from the second task,
A task control block corresponding to a task for accessing the shared device is provided on the shared memory, termination request information is written in the task control block corresponding to the task for which the termination request is issued, and the task is executed during task scheduling. When the termination request information is found from a control block, a control program for controlling each CPU to release the global resource occupied by the task that issued the termination request is provided for each CPU.
JP1126287A 1987-01-22 1987-01-22 Task termination method Expired - Lifetime JP2511012B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1126287A JP2511012B2 (en) 1987-01-22 1987-01-22 Task termination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1126287A JP2511012B2 (en) 1987-01-22 1987-01-22 Task termination method

Publications (2)

Publication Number Publication Date
JPS63180135A JPS63180135A (en) 1988-07-25
JP2511012B2 true JP2511012B2 (en) 1996-06-26

Family

ID=11773037

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1126287A Expired - Lifetime JP2511012B2 (en) 1987-01-22 1987-01-22 Task termination method

Country Status (1)

Country Link
JP (1) JP2511012B2 (en)

Also Published As

Publication number Publication date
JPS63180135A (en) 1988-07-25

Similar Documents

Publication Publication Date Title
JP2511012B2 (en) Task termination method
JPS599928B2 (en) Channel control method
JP2522412B2 (en) Communication method between programmable controller and input / output device
JPH03116261A (en) Multiprocessor control system
JPS59111563A (en) Controlling system of multi-processor
JP3043361B2 (en) Distributed processor control method
JPS6125249A (en) Exclusive control system
JPS6267648A (en) Processing system for exclusive control instruction
JPH10171670A (en) Task switching device and medium recording task switching program
JPS63155254A (en) Information processor
JPH0424733B2 (en)
JPS5834859B2 (en) Multiprocessor system information
JPH0642229B2 (en) Information processing equipment
JPS5840216B2 (en) Test and set method
JPS63231545A (en) File transfer system
JPH04184525A (en) Magnetic disk device
JPH0241781B2 (en)
JPS63237135A (en) Task starting system for multi cpu system
JPH03278154A (en) Shared memory access system
JPH04260139A (en) File access rpocessor
JPH02301851A (en) System bus accessing system
JPS60129872A (en) Distributed processor of data
JPS62229350A (en) Command transmission and control system
JPH02266452A (en) Device for accessing cpu bus in other system
JPH04211854A (en) Computer device