JPH02226429A - Information processor - Google Patents

Information processor

Info

Publication number
JPH02226429A
JPH02226429A JP4714489A JP4714489A JPH02226429A JP H02226429 A JPH02226429 A JP H02226429A JP 4714489 A JP4714489 A JP 4714489A JP 4714489 A JP4714489 A JP 4714489A JP H02226429 A JPH02226429 A JP H02226429A
Authority
JP
Japan
Prior art keywords
task
address
executed
instruction
switching
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
JP4714489A
Other languages
Japanese (ja)
Inventor
Shigeharu Hirao
平尾 繁晴
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 JP4714489A priority Critical patent/JPH02226429A/en
Publication of JPH02226429A publication Critical patent/JPH02226429A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the switching steps of a task and to make an overhead to minimum by switching respective tasks based on a task switching instruction at the time of executing a multi-task processing. CONSTITUTION:When the state of a new task (state is mentioned as a resuming address here) is stored in a certain address in a storage part 4, the address is set to be an operand and an EXC instruction is executed among old tasks. Then, the next instruction of the EXC instruction, namely, the state of the old task (resuming address of the old task) is stored in the designated operand. At the same time, the original value of the operand (the resuming address of the new task) is stored in a program counter 3, and the execution of the program is resumed from the address. Thus, the switching of the task is executed. Since the task processing is executed by directly designating the address of the memory, the content of the program counter 3 can respectively be preserved and called by one step.

Description

【発明の詳細な説明】 [発明の目的〕 (産業上の利用分野) 本発明は、マルチタスク処理を行う情報処理装置に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Field of Industrial Application) The present invention relates to an information processing device that performs multitask processing.

(従来の技術) 中央処理装置からみた仕事の単位であるタスクは、生成
されてから消滅するまでに、基本的に三つの状態、すな
わち、実行状態、レディ状態および待ち状態を遷移する
。これ以外にも特殊な状態として、タスク生成中やタス
ク消滅中等がある。
(Prior Art) A task, which is a unit of work from the perspective of a central processing unit, basically transits through three states, namely, a running state, a ready state, and a waiting state, from its creation until its disappearance. In addition to this, special states include tasks being created and tasks disappearing.

マルチタスク処理において、タスク管理プログラムは、
レディ状、聾のタスクの中で実行優先順位の高いものを
選び起動するとともに、タスク相互間の同期、実行制御
を行う。
In multitasking, the task management program
It selects and starts the one with the highest execution priority among the ready and deaf tasks, and also performs synchronization and execution control between tasks.

ところで、従来のマルチタスク処理においては、各タス
ク毎にそのタスク状態を保存するタスクコントロールブ
ロック(以下、TCBという)を合し、そのうち選択さ
れた一つのTCBだけを有効にして、そのタスクを実行
状態にする制御方法が用いられている。
By the way, in conventional multitasking processing, task control blocks (hereinafter referred to as TCBs) that save the task state are combined for each task, and only one selected TCB is enabled to execute the task. A control method is used to control the state.

またこのような処理を行うプログラムは、マルチタスク
オペレーティングシステム(O8)と呼ばれている。
A program that performs such processing is called a multitasking operating system (O8).

ところが、タスク切換時においては、1IE1’cBと
新TCBの切換処理が必要であり、最低でも数ステツブ
の処理を要していた。このため、O8の各プログラムが
費す計算時181であるオーバヘッドは無視できないも
のであった。
However, when switching tasks, switching between 1IE1'cB and the new TCB is required, which requires at least several steps of processing. For this reason, the overhead of 181 times of calculation time spent by each program of O8 was not negligible.

(発明が解決しようとする課題) このように、上述した従来のマルチタスク処理では、オ
ーバヘッドの無駄が生じている。
(Problems to be Solved by the Invention) As described above, in the conventional multitasking processing described above, overhead is wasted.

本発明は、このような事情により成されたもので、オー
バヘッドを最小限にくいとめることができる情報処理装
置を提供することを目的とする。
The present invention was made in view of the above circumstances, and an object of the present invention is to provide an information processing apparatus that can minimize overhead.

