JPS62221040A - Stack control system - Google Patents

Stack control system

Info

Publication number
JPS62221040A
JPS62221040A JP6359486A JP6359486A JPS62221040A JP S62221040 A JPS62221040 A JP S62221040A JP 6359486 A JP6359486 A JP 6359486A JP 6359486 A JP6359486 A JP 6359486A JP S62221040 A JPS62221040 A JP S62221040A
Authority
JP
Japan
Prior art keywords
stack
real
block
executed
main memory
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
JP6359486A
Other languages
Japanese (ja)
Inventor
Akira Yasusato
安里 彰
Fumio Honda
文雄 本田
Shinichi Shimizu
慎一 清水
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP6359486A priority Critical patent/JPS62221040A/en
Publication of JPS62221040A publication Critical patent/JPS62221040A/en
Pending 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Landscapes

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

Abstract

PURPOSE:To evade a stack fault and to increases the processing speed of a stack control system by detecting previously the stack of a process to be newly set under a run state, and loading this stack as long as it is not included in a real stack. CONSTITUTION:A scheduling table 10 is provided to detect the process to be executed next and a desired block. The table 10 contains the name of the process under execution, the name of the process to be executed next, the block numbers of these processes, and the name and block number of the process to be executed after the next one written in a so-called matrix form. Thus the stack number of the process to be executed next is obtained and the presence or absence of the relevant number is detected by a stack control table 11. If said number is not detected, an undesired block is detected out of a real stack 12 and the stack of the process to be needed in the near future is transcribed to the stack 12 from a main memory 2. As a result, the next data processing can be executed with high efficiency.

Description

【発明の詳細な説明】 〔目次〕 概要 産業上の利用分野 従来の技術 (第5図〜第7図) 発明が解決しようとする問題点 問題点を解決するための手段 (第1図)作用 実施例 (a)実施例の構成 (第2図、第3図)(b)実施例
の動作 (第4図) 発明の効果 〔概要〕 仮想スタック方式のシステムにおいて、新たにラン(R
UN)状態となるべきプロセスのスタックを事前に検出
して、そのスタックが実スタックに存在していないとき
、これをロードすることにより、スタック・フォルトを
回避して処理の高速化をはかるものである。
[Detailed description of the invention] [Table of contents] Overview Industrial field of application Prior art (Figures 5 to 7) Problems to be solved by the invention Means for solving the problems (Figure 1) Effect Embodiment (a) Structure of the embodiment (Figs. 2 and 3) (b) Operation of the embodiment (Fig. 4) Effects of the invention [Summary] In a virtual stack system, a new run (R
By detecting the stack of a process that should be in the UN) state in advance and loading it when the stack does not exist in the real stack, stack faults can be avoided and processing speeded up. be.

〔産業上の利用分野〕[Industrial application field]

本発明はスタック制御方式に係り、特に仮想スタック方
式を用いたシステムにおいて、スタック・フォルトの発
生回数を減少させて、全体の処理の高速化をはかるよう
にしたものである。
The present invention relates to a stack control method, and particularly to a system using a virtual stack method, in which the number of occurrences of stack faults is reduced and overall processing speed is increased.

〔従来の技術〕[Conventional technology]

仮想スタック方式でデータ処理を行う場合、例えば第5
図に示す如く、プロセスPl、P2、−・・Pm・−・
の各プロセスは自己の仮想空間内にスタック域としてN
ブロックの領域をもっている。そしてこれらのスタック
域は、第6図に示す如く、主メモリに格納されている。
When performing data processing using the virtual stack method, for example, the fifth
As shown in the figure, processes Pl, P2, --- Pm ---
Each process has N as a stack area in its own virtual space.
It has a block area. These stack areas are stored in the main memory as shown in FIG.

ところでこれらのプロセスP ISP 2−−−−P 
mが中央処理装置(CPU)により動作される場合、第
6図に示す如く、CPU内に設けられた実スタック(物
理スタック)上に必要とするプロセスのスタック域の部
分が存在することが必要である。
By the way, these processes P ISP 2---P
When m is operated by a central processing unit (CPU), as shown in Figure 6, the stack area of the required process must exist on the real stack (physical stack) provided within the CPU. It is.

