JPH0388041A - Task switching system - Google Patents

Task switching system

Info

Publication number
JPH0388041A
JPH0388041A JP22515489A JP22515489A JPH0388041A JP H0388041 A JPH0388041 A JP H0388041A JP 22515489 A JP22515489 A JP 22515489A JP 22515489 A JP22515489 A JP 22515489A JP H0388041 A JPH0388041 A JP H0388041A
Authority
JP
Japan
Prior art keywords
register
task
processor
storage area
saved
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
JP22515489A
Other languages
Japanese (ja)
Inventor
Hidehiko Okada
英彦 岡田
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP22515489A priority Critical patent/JPH0388041A/en
Publication of JPH0388041A publication Critical patent/JPH0388041A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten a task switching time and to prevent system performance from being dropped by saving register information in a corresponding intra- memory register storing area in an intra-memory register storing area only when the register information is not stored in a register storing area and then copying the contents of the information. CONSTITUTION:Plural register storing areas 30-0 to 30-N for storing register information are formed in a processor, and when register information correspond ing to tasks allocated to the processor by a task allocating means 80 is stored in the register storing areas 30-0 to 30-N, the register information is copied/ saved between the areas 30-0 to 30-N and an intra-processor register 20. Only when the register information is not stored, the register information is copied/ saved between the register 20 and intra-memory register storing areas 60 formed in a main storage device 40. Consequently, the task switching time can be shortened and the system performance can be improved.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は計算機システムに於けるタスク切り替え方式に
関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a task switching method in a computer system.

〔従来の技術〕[Conventional technology]

従来の計算機システムに於けるタスク切り替え方式は、
主記憶装置上にタスク毎のレジスタ保存領域を設け、任
意のタスクがプロセッサに割付けられた時点で主記憶装
置上のレジスタ保存領域からレジスタ情報をプロセッサ
内のレジスタに複写してそのタスクをプロセッサ上で実
行し、その後、新たにタスクが切り替わる時点でプロセ
ッサ内のレジスタ情報を主記憶装置上の切り替えられる
タスクに対応するレジスタ保存領域に退避させるように
している。
The task switching method in conventional computer systems is
A register storage area is provided for each task on the main memory, and when a given task is assigned to a processor, register information is copied from the register storage area on the main memory to a register in the processor, and the task is transferred to the processor. After that, when a new task is switched, register information in the processor is saved to a register storage area corresponding to the task to be switched in the main memory.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上述した従来のタスク切り替え方式では、タスクが切り
替わる毎に主記憶装置のレジスタ保存領域に対するレジ
スタ情報の複写、退避が行なわれるため、主記憶装置に
対するアクセスが頻繁になり、タスク切り替えの時間を
増大させという問題があると共に、プロセッサとは非同
期に主記憶装置をアクセスする人出力制御装置等の装置
と主記憶装置に対するアクセスが競合する可能性が高く
なるため、システム性能が低下するという問題もある。
In the conventional task switching method described above, register information is copied and saved to the register storage area of the main memory every time the task is switched, which results in frequent access to the main memory and increases the time it takes to switch tasks. In addition to this problem, there is also the problem that system performance deteriorates because there is a high possibility that access to the main storage device will compete with a device such as a human output control device that accesses the main storage device asynchronously with the processor.

本発明の目的はタスク切り替え時間を短縮させると共に
、アクセス競合によるシステム性能の低下を防止するこ
とにある。
An object of the present invention is to shorten task switching time and to prevent system performance from deteriorating due to access contention.

〔課題を解決するための手段〕[Means to solve the problem]

