JPH04111133A - Stack area control system - Google Patents

Stack area control system

Info

Publication number
JPH04111133A
JPH04111133A JP22842390A JP22842390A JPH04111133A JP H04111133 A JPH04111133 A JP H04111133A JP 22842390 A JP22842390 A JP 22842390A JP 22842390 A JP22842390 A JP 22842390A JP H04111133 A JPH04111133 A JP H04111133A
Authority
JP
Japan
Prior art keywords
stack area
page
area
stack
program
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
JP22842390A
Other languages
Japanese (ja)
Inventor
Yutaka Haga
芳賀 豊
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 JP22842390A priority Critical patent/JPH04111133A/en
Publication of JPH04111133A publication Critical patent/JPH04111133A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To improve the thread executing performance by preventing a page-out state of a virtual storage area to an external storage and at the same time invalidating the areas that are already paged out to the external storage. CONSTITUTION:When the end of a program is detected in a step S13, a fact whether the area used in the program is equal to a stack area of not is decided in a step S14. If not, a general area is opened in a step S15. If so, a control page table is checked to the stack area in a step S16. Then the changed bit of the used page are cleared in a step S17. Thus the data are evaporated out of a memory, and a fact whether the end conditions are satisfied or not is decided in a step S18. As a result, the undesired page-out and page-in states can be prevented.

Description

【発明の詳細な説明】 〔概  要〕 同一の空間内で複数のプログラム実行体によって実行さ
れる並列処理の終了時に、スレッドの処理用のスタック
として使われた仮想記憶領域の外部記憶装置へのページ
アウトを防止すると共に、すでに外部記憶装置にページ
アウトされている領域を無効とするスタック領域の制御
方式に関し、スレッドにおけるプログラム処理の終了時
にスタック領域として使用されていた仮想記憶領域の外
部記憶装置へのページアウトを防止し、またすでに外部
記憶装置へのページアウトされている領域を無効とする
ことによって、スレッドの実行性能を向上させることを
目的とし、 スタック領域を作業領域として使用していたプログラム
の終了時において、該スタック領域の最上位ページから
下位アドレス方向にページテーブルの変更ビットを調べ
、設定されている変更ビットを解除し、変更ピントが設
定されていないページまたは最下位ページに達した時点
で処理を終わり、該処理終了によって前記プログラムの
終了時に使用されていたスタック領域の内容を棄却する
ように構成する。
[Detailed Description of the Invention] [Summary] At the end of parallel processing executed by a plurality of program executables in the same space, a virtual storage area used as a stack for thread processing is transferred to an external storage device. Regarding a stack area control method that prevents page-outs and invalidates areas that have already been paged out to an external storage device, an external storage device for the virtual storage area that was used as a stack area at the end of program processing in a thread. The purpose was to improve thread execution performance by preventing page-outs to external storage devices and by invalidating areas that had already been paged out to external storage devices, and used the stack area as a work area. At the end of the program, check the change bit of the page table from the top page of the stack area in the direction of the lower address, clear the set change bit, and reach the page for which the change focus is not set or the lowest page. When the program is terminated, the processing is terminated, and the content of the stack area that was used at the time of termination of the program is discarded.

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

本発明はスタック領域の制御方式に係り、さらに詳しく
は同一の空間内で複数のプログラム実行体(スレッド)
によって実行される並列処理の終了時に、スレッドの処
理用のスタックとして使われた仮想記憶領域の外部記憶
装置へのページアウトを防止すると共に、すでに外部記
憶装置にページアウトされている領域を無効とするスタ
ック領域の制御方式に関する。
The present invention relates to a stack area control method, and more specifically, the present invention relates to a method for controlling a stack area, and more specifically, the present invention relates to a method for controlling a stack area.
When the parallel processing executed by This paper relates to a stack area control method.