しかるにCPU上に設けられたこの実スタックはn (
n<N、図ではn=4の例)ブロックしか存在せず、し
たがって各プロセスが順次これを使用することになる。
However, this real stack provided on the CPU is n (
There are only blocks (n<N (in the example, n=4 in the figure)), and therefore each process sequentially uses them.

そのためある時点で各実スタックの物理ブロックO〜3
がどのように使用されているかということを管理するた
め、第6図に示す如く、CPU側にスタック管理テーブ
ルを設けている。このスタック管理テーブルには、プロ
セス名とそのブロック名、有効ビンt−v等が記入され
ている。
Therefore, at a certain point, physical blocks O to 3 of each real stack
In order to manage how the CPU is used, a stack management table is provided on the CPU side, as shown in FIG. The process name, its block name, valid bin tv, etc. are entered in this stack management table.

あるプロセスがラン状態のとき、必要とする論理ブロッ
クがこの実スタック上にないと、割込みとしてCPUに
通知され、第7図に示す如く、適当なブロック例えば物
理ブロック2のデータを主メモリのそのスタックに追い
出し、必要なデータを主メモリのスタック域より読込む
処理すなわち、スタック・フォルト処理が行われる。
When a certain process is in a running state, if a required logical block is not on this real stack, the CPU is notified as an interrupt, and as shown in Figure 7, the data of an appropriate block, for example, physical block 2, is transferred to the main memory. Stack fault processing is performed, in which the data is flushed to the stack and necessary data is read from the stack area of main memory.

通常、このスタック・フォルトに伴うデータ転送はCP
Uにとってかなりのオーバヘッドとなる。
Typically, the data transfer associated with this stuck fault is
This is a significant overhead for U.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

従来は、単にスタック・フォルト、すなわち実行すべき
プロセスの必要とするスタックのブロックが実スタック
上に存在しなかったことが検出された時点で、必要なブ
ロックの読み込みを行っていたが、この方式では実スタ
ック上には現在ラン状態のプロセスおよび最近ラン状態
であったプロセスのブロックが多く存在し、プロセスの
切換えが起った場合に新らしくラン状態になるプロセス
のスタックが存在することが少なく、このためプロセス
・スイッチの度にスタック・フォルトが発生するという
問題があった。
Previously, the required block was simply read when a stack fault was detected, that is, the stack block required by the process to be executed did not exist on the real stack. In this case, there are many blocks of processes that are currently running and processes that have recently been running on the actual stack, and when a process switch occurs, there are few stacks of processes that will newly become running. Therefore, there was a problem in that a stack fault occurred every time a process switch was performed.

本発明の目的はこの問題点を解決するため、プロセスが
スケジューリングされるに先立ちそのプロセスが必要と
するスタックのブロックが実スタック上に転送されてい
るようにしたスタック制御方式を提供することである。
SUMMARY OF THE INVENTION In order to solve this problem, it is an object of the present invention to provide a stack control method in which stack blocks required by a process are transferred onto the real stack before the process is scheduled. .

〔問題点を解決するための手段〕[Means for solving problems]

前記目的を達成するため、本発明では、第1図に示す如
く、スケジューリング・テーブルを設けて次に実行され
るべきプロセスおよびその必要とするブロックを検出す
る。スケジューリング・テーブルには現在実行中のプロ
セス名、次に実行するプロセス名とそのスタックのブロ
ック番号、次の次に実行するプロセス名とブロック番号
等が、いわゆる待ち行列のような形で記入されている。
To achieve the above object, in the present invention, as shown in FIG. 1, a scheduling table is provided to detect the process to be executed next and the blocks it requires. In the scheduling table, the name of the process currently being executed, the name of the process to be executed next and its stack block number, the name of the process to be executed next and the block number, etc. are entered in a so-called queue-like format. There is.

〔作用〕[Effect]

したがってスケジューリング・テーブルにより次に実行
されるべきプロセスのスタック番号がわかるので、その
有無をスタック管理テーブルにより検出し、なければ実
スタックより不必要なブロックを探して近き将来必要と
なるプロセスのスタックを主メモリより実スタック上に
転記しておくので、次のデータ処理を効率よく実行する
ことができる。
Therefore, since the stack number of the process to be executed next is known from the scheduling table, its presence or absence is detected from the stack management table, and if it is not present, unnecessary blocks are searched from the actual stack to create the stack of the process that will be needed in the near future. Since the data is transferred from the main memory to the real stack, the next data processing can be executed efficiently.

〔実施例〕〔Example〕

(al  一実施例の構成 本発明の一実施例構成を第2図および第3図により説明
する。
(al) Configuration of an Embodiment The configuration of an embodiment of the present invention will be explained with reference to FIGS. 2 and 3.

第2図は本発明の一実施例構成図、第3図はそのスケジ
ユーリング・テーブルの説明図である。
FIG. 2 is a configuration diagram of an embodiment of the present invention, and FIG. 3 is an explanatory diagram of its scheduling table.

第2図において、1はCPU、2は主メモリ、3は制御
部である。
In FIG. 2, 1 is a CPU, 2 is a main memory, and 3 is a control section.

CPU1には、スケジューリング・テーブル10、スタ
ック管理テーブル11、実スタック12、転送フラグ1
3等が具備されており、主メモリ2にはスタックのバン
クアップ域21.22.23.24.25・−・が設け
られ、これらにプロセスP1、P2、P3・−・のスタ
ック域がブロック単位で格納されている。
The CPU 1 has a scheduling table 10, a stack management table 11, a real stack 12, and a transfer flag 1.
3, etc., and the main memory 2 is provided with stack bank up areas 21, 22, 23, 24, 25, etc., and the stack areas of processes P1, P2, P3, and so on are blocks. Stored in units.

制御部3はスケジューリング・テーブル10、スタック
管理テーブル11を参照し、次にランになるべきプロセ
スが使用するブロックが実スタック上にあるかどうかを
常に監視しており、もしなければ独自の転送路を用いて
主メモリと実スタック間のデータ転送を行い、同時にス
タック管理テーブルも適宜更新する。またCPUIとの
整合性のため転送フラグ13をオン・オフするものであ
り、制御部3がこの転送を行っている間はオンとなり、
オンの間はCPUIはスタック管理テーブル11の操作
を行わないようにすることにより、CPLI側で生じた
スタック・フォルトとの競合を避ける。
The control unit 3 refers to the scheduling table 10 and the stack management table 11 and constantly monitors whether or not there is a block on the real stack that will be used by the process that should become the next run. is used to transfer data between the main memory and the real stack, and at the same time update the stack management table as appropriate. Also, for consistency with the CPUI, the transfer flag 13 is turned on and off, and remains on while the control unit 3 is performing this transfer.
While on, the CPUI does not operate the stack management table 11 to avoid conflict with a stack fault occurring on the CPLI side.

スケジューリング・テーブルlOは、ある時点でラン状
態のプロセス、次にシンとなるべき(READY状態)
プロセスおよびそのプロセスがランになったときに用い
るスタックのブロックに関する情報が格納されているも
ので、図示省略したスケジューラにより管理されている
The scheduling table IO should be a running process at one point and then thin (READY state).
It stores information about a process and the stack blocks used when the process is in a run, and is managed by a scheduler (not shown).

スタック管理テーブル11は、実スタック12の各ブロ
ックO〜3がどのプロセスのどのブロックに相当してい
るのか、またはどのプロセスも使用していないのかとい
ったデータを保持するテーブルであって、CPUIによ
り更新管理される。
The stack management table 11 is a table that holds data such as which block of which process each block O to 3 of the real stack 12 corresponds to, or whether it is not used by any process, and is updated by the CPUI. managed.

(b)  実施例の動作 第2図に示す本発明の一実施例の動作を第4図に示す制
御部3の動作を示すフローチャートにもとづき、地図を
参照しつつ説明する。制御部3の動作は、第4図(a)
に示す如(、ループであり、常にスタックの使用状況を
監視し、必要に応じて実スタック12ヘデータ転送を行
うものである。
(b) Operation of the Embodiment The operation of the embodiment of the present invention shown in FIG. 2 will be explained based on the flowchart showing the operation of the control section 3 shown in FIG. 4 and with reference to a map. The operation of the control unit 3 is shown in FIG. 4(a).
As shown in (), this is a loop that constantly monitors the usage status of the stack and transfers data to the real stack 12 as necessary.

■ 制御部3は、スケジューリング・テーブル10を読
出して次にランとなるプロセスのブロックを認識する。
(2) The control unit 3 reads the scheduling table 10 and recognizes the block of the process that will be the next run.

■ このようにして認識したブロックが実スタック12
上に存在するかどうかを検索するため、制御部3はスタ
ック管理テーブル11をサーチする。これにより該ブロ
ックがすでに実スタック12上に存在すれば、制御部3
は再び前記■を行うが、もし存在しなければ事前に実ス
タック12にこれをロードするために必要な実スタック
のブロックを探すため、スタック管理テーブル11をサ
ーチする。
■ The block recognized in this way is the real stack 12
The control unit 3 searches the stack management table 11 to find out whether the stack exists on the top. As a result, if the block already exists on the real stack 12, the control unit 3
performs the above step (2) again, but if the block does not exist, the stack management table 11 is searched for a block of the real stack necessary to load it into the real stack 12 in advance.

■ 即ち、第4図(b)に示す如く、まず有効フラグ■
をチェックして空いているブロックがあるが調べ、なけ
ればランでないプロセスのブロックがあるか否か調べ、
あればそのランでないプロセスのブロックが次にランと
ならないいわゆるレディ(’READY)でないプロセ
スのブロックがあるかどうか調べる。
■ That is, as shown in FIG. 4(b), first the valid flag ■
Check to see if there are free blocks, and if not, check to see if there are any blocks for non-running processes.
If so, it is checked whether there is a block of a so-called non-ready process in which the block of the non-run process will not become the next run.

■ この結果次のプロセスのために必要なスタックを転
送できるブロックが実スタック12上になければ前記■
に戻る。ところでこのようなブロックが実スタック12
上にあれば、制御部3は転送フラグ13をオンにする。
■ As a result, if there is no block on the real stack 12 that can transfer the stack necessary for the next process, then
Return to By the way, such a block is the real stack 12
If it is above, the control unit 3 turns on the transfer flag 13.

■ このとき、実スタック12上の前記転送可能なブロ
ックが空きブロックであって追い出し処理が必要のない
ときは、制御部3は主メモリ2より前記■で認識した次
にシンとなるプロセスのブロックを読出して実スタック
12へ転送し、転送フラグをオフになる。しかし前記転
送可能なブロックに有効なデータが存在する場合には、
これを主メモリ2に追い出す処理を行ってから、前記■
のブロックを実スタックに転送し、転送フラグをオフに
する。
■ At this time, if the transferable block on the real stack 12 is a free block and no eviction processing is necessary, the control unit 3 reads the block of the next thin process recognized in the above ■ from the main memory 2. is read out and transferred to the real stack 12, and the transfer flag is turned off. However, if valid data exists in the transferable block,
After performing the process of expelling this to main memory 2,
Transfer the block to the real stack and turn off the transfer flag.

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

本発明によれば、プロセスがランとなる前にそのプロセ
スに必要なスタックが実スタック上にないことが検出し
て転送処理を行うことができる。
According to the present invention, it is possible to detect that the stack necessary for the process is not on the real stack before the process starts running, and to perform the transfer process.

したがってプロセスがラン状態になったときに必要なス
タックが必ず実スタック上にあることが期待できる。こ
のためスタック・フォルトの発生をかなり抑制すること
ができるので、システム全体のデータ処理を高速に行う
ことができる。
Therefore, when a process enters a running state, it can be expected that the necessary stack will always be on the real stack. Therefore, the occurrence of stack faults can be significantly suppressed, and data processing in the entire system can be performed at high speed.

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

第1図は本発明の原理説明図、 第2図は本発明の一実施例構成図、 第3図はスケジューリング・テーブルの説明図、第4図
は本発明における制御部の動作説明図、第5図はプロセ
スの仮想空間とスタック域説明図、 第6図は仮想スタックと実スタックの説明図、第7図は
スタック・フォルト処理説明図である。 ■−・−中央処理装置  2・・−生メモリ3−制御部
FIG. 1 is an explanatory diagram of the principle of the present invention; FIG. 2 is a configuration diagram of an embodiment of the present invention; FIG. 3 is an explanatory diagram of a scheduling table; FIG. 4 is an explanatory diagram of the operation of the control unit in the present invention; FIG. 5 is an explanatory diagram of the virtual space and stack area of a process, FIG. 6 is an explanatory diagram of the virtual stack and real stack, and FIG. 7 is an explanatory diagram of stack fault processing. ■--Central processing unit 2--Raw memory 3-Control unit

Claims (1)

【特許請求の範囲】 主メモリとは独立した実スタックをもち、この実スタッ
クを複数のブロックに分割し、ブロック単位で主メモリ
との間のデータ転送を行う仮想スタック方式の情報処理
システムにおいて、 中央処理装置とは独立に主メモリと実スタック間のデー
タ転送を制御する制御部(3)と、実スタックの複数の
ブロックを管理する管理テーブル(11)と、 プロセスのラン状態を管理するスケジューリング・テー
ブル(10)を具備し、 制御部(3)はスケジューリング・テーブル(10)に
より次にランとなるプロセスに必要なスタックのブロッ
クを認識し、このブロックが実スタック上に存在しない
とき、予めこれを実スタック上に転送するようにしたこ
とを特徴とするスタック制御方式。
[Scope of Claims] A virtual stack type information processing system that has a real stack independent of main memory, divides this real stack into a plurality of blocks, and transfers data to and from the main memory in units of blocks, A control unit (3) that controls data transfer between main memory and the real stack independently of the central processing unit, a management table (11) that manages multiple blocks of the real stack, and a scheduler that manages the run status of processes. - Equipped with a table (10), the control unit (3) uses the scheduling table (10) to recognize the stack block required for the next run process, and when this block does not exist on the real stack, A stack control method characterized by transferring this onto the real stack.
JP6359486A 1986-03-20 1986-03-20 Stack control system Pending JPS62221040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6359486A JPS62221040A (en) 1986-03-20 1986-03-20 Stack control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6359486A JPS62221040A (en) 1986-03-20 1986-03-20 Stack control system

Publications (1)

Publication Number Publication Date
JPS62221040A true JPS62221040A (en) 1987-09-29

Family

ID=13233748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6359486A Pending JPS62221040A (en) 1986-03-20 1986-03-20 Stack control system

Country Status (1)

Country Link
JP (1) JPS62221040A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0325530A (en) * 1989-06-23 1991-02-04 Fujitsu Denso Ltd Inter-module coupling execution control system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0325530A (en) * 1989-06-23 1991-02-04 Fujitsu Denso Ltd Inter-module coupling execution control system

Similar Documents

Publication Publication Date Title
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
CN101730881B (en) System comprising a plurality of processors and methods of operating the same
GB2348306A (en) Batch processing of tasks in data processing systems
US4851992A (en) Register/saving/restoring system for saving and restoring data in a register of a slave processor
US5537598A (en) System for installing processor control code
US7434222B2 (en) Task context switching RTOS
JPS62221040A (en) Stack control system
CN1021604C (en) Apparatus and method for recovering from missing page faults in vector data processing operation
KR960014825B1 (en) Information processing system
KR100294314B1 (en) Data processing system and method and communication system with such system
JPH04253228A (en) Task scheduling system for symmetric multiprocessor
JPS6240736B2 (en)
JPH08249296A (en) Multiprocessor system
JPH0351912A (en) Spool area return system for each data set
KR100489044B1 (en) Multi package management method
JPH03110635A (en) Process control method for operating system
JPH07152574A (en) Program loading system
JPS6356728A (en) Execution system for program correction
CN118132231A (en) System task scheduling method, device, equipment and medium based on virtual dual cores
JP2004021610A (en) Task managing device
JPH023801A (en) Method for controller execution of program
JPH02127732A (en) Job control system
JPS6380349A (en) High speed page input/output system
JPS62276634A (en) Virtual computer system
JPH05113888A (en) Microprocessor unit