本発明は上記目的を達成するため、 タスク対応のレジスタ情報を保存するメモリ内レジスタ
保存領域を有する主記憶装置と走行させるタスク対応の
レジスタ情報が複写されるプロセッサ内レジスタを有す
るプロセッサとを備えた計算機システムに於けるタスク
切り替え方式に於いて、 レジスタ情報を保存するレジスタ保存領域を前記プロセ
ッサ内に複数設けると共に、 プロセッサ割付は待ちのタスクの内からプロセッサを割
付けるタスクを選択するタスク割付は手段と・ タスクの切り替え時、前記タスク割付は手段で選択され
たタスク対応のレジスタ情報が前記レジスタ保存領域に
保存されていることにより、前記プロセッサ内レジスタ
の内容を前記レジスタ保存領域の内の複写元のレジスタ
保存領域に退避させた後、前記レジスタ保存領域に保存
されている前記タスク割付は手段で選択されたタスク対
応のレジスタ情報を前記プロセンサ内レジスタに複写し
、前記タスク割付は手段で選択されたタスク対応のレジ
スタ情報が前記レジスタ保存領域に保存されていないこ
とにより、前記プロセッサ内レジスタの内容を前記レジ
スタ保存領域の内の複写元のレジスタ保存領域に退避さ
せた後、前記レジスタ保存領域の内の1つに保存されて
いるレジスタ情報を前記メモリ内レジスタ保存領域の内
の対応するメモリ内レジスタ保存領域に退避させ、更に
、レジスタ情報の退避を行なった前記レジスタ保存領域
に前記タスク割付は手段が選択したタスク対応のメモリ
内レジスタ保存領域の内容を複写し、その後、メモリ内
レジスタ保存領域の内容を複写したレジスタ保存領域の
内容を前記プロセッサ内レジスタに複写するレジスタ保
存領域制御手段とを設けたものである。
In order to achieve the above object, the present invention includes a main storage device having an in-memory register storage area for storing register information corresponding to a task, and a processor having an in-processor register to which register information corresponding to the task to be executed is copied. In a task switching method in a computer system, a plurality of register storage areas for storing register information are provided in the processor, and processor allocation is a means for selecting a task to which a processor is allocated from waiting tasks. When switching tasks, the task allocation means stores the register information corresponding to the task selected in the register storage area, so that the contents of the register in the processor are copied to the copy source in the register storage area. After the task allocation is saved in the register storage area, the register information corresponding to the task selected by the means is copied to the register in the processor sensor, and the task allocation is saved in the register storage area. Since the register information corresponding to the task is not saved in the register saving area, after the contents of the registers in the processor are saved to the copy source register saving area in the register saving area, the contents of the register saving area are saved. The register information stored in one of the register storage areas is saved to a corresponding in-memory register storage area of the in-memory register storage areas, and the task is further allocated to the register storage area in which the register information is saved. register storage area control means for copying the contents of an in-memory register storage area corresponding to the task selected by the means, and then copying the contents of the register storage area in which the contents of the in-memory register storage area have been copied to the registers in the processor; It was established.

〔作 用〕[For production]

主記憶装置にはタスク対応のレジスタ情報を保存するメ
モリ内レジスタ保存領域が設けられ、プロセッサにはレ
ジスタ情報を保存する複数のレジスタ保存領域と走行さ
せるタスク対応のレジスタ情報が複写されるプロセッサ
内レジスタとが設けられている。タスク割付は手段はプ
ロセッサ割付は待ちのタスクの内からプロセッサを割付
けるタスクを選択する。レジスタ保存SN域制御手段は
タスク割付は手段が選択したタスク対応のレジスタ情報
がプロセッサ内に設けられている複数のレジスタ保存領
域の何れかに保存されている場合は、プロセッサ内レジ
スタの内容をレジスタ保存領域の内の複写元のレジスタ
保存領域に退避させ、その後、レジスタ保存領域に保存
されているタスク割付は手段が選択したタスク対応のレ
ジスタ情報をプロセッサ内レジスタに複写する。また、
タスり割付は手段が選択したタスク対応のレジスタ情報
がレジスタ保存領域に保存されていない場合はプロセッ
サ内レジスタの内容をレジスタ保存領域の内の複写元の
レジスタ保存領域に退避させた後、レジスタ保存領域の
内の1つに保存されているレジスタ情報をメモリ内レジ
スタ保存領域の内の対応するメモリ内レジスタ保存領域
に退避させ、更に、レジスタ情報の退避を行なったレジ
スタ保存領域にタスク割付は手段が選択したタスク対応
のメモリ内レジスタ保存領域の内容を複写し、その後、
メモリ内レジスタ保存領域の内容を複写したレジスタ保
存領域の内容をプロセッサ内レジスタに複写する。
The main storage device is provided with an in-memory register storage area for storing register information corresponding to a task, and the processor has multiple register storage areas for storing register information, and an in-processor register to which register information corresponding to the task to be executed is copied. and is provided. The task allocation means selects a task to which a processor is to be allocated from among waiting tasks. The register storage SN area control means performs task allocation by registering the contents of the registers within the processor if the register information corresponding to the task selected by the means is stored in any of the multiple register storage areas provided within the processor. It is saved in a copy source register storage area in the storage area, and then the task allocation stored in the register storage area copies the register information corresponding to the task selected by the means to the register in the processor. Also,
If the register information corresponding to the task selected by the means is not saved in the register save area, the contents of the registers in the processor are saved to the copy source register save area in the register save area, and then the register is saved. A means for saving register information stored in one of the areas to a corresponding in-memory register saving area among the in-memory register saving areas, and further assigning a task to the register saving area where the register information was saved. copies the contents of the in-memory register storage area corresponding to the selected task, and then
Copy the contents of the register save area in memory to the register in the processor.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して詳細に説明
する。
Next, embodiments of the present invention will be described in detail with reference to the drawings.