(従来の技術と発明が解決しようとする課題〕近年のオ
ペレーティングンステムでは、1つのプロセス(空間)
内における処理の多重化の要求に伴って、プロセス内に
軽易なプログラム実行体を複数個生成することが必要と
なっている。このためプロセス内で軽易なプログラム実
行体としてのスレッドを生成する機能が提供されている
(Problems to be solved by conventional technology and inventions) In recent operating systems, one process (space)
With the demand for multiplexing of processing within a process, it has become necessary to generate a plurality of simple program execution bodies within a process. For this reason, a function is provided to generate a thread as a simple program execution body within a process.

このスレッドはメツセージ受信時に起動され、受信した
メツセージに対応するプログラム処理が終了すると次の
メツセージ受信待ちになる。個々のスレッドは、プログ
ラム処理を行う際に、プログラム作業領域としてスタッ
ク領域を使用して動作する。従来のスタック領域制御方
式では、スタック領域はスレ・ンドが処理を終了した時
点の使用状態のまま保存され、次の処理に再使用されて
いた。
This thread is activated when a message is received, and when the program processing corresponding to the received message is completed, it waits for the next message to be received. Each thread operates using a stack area as a program work area when performing program processing. In the conventional stack area control method, the stack area is saved in the state it was in use at the time the thread end finished processing, and is reused for the next process.

そこでスレッドが次の処理を待っている状態で、スタッ
ク領域として使用されていた仮想記憶領域に割り当てら
れている実記憶に対して実記憶の強奪が起きると、それ
に伴って仮想記憶領域の内容の外部記憶装置へのページ
アウトが発生する。またスレッドが次の処理を開始した
際に、以前にページアウトされた領域にアクセスすると
、そのページの外部記憶装置からのページインが発生す
る。
If the real memory allocated to the virtual storage area used as the stack area is robbed while the thread is waiting for the next process, the contents of the virtual storage area will be A pageout to an external storage device occurs. Furthermore, when a thread starts the next process and accesses an area that was previously paged out, that page is paged in from the external storage device.

以上のように、スレッドがプログラム処理を終了した時
点でその処理に関連して使用されたスタック領域の内容
は全く不要になるにもかかわらず、実記憶の強奪時の仮
想記憶領域へのページアウト、およびスレッドの次の処
理におけるページインが発生し、プログラム実行体とし
てのスレッドの実行性能が低下するという問題点があっ
た。
As described above, even though the contents of the stack area used in connection with that process are completely unnecessary when a thread finishes program processing, page-out to the virtual storage area when real memory is stolen , and a page-in occurs in the next process of the thread, resulting in a problem in that the execution performance of the thread as a program execution body deteriorates.

本発明は、スレッドにおけるプログラム処理の終了時に
スタック領域として使用されていた仮想記憶領域の外部
記憶装置へのページアウトを防止し、またすでに外部記
憶装置へのページアウトされている領域を無効とするこ
とによって、スレッドの実行性能を向上させることを目
的とする。
The present invention prevents a virtual storage area used as a stack area from being paged out to an external storage device at the end of program processing in a thread, and invalidates an area that has already been paged out to an external storage device. The purpose of this is to improve thread execution performance.

〔課題を解決するための手段及び作用]第1図は本発明
の機能ブロック図である。同図は、スタック領域を作業
領域として使用していたプログラム実行体、例えばスレ
ッドの処理終了時におけるスタック領域の制御方式の機
能ブロック図である。本発明においては、スタック領域
の各ページの使用状態は、例えばページテーブルの変更
ピントの設定状態で管理され、変更ビットが立っている
ことはそのページの内容が書き替えられたことを示すも
のとする。
[Means and operations for solving the problems] FIG. 1 is a functional block diagram of the present invention. This figure is a functional block diagram of a method for controlling the stack area at the end of processing of a program executable, such as a thread, that uses the stack area as a work area. In the present invention, the usage status of each page in the stack area is managed, for example, by the change focus setting status of the page table, and setting the change bit indicates that the contents of that page have been rewritten. do.

第1図において、スレッドの処理が終了すると、1でス
タック領域の最上位ページから下位アドレス方向に向か
ってページテーブルの各ページに対する変更ビットが調
べられ、2で設定されている変更ビットの解除、例えば
1からOへのクリアが行われ、3で変更ビットが設定さ
れていないページ、あるいはスタック領域の最下位ペー
ジに達した時点で処理が終了する。
In FIG. 1, when the thread processing is completed, the change bits for each page of the page table are checked from the top page of the stack area toward the lower addresses at step 1, and the set change bits are canceled at step 2. For example, clearing is performed from 1 to O, and the process ends when a page with no change bit set at 3 or the lowest page of the stack area is reached.