[発明の構成] (課題を解決するための手段) 本発明の情報処理装置は、上記目的を達成するために、
実行命令のアドレスを格納しているアドレス格納手段と
、処理手順を格納している処理手順格納手段とを備えた
マルチタスク処理を実行する情報処理装置において、情
報処理装置がアドレス格納手段と処理手順格納手段との
間でそれぞれのデータの交換を行うタスク切換命令を具
備し、マルチタスク処理の実行の際にこのタスク切換命
令に基づいて各タスクの切換えを行うようにしたもので
ある。
[Structure of the Invention] (Means for Solving the Problem) In order to achieve the above object, the information processing device of the present invention has the following features:
In an information processing apparatus that executes multitasking processing, the information processing apparatus includes an address storage means for storing an address of an execution instruction and a processing procedure storage means for storing a processing procedure. It is provided with a task switching instruction for exchanging respective data with the storage means, and switching between each task is performed based on this task switching instruction when executing multitasking processing.

(作 用) 本発明の情報処理装置では、アドレス格納手段と処理手
順格納手段との間でそれぞれのデータの交換を行うタス
ク切換命令を具備したことにより、マルチタスク処理の
実行の際にタスク切換命令に基づいて各タスクの切換え
を行うことができ、これによりタスクの切換ステップを
減らすことができる。
(Function) The information processing device of the present invention is provided with a task switching instruction for exchanging data between the address storage means and the processing procedure storage means, so that task switching can be performed when executing multitasking processing. Each task can be switched based on a command, thereby reducing the number of task switching steps.

(実施例) 以下、本発明の実施例の詳細を図面に基づいて説明する
(Example) Hereinafter, details of an example of the present invention will be described based on the drawings.

第1図は、本発明の情報処理装置を電子計算機に適用し
た場合の一実施例を示すものである。
FIG. 1 shows an embodiment in which the information processing apparatus of the present invention is applied to an electronic computer.

同図に示すように、電子計算機には、内部バス1を介し
て接続された演算制御部2、プログラムカウンタ3およ
び記憶部4が備えられている。
As shown in the figure, the electronic computer includes an arithmetic control section 2, a program counter 3, and a storage section 4 connected via an internal bus 1.

演算制御部2は、演算される対象を指定するオペランド
に、ある処理を加え結果を得る。
The arithmetic control unit 2 applies certain processing to an operand specifying an object to be arithmetic, and obtains a result.

プログラムカウンタ3は、次に実行する命令のアドレス
を格納しているレジスタである。
The program counter 3 is a register that stores the address of the next instruction to be executed.

記憶部4は、処理手順のプログラムを格納している。The storage unit 4 stores programs for processing procedures.

なお、この電子計算機には、一つのオペランドをaしプ
ログラムカウンタ3のアドレスとオペランドの内容とを
交換する命令であるタスク切換命令(EXC)が具備さ
れている。
This electronic computer is equipped with a task switching instruction (EXC) which is an instruction to exchange one operand with the address of the program counter 3 and the contents of the operand.

そして、新タスクの状態(ここで、状態とは、タスクの
再開アドレスをいう)が記憶部4のあるアドレスに格納
されているとき、そのアドレスをオペランドとして1[
]タスクの中からEXC命令を実行すると、ExC命令
の次の命令、すなわち旧タスクの状態(旧タスクの11
1開アドレス)が指定されたオペランドに格納される。
Then, when the state of the new task (here, the state refers to the restart address of the task) is stored at a certain address in the storage unit 4, the address is set as an operand and 1[
] When an EXC instruction is executed from within a task, the next instruction after the ExC instruction, that is, the state of the old task (11
1 open address) is stored in the specified operand.

また同時に、そのオペランドの元の値(新タスクの再開
アドレス)がプログラムカウンタ3に格納され、そのア
ドレスからプログラムの実行が+1r開される。このよ
うにしてタスクの切換えが実行される。
At the same time, the original value of the operand (the restart address of the new task) is stored in the program counter 3, and execution of the program starts +1r from that address. Task switching is performed in this way.

次に、第2図ないし第5図を用いて本発明に係る電子計
算機の動作を説明する。
Next, the operation of the computer according to the present invention will be explained using FIGS. 2 to 5.

まず、マルチタスクO8の初期設定が実行(ステップ2
01)された後、Sa、 Sb、 Seにそれぞれタス
クA、B、Cの実行開始アドレスが格納(ステップ20
2)される。
First, the initial settings of multitasking O8 are executed (step 2
01), the execution start addresses of tasks A, B, and C are stored in Sa, Sb, and Se, respectively (step 20).
2) To be done.