第1図は本発明の実施例のプロ・ツク図であり、プロセ
ッサ10と、主記憶装置40とを含んでいる。プロセッ
サ10はプロセッサ内レジスタ20と、プロセッサ10
が持つ割込みレベル#O〜#Nに対応した(N+1)個
のプロセッサ内レジスタ保存領域30−0〜30−Nと
、レジスタ保存領域制御手段70とを含んでいる。また
、主記憶装置40は制御テーブル50と、システム内の
各タスクのレジスタ情報を保存するメモリ内レジスタ保
存領域60と、タスク割付は手段80とを含んでいる。
FIG. 1 is a block diagram of an embodiment of the present invention, which includes a processor 10 and a main memory 40. As shown in FIG. The processor 10 has an internal register 20 and a processor 10
The processor includes (N+1) in-processor register storage areas 30-0 to 30-N corresponding to interrupt levels #O to #N, and a register storage area control means 70. The main storage device 40 also includes a control table 50, an in-memory register storage area 60 for storing register information of each task in the system, and task allocation means 80.

主記憶装置40上の制御テーブル50は第2図に示すよ
うに、プロセッサ10が持つ各割込みレベル#0〜#N
対応の領域を有している。そして、割込みレベル#j 
 (j−0〜N)対応の領域にはタスク割付は手段80
によって割込みレベル#jに現在割付けられているタス
クの識別子Tj(i+1)と、直前に割付けられたタス
クの識別子Tj  (+)とが格納されている。
As shown in FIG.
It has a corresponding area. and interrupt level #j
(j-0~N) Task assignment is done by means 80 in the corresponding area.
The identifier Tj(i+1) of the task currently assigned to interrupt level #j and the identifier Tj(+) of the task assigned immediately before are stored.

タスク割付は手段80はプロセッサIOの割当て待ちタ
スクの内の何れかを各タスクに与えられているタスク走
行優先レベルに基づいて選択し、選択したタスクをその
タスク走行優先レベルに対応した割込みレベルに割付け
、更に、制御テーブル50に格納されている現在割付け
られているタスクの識別子の内、上記選択したタスクを
割付けた割込みレベル対応の領域に格納されている識別
子を更新する。
For task allocation, the means 80 selects one of the tasks waiting to be allocated in the processor IO based on the task running priority level given to each task, and assigns the selected task to the interrupt level corresponding to the task running priority level. Furthermore, among the identifiers of the currently allocated tasks stored in the control table 50, the identifier stored in the area corresponding to the interrupt level to which the selected task is allocated is updated.