すなわち、スタック領域はその最上位から下位アドレス
方向に順次ページが使用されるので、その最上位ページ
から変更ビットを調べることによって、すでに立ってい
る変更ビットが全てクリアされることになる。変更ピン
トがクリアされた状態は、前述のようにページ内容が書
き替えられたことがないことを示しており、実記憶の強
奪時に外部記憶装置へのページアウトが防止され、また
すでに外部記憶装置にページアウトされている仮想記憶
の内容は、例えば揮発されて、スレ、ラドにおいて次の
処理が開始された場合における不要なページインも防止
されることになる。
That is, since pages of the stack area are sequentially used from the top to the lowest address, by checking the change bits from the top page, all the change bits that have already been set will be cleared. The state in which the change focus is cleared indicates that the page contents have never been rewritten as described above, and page out to the external storage device is prevented when real memory is stolen, and For example, the contents of the virtual memory that have been paged out are volatilized, and unnecessary page-in is also prevented when the next process is started in a thread or rad.

〔実  施  例] 第2回は本発明におけるスタック制御ルーチンの実施例
である。同図において、ステップ(S)10においてプ
ログラム処理の終了が検出されると、Sllのスタック
制御ルーチンに移行する。
[Example] The second part is an example of the stack control routine according to the present invention. In the same figure, when the end of the program processing is detected in step (S) 10, the flow shifts to the Sll stack control routine.

スタック制御ルーチンでは、■でページテーブルの検査
が、スタックの最上位ページテーブルエントリから下位
側に向かって行われ、■で変更ピントの解除、すなわち
クリアが行われ、■で処理終了条件の判定が行われる。
In the stack control routine, the page table is inspected at ■ from the topmost page table entry in the stack downwards, the change focus is canceled, or cleared, at ■, and the processing termination condition is determined at ■. It will be done.

ここで最下位のページテーブルエントリに達するか、あ
るいは変更ビットが設定されていないページテーブルエ
ントリに到達した時点で処理が終了する。その後312
でスレッドの状態が次の処理待ち状態に設定される。
The process ends when the lowest page table entry is reached or when a page table entry for which the change bit is not set is reached. then 312
The state of the thread is set to wait for the next process.

第3図はスタック領域制御方式の実施例フローチャート
である。同図においてステップ(S)13でプログラム
終了が検出されると、S14でそのプログラムにおいて
使用された領域がスタック領域であるか否かが判別され
、スタック領域でない場合にはS15で一般の領域解放
が行われる。
FIG. 3 is a flow chart of an embodiment of the stack area control method. In the figure, when the end of a program is detected in step (S)13, it is determined in S14 whether the area used in the program is a stack area, and if it is not a stack area, the general area is released in S15. will be held.

これに対してスタック領域である場合には、S16でそ
のスタック領域に対して管理ページテーブルの検査が行
われ、317で使用されているページの変更ビットをク
リアすることによりメモリのデータが蒸発させられ、S
18で終了条件を満たしたか否かが判定される。
On the other hand, if it is a stack area, the management page table is checked for the stack area in S16, and the memory data is evaporated by clearing the change bit of the page being used in 317. Rare, S
At step 18, it is determined whether the termination condition is satisfied.

318での終了条件判定時に最下位ページのテーブルエ
ントリに到達しておらずかつ変更ビットが設定されてい
ないページテーブルエントリに到達していない場合には
、316からの処理が繰り返される。終了条件が満たさ
れている場合には、S19で、そのスタックの再使用時
においてスタック領域に対して実記憶が割り当てられて
いない場合に内容不定の実記憶が割り当てられる。
If the table entry of the lowest page has not been reached and the page table entry in which the change bit is not set has not been reached when the termination condition is determined in step 318, the processing from step 316 is repeated. If the termination condition is satisfied, in S19, if no real memory is allocated to the stack area when the stack is reused, real memory with undefined content is allocated to the stack area.