次イテ、ステップ203ニおイテ、EXCSa、 EX
Csb、ピXCScが順に実行されることにより、タス
クA、B、Cの切換えが行われる。
Next item, step 203, EXCSa, EX
Tasks A, B, and C are switched by sequentially executing Csb and PIXCSc.

すなわち、EXCSaが実行されると、処理がタスクA
に移る。タスクAでPalが実行(ステップ301)さ
れた後、EXCSaが実行(ステップ302)されると
、処理がステップ203に戻り、ここでEXCsbが実
行されるため、処理がタスクBに移る。
In other words, when EXCSa is executed, the process is executed as task A.
Move to. When EXCSa is executed (step 302) after Pal is executed in task A (step 301), the process returns to step 203, where EXCsb is executed, so the process moves to task B.

タスクBでは、pbiが実行(ステップ401)された
後、EXCSbが実行(ステップ402)されると、処
理がステップ203に戻り、ここでEXCScがコール
されるため、処理がタスクCに移る。
In task B, after pbi is executed (step 401), EXCSb is executed (step 402), the process returns to step 203, and EXCSc is called here, so the process moves to task C.

タスクCでは、Pel 、 Pc2 、 Pc3がこの
順に実行(ステップ501〜503)された後、EXC
Scが実行(ステップ504)されると、ステップ20
3内のEXCSaが実行されるため、処理が再度タスク
Aに移る。
In task C, after Pel, Pc2, and Pc3 are executed in this order (steps 501 to 503), EXC
When Sc is executed (step 504), step 20
Since EXCSa in 3 is executed, the process shifts to task A again.

タスクAでは、Pa2 、 Palがこの順に実行(ス
テップ303)、(ステップ301)された後、EXC
9aが実行(ステップ302)されると、ステップ20
3内のEXCSbが実行されるため、処理が再度タスク
Bに移る。
In task A, after Pa2 and Pal are executed in this order (step 303) and (step 301), EXC
9a is executed (step 302), step 20
Since EXCSb in task B is executed, the process moves to task B again.

タスクBでは、Pb2が実行(ステップ403)された
後、l:Xc Sbが実行(ステップ404)されると
、ステップ203内のEXCScが実行されるため、処
理が再度タスクCに移る。
In task B, after Pb2 is executed (step 403), l:Xc Sb is executed (step 404), and EXCSc in step 203 is executed, so the process shifts to task C again.

タスクCでは、Pcl 、 Pc2 、 Pc3 、 
EXCSaがこの順に実行(ステップ501〜504)
される。
In task C, Pcl, Pc2, Pc3,
EXCSa executes in this order (steps 501 to 504)
be done.

このようにして、タスクA、B、Cが交互に実行される
In this way, tasks A, B, and C are executed alternately.

このように、この実施例では、メモリのアドレスを直接
指定することによってタスク処理を行うので、プログラ
ムカウンタ3の内容の保存と呼出しをそれぞれ1ステツ
プで行うことができ、これによりオーバヘッドを短縮す
ることができる。
In this way, in this embodiment, task processing is performed by directly specifying the memory address, so the contents of the program counter 3 can be saved and recalled in one step, thereby reducing overhead. Can be done.

第6図ないし第9図は、上述したタスク切換命令EXC
に代え、定数nとレジスタrの内容の和をアドレスとす
るメモリを指定する命令EXCn(r)を適用した場合
の他の実施例を示すものである。
6 to 9 show the task switching command EXC mentioned above.
In place of the above, another embodiment is shown in which an instruction EXCn(r) which specifies a memory whose address is the sum of a constant n and the contents of a register r is applied.

まず、マルチタスクO3の初期設定(ステップ601)
が行われた後、Sa以降にタスクA、B、Cの実行開始
アドレスが格納(ステップ602)される。次いで、r
←−1が実行(ステップ603)された後、r −(r
+1)sod3 、 EXC5a(r)が実行(ステッ
プ604)されることにより、タスクA、B、Cの切換
えが行われる。
First, initial settings for multitasking O3 (step 601)
After this is performed, the execution start addresses of tasks A, B, and C are stored after Sa (step 602). Then r
After ←−1 is executed (step 603), r −(r
+1) By executing sod3 and EXC5a(r) (step 604), tasks A, B, and C are switched.