レジスタ保存領域制御手段70はタスク切り替え時点に
於いて、制御テーブル50の各割込みレベル対応の領域
の内、新たに走行することとなったタスクの割込みレベ
ル(割込みレベル#jとする)と対応する領域に格納さ
れている直前に割付けられたタスクの識別子Tj  (
i)と現在割付けられているタスクの識別子Tj  (
i+1)とを比較し、両者が不一致であることにより、
プロセンサ内レジスタ保存領域30−O〜30−Nの内
の上記新たに走行することとなったタスクの割込みレベ
ル#jと対応するプロセンサ内レジスタ保存領域30−
jの内容をメモリ内レジスタ保存領域60の内の直前に
割付けられたタスクの識別子Tj (1)と対応する領
域に退避させ、更に、メモリ内レジスタ保存領域60の
内の現在割付けられているタスクの識別子Tj  (i
+1)と対応する領域の内容をプロセッサ内レジスタ保
存領域30−0〜30−Nの内の割込みレベル#j対応
のプロセッサ内レジスタ保存領域30−jに復元する。
At the time of task switching, the register storage area control means 70 corresponds to the interrupt level of the newly running task (interrupt level #j) among the areas corresponding to each interrupt level in the control table 50. The identifier Tj (
i) and the currently assigned task identifier Tj (
i+1), and since they are inconsistent,
The register storage area 30- in the processor corresponding to the interrupt level #j of the task newly started to run among the register storage areas 30-O to 30-N in the processor sensor
The contents of j are saved in the area corresponding to the identifier Tj (1) of the task assigned immediately before in the in-memory register saving area 60, and the contents of the currently allocated task in the in-memory register saving area 60 are saved. The identifier Tj (i
+1) is restored to the in-processor register save area 30-j corresponding to interrupt level #j among the in-processor register save areas 30-0 to 30-N.

第3図、第4図はタスクの切り替え例を示したタイムチ
ャート、第5図はレジスタ保存領域制御手段70の処理
例を示す流れ図、第6図はタスク割付は手段80の処理
例を示す流れ図であり、以下各図を参照して本実施例の
動作を説明する。
3 and 4 are time charts showing an example of task switching, FIG. 5 is a flowchart showing an example of processing by the register storage area control means 70, and FIG. 6 is a flowchart showing an example of processing by the task allocation means 80. The operation of this embodiment will be explained below with reference to each figure.

先ず、タスクの切り替えが第3図に示すように行なわれ
た場合、即ち、時刻tO〜t1の区間では割込みレベル
#nに対応したタスク走行優先レベルを有するタスクA
が、時刻t1〜t2の区間では割込みレベル#mに対応
したタスク走行優先レベルを有するタスクBが、時刻t
2〜t3では割込みレベル#nに対応したタスク走行優
先レベルを有するタスクCが走行した場合を例にとって
動作を説明する。
First, when the task switching is performed as shown in FIG. 3, that is, in the interval from time tO to t1, task A has a task running priority level corresponding to interrupt level #n.
However, in the interval from time t1 to time t2, task B, which has a task running priority level corresponding to interrupt level #m, runs at time t1.
2 to t3, the operation will be explained using an example in which a task C having a task running priority level corresponding to interrupt level #n runs.

時刻tlに於いて、タスクAからタスクBへの切り替え
が行なわれる。タスクAからタスクBへの切り替え時、
タスク割付は手段80は第6図の流れ図に示すように、
ステップS81に於いて次にプロセッサ10に新たに割
付けるタスクBの割込みレベル#mを得、次のステップ
382に於いて制御テーブル50上の各別込みレベル#
0〜#Nに対応する領域の内の割込みレベル#mに対応
する領域に格納されている現在割付けられているタスク
識別子Tm(++1)をタスクBの識別子とする。
At time tl, task A is switched to task B. When switching from task A to task B,
The task allocation means 80 is as shown in the flowchart of FIG.
In step S81, the interrupt level #m of task B to be newly assigned to the processor 10 is obtained, and in the next step 382, each separate level #m on the control table 50 is obtained.
The currently assigned task identifier Tm(++1) stored in the area corresponding to interrupt level #m among the areas corresponding to 0 to #N is assumed to be the identifier of task B.

タスク割付は手段80により制御テーブル50の内容が
更新されると、レジスタ保存領域制御手段70は第5図
の流れ図に示す処理を開始し、先ず、ステップ370に
於いてプロセッサ内レジスタ20の内容をプロセッサ内
レジスタ保存領域30−0〜30−Nの内のタスクへの
割込みレベル#nと対応するプロセッサ内レジスタ保存
領域30−nに退避させ、次いでステップS71に於い
て次にプロセッサ10に割付けられるタスクBの割込み
レベル#mを得、次のステップS72に於いて*I <
Bテーブル50の割込みレベル#mに対応した領域に格
納されている直前に割付けられたタスクの識別子Tm(
i)と現在割付けられているタスクの識別子Tm(++
1)を得、続くステップS73に於いて両者を比較する
。そして、両者が等しい場合(ステップS74がYES
の場合)はレジスタ保存領域制御手段70ばプロセッサ
内レジスタ20にプロセッサ内レジスタ保存領域30−
mの内容を複写してタスクBの走行を開始させた後(ス
テップ578)、その処理を終了する。
When the task allocation means 80 updates the contents of the control table 50, the register storage area control means 70 starts the process shown in the flowchart of FIG. It is saved in the processor register storage area 30-n corresponding to the interrupt level #n for the task among the processor register storage areas 30-0 to 30-N, and then allocated to the processor 10 in step S71. The interrupt level #m of task B is obtained, and in the next step S72 *I <
The identifier Tm(
i) and the currently assigned task identifier Tm(++
1) is obtained, and the two are compared in the subsequent step S73. If both are equal (step S74 is YES)
), the register storage area control means 70 stores the internal processor register 20 in the internal processor register storage area 30-.
After copying the contents of m and starting running task B (step 578), the process ends.