第4図は仮想記憶領域と実記憶領域におけるページテー
ブルとスタック領域の実施例である。同図(a)は仮想
記憶領域を示し、ページテーブル20とスタック領域2
1が設けられている。これに対して実記憶領域を示す(
b)においては、ページテーブル22とスタック領域の
うち使用されている実記憶領域23だけが示されている
FIG. 4 is an example of a page table and a stack area in a virtual storage area and a real storage area. Figure (a) shows a virtual storage area, including a page table 20 and a stack area 2.
1 is provided. In contrast, the real storage area is shown (
In b), only the used real storage area 23 of the page table 22 and stack area is shown.

第5図はスタック内の不要仮想記憶領域棄却方式の実施
例である。同図(a)はスタック領域内の仮想記憶使用
状態の管理方法を示し、スレッド30に対するスタック
領域31のうちで、高アドレス側から使用されている使
用ページに対して、ページテーブル32内の参照ビット
と変更ビットとが共に1となっている。ここで参照ビッ
トはこのページにアクセスがあったことを示し、変更ビ
ットは前述のようにそのページの内容が書き替えられた
ことを示している。第5図(b)の棄却後の状態は、ペ
ージテーブル32の使用ページに対する変更ピントが全
て0とされた状態を示している。
FIG. 5 is an example of a method for discarding unnecessary virtual storage areas in the stack. FIG. 3(a) shows a method for managing the virtual memory usage state in the stack area, in which pages in the stack area 31 for the thread 30 that are used from the high address side are referenced in the page table 32. Both the bit and the change bit are 1. Here, the reference bit indicates that this page has been accessed, and the modified bit indicates that the contents of the page have been rewritten as described above. The state after rejection shown in FIG. 5(b) shows a state in which the changed focus for the used page in the page table 32 is all set to 0.

〔発明の効果] 以上説明したように、本発明によればプログラム実行体
としてのスレッドでのプログラム処理が終了した時点で
その処理に関連して使用されたスタックの内容が棄却さ
れ、不要なページアウト、およびページインが防止され
ることになり、プログラム実行体の実行性能向上に寄与
することろが大きい。
[Effects of the Invention] As explained above, according to the present invention, when program processing in a thread as a program execution body is completed, the contents of the stack used in connection with the processing are discarded, and unnecessary pages are Page-out and page-in are prevented, which greatly contributes to improving the execution performance of the program execution body.

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

第1図は本発明の機能ブロック図、 第2図は本発明におけるスタック制御ルーチンの実施例
を示す図、 第3図はスタック領域制御方式の実施例のフローチャー
トを示す図、 第4図は仮想記憶領域と実記憶領域におけるページテー
ブルとスタック領域の実施例を示す図、第5図はスタン
ク内の不要仮想記憶領域棄却方式の実施例を示す回であ
る。 20 22 32・・・ページテーブル、2131・・
・スタック頭載、 30・・・スレッド。
FIG. 1 is a functional block diagram of the present invention. FIG. 2 is a diagram showing an embodiment of the stack control routine in the present invention. FIG. 3 is a flowchart of an embodiment of the stack area control method. FIG. 4 is a virtual diagram. FIG. 5 is a diagram showing an embodiment of a page table and a stack area in a storage area and a real storage area, and FIG. 20 22 32...Page table, 2131...
・Stack header, 30...threads.

Claims (1)

【特許請求の範囲】 1)スタック領域を作業領域として使用していたプログ
ラムの終了時において、 該スタック領域の最上位ページから下位アドレス方向に
ページテーブルの変更ビットを調べ(1)、設定されて
いる変更ビットを解除し(2)、変更ビットが設定され
ていないページまたは最下位開ページに達した時点で処
理を終わり(3)、該処理終了(3)によって前記プロ
グラムの終了時に使用されていたスタック領域の内容を
棄却することを特徴とするスタック領域の制御方式。 2)前記処理終了(3)後の前記スタック領域の再使用
に際して、該スタック領域に対して実記憶が設定されて
いない時内容不定の実記憶を割り当てることを特徴とす
る請求項1記載のスタック領域の制御方式。 3)前記スタック領域を使用するプログラムが、メッセ
ージ受信時に起動され、前記処理終了(3)時にメッセ
ージ受信待ちに遷移することを特徴とする請求項1記載
のスタック領域の制御方式。
[Scope of Claims] 1) At the end of a program that uses a stack area as a work area, check the change bits of the page table from the top page of the stack area in the direction of lower addresses (1), and check if the change bits are set. The change bit that is currently in use is cleared (2), and the process ends when the page for which the change bit is not set or the lowest open page is reached (3). A stack area control method characterized in that the contents of the stack area are discarded. 2) The stack according to claim 1, wherein when the stack area is reused after the processing ends (3), when no real memory is set for the stack area, a real memory with undefined content is allocated to the stack area. Area control method. 3) The stack area control method according to claim 1, wherein the program using the stack area is started when a message is received, and transitions to a message reception waiting state when the processing ends (3).
JP22842390A 1990-08-31 1990-08-31 Stack area control system Pending JPH04111133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22842390A JPH04111133A (en) 1990-08-31 1990-08-31 Stack area control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22842390A JPH04111133A (en) 1990-08-31 1990-08-31 Stack area control system