すなわち、r 4− (r+1)rAod3 、 EX
C5a(r)が実行されると処理がタスクAに移る。タ
スクAでPalが実行(ステップ701)された後、r
 ” (r+1)a+od3 、 EXC5a(r)が
実行(ステップ702)されると、処理がタスクBに移
る。
That is, r4- (r+1)rAod3, EX
When C5a(r) is executed, the process moves to task A. After Pal is executed in task A (step 701), r
” (r+1)a+od3 When EXC5a(r) is executed (step 702), the process moves to task B.

タスクBでは、Pblが実行(ステップ801)された
後、r = (r+1)Ilod3 、 EXC5a(
r)が実行(ステップ802)されると、処理がタスク
Cに移る。
In task B, after Pbl is executed (step 801), r = (r+1)Ilod3, EXC5a(
r) is executed (step 802), the process moves to task C.

タスクCでは、Pet 、 Pc2 、 Pc3がこの
順に実行(ステップ901〜903)された後、r−(
r+1)■od3 、 EXC5a(r)が実行(ステ
ップ904)されると、処理がステップ604に戻り、
ここで「←(r+1)mod3 、 EXC5a(r)
が実行されるため、処理が再度タスクAに移る。
In task C, after Pet, Pc2, and Pc3 are executed in this order (steps 901 to 903), r-(
When EXC5a(r) is executed (step 904), the process returns to step 604,
Here, “←(r+1)mod3, EXC5a(r)
is executed, the process shifts to task A again.

タスクAでは、Pa2 、 Palがこの順に実行(ス
テップ703)、(ステップ701)された後、r−(
r+l)mod3 、 EXC5a(r)が実行(ステ
ップ702)されると、処理が再度タスクBに移る。
In task A, after Pa2 and Pal are executed in this order (step 703) and (step 701), r-(
r+l)mod3, EXC5a(r) is executed (step 702), the process shifts to task B again.

タスクBでは、Pb2が実行(ステップ803)された
後、r −(r+l)mod3 、 EXC5a(r)
が実行(ステップ804)されると、処理が再度タスク
Cに移る。
In task B, after Pb2 is executed (step 803), r − (r + l) mod 3, EXC5a (r)
is executed (step 804), the process moves to task C again.

タスクCでは、Pcl 、 Pc2 、 Pc3がこの
順に実行(ステップ901〜903)された後、r 4
− (r+l)n+od3 、 EXC5a(r)が実
行(ステップ904)されると、上記同様にしてステッ
プ604に移る。
In task C, after Pcl, Pc2, and Pc3 are executed in this order (steps 901 to 903), r4
- (r+l)n+od3 When EXC5a(r) is executed (step 904), the process moves to step 604 in the same manner as described above.

このようにして、タスクA、B、Cが交互に実行される
In this way, tasks A, B, and C are executed alternately.

このように、この実施例では、タスクA、B。Thus, in this example, tasks A and B.

CIHIでの処理の切換時にマルチタスクO8が介在せ
ず、タスクCからタスクAへの切換時のみ介在するため
、オーバヘッドをさらに短縮することができる。
Since the multitask O8 does not intervene when switching the processing in CIHI and intervenes only when switching from task C to task A, the overhead can be further reduced.

なお、上述した各実施例では、プログラムカウンタ3と
オペランドとの内容を交換する命令IEXc、および定
数nとレジスタrの内容の和をアドレスとするメモリを
指定する命令EXCn(r)を適用した場合について説
明したが、この例に限らずメモリmの内容をアドレスと
するメモリを指定する命令EXC@m、レジスタrを指
定する命令EXCr、レジスタ「の内容をアドレスとす
るメモリを指定する命令EXC@ r等を適用してもよ
い。
In each of the embodiments described above, the instruction IEXc for exchanging the contents of the program counter 3 and the operand, and the instruction EXCn(r) for specifying the memory whose address is the sum of the constant n and the contents of the register r are applied. , but this example is not limited to the instruction EXC@m that specifies a memory whose address is the contents of memory m, the instruction EXCr that specifies register r, and the instruction EXC@ that specifies a memory whose address is the contents of register ``. r etc. may be applied.

[発明の効果コ 以上説明したように、本発明の情報処理装置によれば、
マルチタスク処理の実行の際にタスク切換命令に基づい
て各タスクの切換えを行うことができるため、タスクの
切換ステップを減らすことができ、これによりオーバヘ
ッドを最小限にくいとめることができる。
[Effects of the Invention As explained above, according to the information processing device of the present invention,
Since each task can be switched based on a task switching instruction when performing multitasking processing, the number of task switching steps can be reduced, and thereby overhead can be kept to a minimum.

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

第1図は本発明の情報処理装置を電子計算機に適用した
場合の一実施例を示すブロック図、第2図ないし第5図
は第1図の電子計算機がEXC命令を具備した際の動作
を示すフローチャート、第6図ないし第9図は本発明の
他の実施例を示すもので第1図の電子計算機がEXCn
(r)命令を具備した際の動作を示すフローチャートで
ある。 1・・・内部バス、2・・・演算制御部、3・・・プロ
グラムカウンタ、4・・・記憶部 出願人      株式会社 東芝
FIG. 1 is a block diagram showing an embodiment of the information processing apparatus of the present invention applied to a computer, and FIGS. 2 to 5 show the operation of the computer shown in FIG. 1 when it is equipped with an EXC instruction. The flowcharts shown in FIGS. 6 to 9 show other embodiments of the present invention, in which the electronic computer in FIG.
(r) It is a flowchart which shows the operation|movement when a command is provided. 1...Internal bus, 2...Arithmetic control unit, 3...Program counter, 4...Storage unit Applicant: Toshiba Corporation

Claims (1)

【特許請求の範囲】[Claims] (1)実行命令のアドレスを格納しているアドレス格納
手段と、処理手順を格納している処理手順格納手段とを
備えたマルチタスク処理を実行する情報処理装置におい
て、 前記情報処理装置が前記アドレス格納手段と前記処理手
順格納手段との間でそれぞれのデータの交換を行うタス
ク切換命令を具備し、マルチタスク処理の実行の際にこ
のタスク切換命令に基づいて各タスクの切換えを行うよ
うにしたことを特徴とする情報処理装置。
(1) In an information processing device that executes multitasking processing, the information processing device includes an address storage unit that stores an address of an execution instruction, and a processing procedure storage unit that stores a processing procedure, wherein the information processing device A task switching instruction is provided for exchanging data between the storage means and the processing procedure storage means, and each task is switched based on this task switching instruction when executing multitasking processing. An information processing device characterized by:
JP4714489A 1989-02-28 1989-02-28 Information processor Pending JPH02226429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4714489A JPH02226429A (en) 1989-02-28 1989-02-28 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4714489A JPH02226429A (en) 1989-02-28 1989-02-28 Information processor

Publications (1)

Publication Number Publication Date
JPH02226429A true JPH02226429A (en) 1990-09-10

Family

ID=12766909

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4714489A Pending JPH02226429A (en) 1989-02-28 1989-02-28 Information processor

Country Status (1)

Country Link
JP (1) JPH02226429A (en)

Similar Documents

Publication Publication Date Title
JPH06250853A (en) Management method and system for process scheduling
JPH02226429A (en) Information processor
JPH1173216A (en) Control software execution system of numerical controller
JP2553526B2 (en) Multitasking processor
JP2790472B2 (en) Multiple conversation processing control method
JPH04346136A (en) Virtual instruction processor structure control method
JPS63197239A (en) Saving/storing system for control information of virtual processor
JPH1153327A (en) Multiprocessor system
JPH0421028A (en) Register managing method
JP2927102B2 (en) Instruction string switching method and arithmetic processor using the same
JP3022398B2 (en) Virtual computer system
JPH02270032A (en) Loading system
JPH0830466A (en) Multitask switching control method
JPS58142451A (en) Interruption control system
JP2003271207A (en) Execution method of program and program development support device
JPH02113363A (en) Time slice controlling system for multiprocessor system
JPH02257232A (en) Interruption processing program managing method
JPH04182741A (en) Computer
JPS61248152A (en) Procedure change controlling system
JPH0375832A (en) Virtual machine control system
JP2003280930A (en) Medium with interprocess communication program recorded thereon and interprocess communication program
JPH1124950A (en) Parallel job swap system and record medium
JPH04155532A (en) Task switching system
JPH02211545A (en) Job execution control system
JPH0883188A (en) Multitask processing computer