また、両者が不一致の場合(ステップ374の判断結果
がNoの場合)はステップ375に於いてプロセッサ内
レジスタ保存領域30−0〜3〇−Nの内の新たに走行
することとなったタスクBの割込みレベル#mと対応す
るプロセッサ内しジスク保存領域30−mの内容をメモ
リ内レジスタ保存領域60の内の直前に割付けられたタ
スクの識別子Tm (+)と対応する領域に退避させ、
次のステップ376に於いてメモリ内レジスタ保存領域
60の内の現在割付けられているタスクの識別子Tm(
++1)と対応する領域の内容をプロセンサ内レジスタ
保存領域30−O〜30−Nの内の割込みレベル性m対
応のプロセッサ内レジスタ保存領域30−mに復元し、
次のステップ377に於いて制御テーブル50の割込み
レベル#mに対応する領域に格納されている直前に割付
けられたタスクの識別子Tm(i)をタスクBを示すも
のとし、その後、ステップ37Bの処理を行なう。
In addition, if the two do not match (if the judgment result in step 374 is No), in step 375, task B, which is to be newly run, in the register storage areas 30-0 to 30-N in the processor is selected. saves the contents of the disk storage area 30-m in the processor corresponding to the interrupt level #m in the area corresponding to the identifier Tm (+) of the task assigned immediately before in the register storage area 60 in the memory;
In the next step 376, the currently allocated task identifier Tm(
++1) is restored to the processor register storage area 30-m corresponding to interrupt level m among the processor register storage areas 30-O to 30-N;
In the next step 377, the identifier Tm(i) of the task assigned immediately before, which is stored in the area corresponding to the interrupt level #m of the control table 50, is set to indicate task B, and then the process in step 37B is performed. Do this.

時刻t2に於いてタスクBからタスクCへの切り替えが
行なわれる。この場合も、前述したタスク割付は手段8
0により制御テーブル50の更新が行なわれる。即ち、
ステップS81に於いて新たにプロセッサ10に割付け
られるタスクCの割込みレベル#nが求められ、次のス
テップ382に於いて制御テーブル50の割込みレベル
#nに対応する領域に格納されている現在割付けられて
いるタスクの識別子Tn (++1)がタスクCを示す
ものに更新される。
At time t2, task B is switched to task C. In this case as well, the task allocation described above is
0 causes the control table 50 to be updated. That is,
In step S81, the interrupt level #n of task C newly assigned to the processor 10 is determined, and in the next step 382, the currently assigned interrupt level #n stored in the area corresponding to the interrupt level #n of the control table 50 is determined. The identifier Tn (++1) of the current task is updated to indicate task C.

タスク割付は手段80により制御テーブル50が更新さ
れると、レジスタ保存領域制御手段70は第5図の流れ
図の処理を開始し、先ず、ステップS70に於いてプロ
セッサ内レジスタ20の内容をプロセッサ内レジスタ保
存領域30−0〜30−Nの内のタスクBの割込みレベ
ル#mと対応するプロセッサ内レジスタ保存領域30−
mに退避させ、次いでステップ371に於いて新たにプ
ロセッサ10に割り当てられることになったタスクCの
割込みレベル#nを得、次のステップS72に於いて制
御テーブル50の割込みレベル#nに対応した領域に格
納されている直前に割付けられたタスクの識別子Tn 
(i)と現在割付けられているタスクの識別子Tn (
++1)とを得、続くステップS73に於いて両者を比
較する。ここで直前に割付けられたタスクの識別子Tn
 (i)。
When the task allocation control table 50 is updated by the means 80, the register storage area control means 70 starts the process shown in the flowchart of FIG. Internal processor register storage area 30- corresponding to interrupt level #m of task B in storage areas 30-0 to 30-N
Then, in step 371, the interrupt level #n of the task C to be newly assigned to the processor 10 is obtained, and in the next step S72, the interrupt level #n of the task C corresponding to the interrupt level #n of the control table 50 is obtained. Identifier Tn of the task assigned immediately before stored in the area
(i) and the currently assigned task identifier Tn (
++1) is obtained, and the two are compared in the subsequent step S73. Here, the identifier Tn of the task assigned immediately before
(i).

現在割付けられているタスクの識別子Tn(++1)は
それぞれタスクA、タスクCを示すものであり、ステッ
プS74の判断結果がNoとなるので、プロセッサ内し
ジスク保存領域30−nの入れ替えが行なわれる。プロ
センサ内レジスタ保存領域30−nの入れ替えはステッ
プ375に於いてプロセッサ内レジスタ保存領域#30
−nの内容をメモリ内レジスタ保存領域60の内の直前
に割付けられたタスクの識別子Tn (+)に対応する
領域に退避させ、次のステップS76に於いてメモリ内
レジスタ保存領域60内の現在割付けられているタスク
の識別子Tn(++1)と対応する領域の内容をプロセ
ッサ内レジスタ保存領域30−nに複写することにより
行なわれる。
The currently assigned task identifiers Tn(++1) indicate task A and task C, respectively, and since the judgment result in step S74 is No, the disk storage area 30-n in the processor is replaced. . The internal processor register storage area 30-n is replaced with the internal processor register storage area #30-n in step 375.
The contents of -n are saved in the area corresponding to the identifier Tn (+) of the task assigned immediately before in the in-memory register saving area 60, and in the next step S76, the contents of the in-memory register saving area 60 are saved. This is done by copying the contents of the area corresponding to the assigned task identifier Tn(++1) to the in-processor register storage area 30-n.