Publications (1)

Publication Number Publication Date
JPH04111133A true JPH04111133A (en) 1992-04-13

Family

ID=16876245

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22842390A Pending JPH04111133A (en) 1990-08-31 1990-08-31 Stack area control system

Country Status (1)

Country Link
JP (1) JPH04111133A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011523135A (en) * 2008-06-09 2011-08-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Configuration for storing and retrieving blocks of data having different sizes
US8510511B2 (en) 2009-12-14 2013-08-13 International Business Machines Corporation Reducing interprocessor communications pursuant to updating of a storage key
US8918601B2 (en) 2009-12-14 2014-12-23 International Business Machines Corporation Deferred page clearing in a multiprocessor computer system
US8930635B2 (en) 2009-12-14 2015-01-06 International Business Machines Corporation Page invalidation processing with setting of storage key to predefined value

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011523135A (en) * 2008-06-09 2011-08-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Configuration for storing and retrieving blocks of data having different sizes
US8510511B2 (en) 2009-12-14 2013-08-13 International Business Machines Corporation Reducing interprocessor communications pursuant to updating of a storage key
US8521964B2 (en) 2009-12-14 2013-08-27 International Business Machines Corporation Reducing interprocessor communications pursuant to updating of a storage key
US8918601B2 (en) 2009-12-14 2014-12-23 International Business Machines Corporation Deferred page clearing in a multiprocessor computer system
US8930635B2 (en) 2009-12-14 2015-01-06 International Business Machines Corporation Page invalidation processing with setting of storage key to predefined value
US9304916B2 (en) 2009-12-14 2016-04-05 International Business Machines Corporation Page invalidation processing with setting of storage key to predefined value

Similar Documents

Publication Publication Date Title
US9519507B2 (en) Executing an instruction of currently active thread before context switch upon receiving inactive context ID to be activated
DE60030767T2 (en) DATA ALLOCATION TO THREADS IN A MULTI-THREADED NETWORK PROCESSOR
EP3217285B1 (en) Transmitting data
CN1210651C (en) Read lock miss control in a multithreaded environment
JP4176857B2 (en) Using tristate references to manage referenced objects
JP3074178B2 (en) Program module loading and execution method
EP3462324B1 (en) Pointers in a memory managed system
US20040117594A1 (en) Memory management method
US20030105927A1 (en) Method for use of stack
US6088779A (en) System and method for execution management of computer programs
EP1604493A2 (en) Free list and ring data structure management
JPH05150981A (en) Data processor
JPH09231157A (en) Method for controlling input/output (i/o) device connected to computer
US6230230B1 (en) Elimination of traps and atomics in thread synchronization
JPH04111133A (en) Stack area control system
CN111221642A (en) Data processing method and device, storage medium and terminal
WO2020213397A1 (en) Processor and register inheritance method
US7089387B2 (en) Methods and apparatus for maintaining coherency in a multi-processor system
WO2002099628A2 (en) Method and system for tracking and recycling physical register assignment
KR100401560B1 (en) Kernel Stack Dynamic Allocation Method In Operating System
JPH0833856B2 (en) Serial number management method
JPS6385948A (en) Cache memory storing system
JP2004062449A (en) Microprocessor and its processing method
JP2846789B2 (en) Information processing system having communication processing function between input and output processors
US7346743B2 (en) Excluding a toggle bit from the range of cacheable addresses in a flash memory