プロセッサ内レジスタ保存領域30−nの入れ替えを行
なうと、レジスタ保存領域制御手段70はステップS7
7に於いて制御テーブル50の割込みレベル#nに対応
する領域に格納されている直前に割付けられたタスクの
識別子Tn (i)をタスクCを示すものとし、その後
、ステップ878に於いてプロセッサ内レジスタ20に
プロセッサ内レジスタ保存領域30−nの内容を複写し
、タスクCの走行を開始させる。
After replacing the in-processor register storage area 30-n, the register storage area control means 70 performs step S7.
In step 878, the identifier Tn (i) of the task assigned immediately before, which is stored in the area corresponding to the interrupt level #n of the control table 50, is set to indicate task C, and then in step 878, The contents of the in-processor register storage area 30-n are copied to the register 20, and task C starts running.

次に、タスクの切り替えが第4図に示すように行なわれ
た場合、即ち、時刻tO〜t1の区間では割込みレベル
#nに対応したタスク走行優先レベルを有するタスクA
が、時刻t1〜t2の区間では割込みレベル#mに対応
したタスク走行優先レベルを有するタスクBが、時刻t
2〜t3では再び割込みレベル#nに対応したタスク走
行優先レベルを有するタスクAが走行した場合を例にと
って動作を説明する。
Next, if the task switching is performed as shown in FIG.
However, in the interval from time t1 to time t2, task B, which has a task running priority level corresponding to interrupt level #m, runs at time t1.
2 to t3, the operation will be explained again by taking as an example the case where task A having the task running priority level corresponding to interrupt level #n runs.

時刻t2までは、前述した第3図の説明と同じ動作が行
なわれ、時刻t2に於いてタスクBからタスクAへの切
り替えが行なわれる。タスクBからタスクAへの切り替
え時、タスク割付は手段80はステップS81に於いて
次にプロセンサ10に割付けられることとなったタスク
への割込みレベル#nを得、次のステップS82に於い
て制御テーブル50上の割込みレベル#nに対応する領
域に格納されている現在割付けられているタスクの識別
子Tn(i)をタスクAに示すものにする。
Until time t2, the same operation as described above in FIG. 3 is performed, and at time t2, task B is switched to task A. When switching from task B to task A, the task allocation means 80 obtains the interrupt level #n for the task to be next allocated to the prosensor 10 in step S81, and performs control in the next step S82. The currently assigned task identifier Tn(i) stored in the area corresponding to interrupt level #n on the table 50 is set to be the one shown in task A.

II JBテーブル50の更新が終了すると、レジスタ
保存領域制御手段70は第5図の流れ図に示す処理を開
始し、ステップ370に於いてプロセッサ内レジスタ2
0の内容をプロセッサ内レジスタ保存領域30−O〜3
0−Nの内のタスクBの割込みレベル#mと対応するプ
ロセッサ内レジスタ保存領域30−mに退避させ、ステ
ップS71に於いて次にプロセッサ10に割り当てられ
ることとなったタスクへの割込みレベル#nを得、次の
ステップS72に於いて制御テーブル50の割込みレベ
ル#nと対応する領域に格納されている直前に割付けら
れたタスクの識別子Tn (i)と現在割付けられてい
るタスクの識別子Tn (++1)とを得、ステップS
73に於いて両者を比較する。
II When the update of the JB table 50 is completed, the register storage area control means 70 starts the process shown in the flowchart of FIG.
The contents of 0 are saved in the register storage area 30-O to 3 in the processor.
The interrupt level #m of task B among 0-N is saved to the corresponding in-processor register storage area 30-m, and the interrupt level # of the task to be assigned next to the processor 10 in step S71. n is obtained, and in the next step S72, the identifier Tn (i) of the task assigned immediately before and the identifier Tn of the currently assigned task stored in the area corresponding to the interrupt level #n of the control table 50 are obtained. (++1) and step S
73, the two will be compared.

ここで、タスクの識別子Tn (i)、Tn (++1
)は共にタスクAを示すものとなっており、ステップ3
74の判断結果がYESとなるので、レジスタ保存領域
制御手段70はプロセッサ内レジスタ保存領域30−n
の内容をそのままプロセッサ内レジスタ20に複写し、
タスクAの走行を開始させる。従って、本実施例によれ
ば、外部割込み等により中断されたタスクを再度走行さ
せる場合や、1つの割込みレベルにタスクが1つしか存
在しない場合等、主記憶装置上のレジスタ保存領域を全
くアクセスする必要がないので、タスクの切り替えを高
速化することが可能となる。
Here, task identifiers Tn (i), Tn (++1
) both indicate task A, and step 3
74 is YES, the register storage area control means 70 saves the register storage area 30-n in the processor.
Copy the contents as they are to the register 20 in the processor,
Start running task A. Therefore, according to this embodiment, the register storage area in the main memory is not accessed at all, such as when restarting a task that has been interrupted by an external interrupt, or when there is only one task at one interrupt level. Since there is no need to do this, it is possible to speed up task switching.

尚、上述した実施例に於いては各側込みレベルに対応さ
せてプロセッサ内レジスタ保存領域を1つずつ設けるよ
うにしたが、割込みレベルに無関係にプロセッサ内に複
数のプロセッサ内レジスタ保存領域を設け、新たにプロ
セッサが割付けられることになったタスク対応のレジス
タ情報がプロセッサ内レジスタ保存領域に保存されてい
ない場合のみ、主記憶装置上のメモリ内レジスタ保存領
域との間で複写、退避を行なうようにすることもできる
In the above-described embodiment, one in-processor register storage area is provided corresponding to each side interrupt level, but it is also possible to provide a plurality of in-processor register storage areas in the processor regardless of the interrupt level. , only when the register information corresponding to the task to which a new processor is allocated is not saved in the register storage area within the processor, is it copied or saved to the register storage area in memory on the main storage device. It can also be done.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明は、プロセッサ内にレジス
タ情報を保存するレジスタ保存領域を複数設け、プロセ
ッサ内のレジスタ保存領域にタスク割付は手段でプロセ
ッサに割付けられたタスク対応のレジスタ情報が保存さ
れている場合はプロセッサ内に設けられているレジスタ
保存領域とプロセンサ内レジスタとの間でレジスタ情報
の複写。
As explained above, the present invention provides a plurality of register storage areas for storing register information in a processor, and stores register information corresponding to a task allocated to a processor in the register storage area in the processor by means of task allocation. If so, copy register information between the register storage area provided in the processor and the registers in the processor.

退避を行なうようにし、保存されていない場合のみ、主
記憶装置に設けられているメモリ内保レジスタ保存領域
との間でレジスタ情報の複写、退避を行なうようにした
ものであり、プロセッサ内のレジスタ保存領域にレジス
タ情報が保存されているタスクにプロセッサが割り当て
られた場合は主記憶装置上のメモリ内レジスタ保存領域
を全くアクセスすることなくタスクの切り替えを行なう
ことが可能となるので、タスク切り替え時間の短縮が可
能となる。また、更に、主記憶装置に対するアクセスを
減少させることができるので、プロセッサ以外の制御装
置との主記憶競合を減らすことができ、システム性能を
向上させることが可能となる効果もある。
Register information is saved, and only if it has not been saved, the register information is copied and saved to the in-memory register save area provided in the main memory, and the register information in the processor is saved. When a processor is assigned to a task whose register information is saved in the storage area, it is possible to switch tasks without accessing the register storage area in memory on the main memory, which reduces task switching time. can be shortened. Furthermore, since access to the main memory device can be reduced, main memory contention with control devices other than the processor can be reduced, and system performance can be improved.

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

第1図は本発明の実施例のブロック図、第2図は制御テ
ーブル50の内容例を示す図、第3図、第4図はタスク
切り替え動作を示すタイムチャート、 第5図はレジスタ保存領域制御手段70の処理例を示す
流れ図及び、 第6図はタスク割付は手段80の処理例を示す流れ図で
ある。 図に於いて、10・・・プロセンサ、2o・・・プロセ
ッサ内レジスタ、30−0〜30−N・・・プロセッサ
内レジスタ保存領域、40・・・主記憶装置、5゜・・
・制御テーブル、60・・・メモリ内レジスタ保存領域
、70・・・レジスタ保存領域制御手段、8o・・・タ
スク割付は手段。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing an example of the contents of the control table 50, FIGS. 3 and 4 are time charts showing task switching operations, and FIG. 5 is a register storage area. A flowchart showing an example of processing by the control means 70, and FIG. 6 is a flowchart showing an example of processing by the task allocation means 80. In the figure, 10...Prosensor, 2o...Register in the processor, 30-0 to 30-N...Register storage area in the processor, 40...Main memory, 5°...
- Control table, 60...Register storage area in memory, 70...Register storage area control means, 8o...Task allocation means.

Claims (1)

【特許請求の範囲】 タスク対応のレジスタ情報を保存するメモリ内レジスタ
保存領域を有する主記憶装置と走行させるタスク対応の
レジスタ情報が複写されるプロセッサ内レジスタを有す
るプロセッサとを備えた計算機システムに於けるタスク
切り替え方式に於いて、 レジスタ情報を保存するレジスタ保存領域を前記プロセ
ッサ内に複数設けると共に、 プロセッサ割付け待ちのタスクの内からプロセッサを割
付けるタスクを選択するタスク割付け手段と、 タスクの切り替え時、前記タスク割付け手段で選択され
たタスク対応のレジスタ情報が前記レジスタ保存領域に
保存されていることにより、前記プロセッサ内レジスタ
の内容を前記レジスタ保存領域の内の複写元のレジスタ
保存領域に退避させた後、前記レジスタ保存領域に保存
されている前記タスク割付け手段で選択されたタスク対
応のレジスタ情報を前記プロセッサ内レジスタに複写し
、前記タスク割付け手段で選択されたタスク対応のレジ
スタ情報が前記レジスタ保存領域に保存されていないこ
とにより、前記プロセッサ内レジスタの内容を前記レジ
スタ保存領域の内の複写元のレジスタ保存領域に退避さ
せた後、前記レジスタ保存領域の内の1つに保存されて
いるレジスタ情報を前記メモリ内レジスタ保存領域の内
の対応するメモリ内レジスタ保存領域に退避させ、更に
、レジスタ情報の退避を行なった前記レジスタ保存領域
に前記タスク割付け手段が選択したタスク対応のメモリ
内レジスタ保存領域の内容を複写し、その後、メモリ内
レジスタ保存領域の内容を複写したレジスタ保存領域の
内容を前記プロセッサ内レジスタに複写するレジスタ保
存領域制御手段とを設けたことを特徴とするタスク切り
替え方式。
[Scope of Claims] A computer system comprising a main memory having an in-memory register storage area for storing register information corresponding to a task, and a processor having an in-processor register to which register information corresponding to a task to be executed is copied. In the task switching method, a plurality of register storage areas for storing register information are provided in the processor, and a task allocation means selects a task to be allocated to a processor from among tasks waiting to be allocated to a processor; , the register information corresponding to the task selected by the task allocation means is stored in the register storage area, so that the contents of the register in the processor are saved to a copy source register storage area in the register storage area. After that, the register information corresponding to the task selected by the task allocation means stored in the register storage area is copied to the register in the processor, and the register information corresponding to the task selected by the task allocation means is copied to the register. Since the contents of the register in the processor are not saved in the storage area, the contents of the register in the processor are saved in one of the register storage areas after being evacuated to the copy source register storage area in the register storage area. The register information is saved to a corresponding in-memory register saving area among the in-memory register saving areas, and further, the in-memory register corresponding to the task selected by the task allocation means is saved in the register saving area where the register information is saved. A task switching method comprising register storage area control means for copying the contents of the storage area and then copying the contents of the register storage area into the register in the processor. .
JP22515489A 1989-08-31 1989-08-31 Task switching system Pending JPH0388041A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22515489A JPH0388041A (en) 1989-08-31 1989-08-31 Task switching system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22515489A JPH0388041A (en) 1989-08-31 1989-08-31 Task switching system

Publications (1)

Publication Number Publication Date
JPH0388041A true JPH0388041A (en) 1991-04-12

Family

ID=16824793

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22515489A Pending JPH0388041A (en) 1989-08-31 1989-08-31 Task switching system

Country Status (1)

Country Link
JP (1) JPH0388041A (en)

Similar Documents

Publication Publication Date Title
US6591355B2 (en) Distributed shared memory system with variable granularity
JPH04299440A (en) Shared register control system
WO2019012252A1 (en) Method and apparatus for fast context cloning in a data processing system
GB2386715A (en) Method for the use of a stack in a Java accelerator device
JP6421247B2 (en) System and method for memory synchronization in a multi-core system
JP2002073378A (en) Method and device for obtaining dump of computer system
JP2001117786A (en) Process scheduling device and process scheduling method
JPH0388041A (en) Task switching system
KR100594187B1 (en) Timer driving method in intelligent network switching system under Unix system environment with thread call processing structure
JPH09146904A (en) Address space sharing system
JP3520527B2 (en) Data management method
JPH07182239A (en) Segment division managing system
JPH06119190A (en) Task switching processing system
JP2787107B2 (en) Buffer control system and device
JPH07230358A (en) Multiplexed volume device
JPS61279959A (en) Saving and outputting system for main storage
JPH0378843A (en) Program control system using extension memory
JPS6273335A (en) Stack control system
JPH0285933A (en) Information processor
JPH03182945A (en) Transfer system for data in main storage
JPS61184650A (en) Main storage allocation system of electronic computer system
JPH09212426A (en) Storage device managing method for virtual computer system
JPS63314647A (en) Saving/restoring system for task run environment
JPH02178748A (en) Virtual storage control method for virtual storage computer system
JPH05165703A (en) Saving memory allocation method