JPH06250923A - Swap area control method - Google Patents

Swap area control method

Info

Publication number
JPH06250923A
JPH06250923A JP5062475A JP6247593A JPH06250923A JP H06250923 A JPH06250923 A JP H06250923A JP 5062475 A JP5062475 A JP 5062475A JP 6247593 A JP6247593 A JP 6247593A JP H06250923 A JPH06250923 A JP H06250923A
Authority
JP
Japan
Prior art keywords
swap area
thread
swap
area
control method
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
JP5062475A
Other languages
Japanese (ja)
Inventor
Makoto Udagawa
誠 宇田川
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP5062475A priority Critical patent/JPH06250923A/en
Publication of JPH06250923A publication Critical patent/JPH06250923A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide the swap area control method of an information processor, by which a swap area for a thread stack is a minimum, or a program using much more thread stacks can be executed with the same resource, if mentioned inversely. CONSTITUTION:The swap area control method for the information processor provided with a central, processing unit, a main storage device having plural thread stacks in a virtual storage space and an external storage device securing the swap area corresponding to the thread stack is provided with a step (S1) which temporarily stops a thread, a step (S4) generating the new swap area, a step (S5) moving only valid areas to the new swap area for the respective threads and steps (S6-S8) for making the thread stack correspond to the new swap area again and releasing all the original swap areas.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は情報処理装置のスワップ
領域制御方法に関し、詳しくはスレッドスタックのため
のスワップ領域の制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a swap area control method for an information processing apparatus, and more particularly to a swap area control method for a thread stack.

【0002】[0002]

【従来の技術】情報処理装置では、従来、プロセス毎に
仮想記憶領域を独立的に割当てる制御方式が用いられて
きた。しかし近年では、そのなかの一つの仮想記憶領域
に複数のスレッド機能を持つ電子計算機が増えてきてい
る(例えば、Proceedings of the
12th ACM Symposium on Op
erating System Principles
(December 1989)、M. Weise
r, A. Demers, and C. Haus
er, “The Portable Common
Runtime Approach to Inter
operability” P.114−122、
UNIX MAGAZINE 1988.6、P.27
−28参照)。
2. Description of the Related Art In information processing apparatuses, conventionally, a control method has been used in which a virtual storage area is independently assigned to each process. However, in recent years, an electronic computer having a plurality of thread functions in one virtual storage area has been increasing (for example, Proceedings of the
12th ACM Symposium on Op
erating System Principles
(December 1989), M.A. Weise
r, A. Demers, and C.M. Haus
er, “The Portable Common
Runtime Approach to Inter
"operability" P.114-122,
UNIX MAGAZINE 1988.6, P.I. 27
-28).

【0003】このスレッドスタックのためのスワップ領
域は、ある固定長の(例えば200キロバイト)、固定
スレッド数分(例えば100個分)、予め主記憶領域に
割り付けておくことにより実現される。スレッドスタッ
クサイズは、プロセス上考えられる最大の大きさを取っ
ておかなければならない。近年プログラムサイズが増大
してきているため、必要とされるスレッドスタックのサ
イズも大きくなってきている。このため、これらスレッ
ドスタックのために用意されるスワップ領域も連動して
大きなサイズが必要になっており、このスワップ領域の
ための外部記憶装置の容量も大きくなってきている。
The swap area for the thread stack is realized by allocating a fixed length (for example, 200 kilobytes) for a fixed number of threads (for example, 100 threads) to the main storage area in advance. The thread stack size must be set to the maximum size possible for the process. Since the program size has been increasing in recent years, the size of the required thread stack is also increasing. Therefore, the swap areas prepared for these thread stacks are also required to have a large size, and the capacity of the external storage device for these swap areas is also increasing.

【0004】これらスレッドスタックのためのスワップ
領域は、多くの場合稀にしか使用されていない。その理
由は、このスワップ領域が対応しているスレッドスタッ
クがプログラム実行上、基本的に必要なものであり、深
い再起呼出しなどの最悪の場合でも足りなくなることが
ないよう、予め十分な大きさが取られているからであ
る。
Swap areas for these thread stacks are often rarely used. The reason is that the thread stack corresponding to this swap area is basically necessary for program execution, and it must be large enough in advance so that it will not run out in the worst case such as a deep recursive call. Because it has been taken.

【0005】[0005]

【発明が解決しようとする課題】しかし、このように稀
にしか使用されないスワップ領域を常に確保しておくの
は、装置資源のむだ遣いである。本発明の目的は、この
ような従来技術の欠点を解消し、スレッドスタックのた
めのスワップ領域が最小限で済む、逆に言えば同じ資源
で更に多くのスレッドスタックを使用するプログラムの
実行が可能な情報処理装置のスワップ領域制御方法を提
供することにある。
However, it is a waste of device resources to always reserve a swap area which is rarely used in this way. The object of the present invention is to eliminate the drawbacks of the prior art and to minimize the swap area for the thread stack. Conversely, it is possible to execute a program using more thread stacks with the same resources. Another object of the present invention is to provide a swap area control method for another information processing apparatus.

【0006】[0006]

【課題を解決するための手段】本発明は、中央処理装置
と、仮想記憶空間に複数のスレッドスタックを有する主
記憶装置と、前記スレッドスタックに対応するスワップ
領域を確保した外部記憶装置とを備えた情報処理装置の
スワップ領域制御方法であって、一時的にスレッドを停
止させるステップ(図1のS1)と、新たなスワップ領
域を生成するステップ(S4)と、各スレッド毎に有効
領域のみを新たなスワップ領域に移すステップ(S5)
と、スレッドスタックと新たなスワップ領域との対応付
けをしなおし、元のスワップ領域をすべて解放するステ
ップ(S6〜S8)とを有する。
According to the present invention, there is provided a central processing unit, a main memory having a plurality of thread stacks in a virtual memory space, and an external memory having a swap area corresponding to the thread stack. In the swap area control method for an information processing apparatus, a step of temporarily stopping a thread (S1 of FIG. 1), a step of generating a new swap area (S4), and a valid area for each thread are provided. Step to move to a new swap area (S5)
And a step (S6 to S8) of re-associating the thread stack with the new swap area and releasing all the original swap areas.

【0007】また、本発明の一態様では、所定の時間間
隔、あるいはスワップ領域の残り量などの特定の事象に
よって、前記スワップ領域の制御を行う。
Further, according to one aspect of the present invention, the swap area is controlled by a predetermined time interval or a specific event such as the remaining amount of the swap area.

【0008】[0008]

【作用】本発明によれば、スレッドスタックのためのス
ワップ領域の割り付けを、各スレッドスタック毎にその
有効領域に基づいて、更新するようにしたので、スレッ
ドスタックのためのスワップ領域を最小限にすることが
でき、記憶装置の容量を従来のように大きくとる必要が
ない。換言すれば、従来と同じ資源で更に多くのスレッ
ドスタックを使用するプログラムの実行が可能となる。
According to the present invention, the allocation of the swap area for the thread stack is updated based on the effective area of each thread stack, so that the swap area for the thread stack is minimized. Therefore, it is not necessary to increase the capacity of the storage device as in the conventional case. In other words, it is possible to execute a program that uses more thread stacks with the same resources as before.

【0009】[0009]

【実施例】図2および図3は、本発明のスワップ領域制
御方法が適用される情報処理装置の構成を示すものであ
る。この情報処理装置は、中央処理装置21と、スレッ
ドスタックを有する主記憶装置22と、スレッドスタッ
クに対応するスワップ領域231を確保した外部記憶装
置23と、主記憶装置の内容と外部記憶装置の内容とを
結び付ける手段24とを備えている。
2 and 3 show the construction of an information processing apparatus to which the swap area control method of the present invention is applied. This information processing apparatus includes a central processing unit 21, a main storage device 22 having a thread stack, an external storage device 23 that secures a swap area 231 corresponding to the thread stack, the contents of the main storage device and the contents of the external storage device. And means 24 for connecting

【0010】図4に示すように仮想記憶空間41は複数
のスレッドスタック420〜422を有する。プログラム
の実行に伴い、各スレッドスタックの有効領域は伸びた
り縮んだりするが、スレッドスタックの一度伸びた部分
には、裏付けとなるスワップ領域をシステムが用意す
る。ある時点のあるスレッドスタックの状態を図4に例
示す。このスレッドスタックは、まだ一度も中央処理装
置にアクセスされていない未使用領域43、過去にアク
セスされたことはあるが現在は使用されていない領域4
4、および現在使用している有効領域45からなってい
る。これらの各領域43〜45には、外部記憶装置23
にスワップ領域をあらかじめ対応づけておくことによっ
て、仮想記憶動作の保証をしている。
As shown in FIG. 4, the virtual memory space 41 has a plurality of thread stacks 42 0 to 42 2 . The effective area of each thread stack grows and shrinks as the program executes, but the system prepares a swap area to support the once expanded portion of the thread stack. The state of a certain thread stack at a certain point of time is shown in FIG. This thread stack has an unused area 43 which has never been accessed by the central processing unit, and an area 4 which has been accessed in the past but is not currently used.
4 and the effective area 45 currently used. The external storage device 23 is provided in each of these areas 43 to 45.
By associating the swap area with the swap area in advance, the virtual memory operation is guaranteed.

【0011】図5は、本実施例のスワップ領域制御方法
を説明するための図であり、図1はそのスワップ領域制
御方法における処理の流れを示す図である。図5および
図1に示す処理を、適宜に繰り返すことによりスワップ
領域の制御を行なう。
FIG. 5 is a diagram for explaining the swap area control method of this embodiment, and FIG. 1 is a diagram showing the flow of processing in the swap area control method. The swap area is controlled by appropriately repeating the processing shown in FIGS. 5 and 1.

【0012】まず、スレッド機構を一時停止させ、スワ
ップ領域の制御処理に入る(ステップS1)。図5の
(a)に示すように処理の前には、過去に一度使用した
スレッドスタックにはスワップ領域が割り付けられてい
る。
First, the thread mechanism is temporarily stopped and the swap area control processing is started (step S1). As shown in FIG. 5A, before processing, a swap area is allocated to the thread stack that has been used once in the past.

【0013】変数スレッドに1を設定し(ステップS
2)、その変数に指定されたスレッドスタックについて
有効領域51の位置・範囲等を算出し確認する(ステッ
プS3)。
1 is set in the variable thread (step S
2) Calculate and confirm the position, range, etc. of the effective area 51 for the thread stack designated by the variable (step S3).

【0014】別のスワップ領域52を新たに生成し(ス
テップS4)、ステップS3で調べた元のスワップ領域
における有効領域51の内容をその新たに生成したスワ
ップ領域52にコピーする(ステップS5)(図5
(b)参照)。
Another swap area 52 is newly created (step S4), and the contents of the effective area 51 in the original swap area checked in step S3 are copied to the newly created swap area 52 (step S5) ( Figure 5
(See (b)).

【0015】前記対象のスレッドスタックと元のスワッ
プ領域51との対応づけを解除し(ステップS6)、そ
のスレッドスタックと新たに作成したスワップ領域52
との対応づけを生成する(ステップS7)(図5(c)
参照)。
The association between the target thread stack and the original swap area 51 is released (step S6), and the thread stack and the newly created swap area 52 are released.
And a correspondence is generated (step S7) (FIG. 5C).
reference).

【0016】元のスワップ領域51を削除する(ステッ
プS8)(図5(d)参照)。
The original swap area 51 is deleted (step S8) (see FIG. 5 (d)).

【0017】以上の一連の処理により一つのスレッドス
タックに関してスワップ領域の割り付けの変更処理を終
了したので、次のスレッドスタックについて同様の一連
の処理を行なうため、スレッドスタックを指定する変数
の値を1だけ増加する(ステップS9)。
Since the swap area allocation change processing for one thread stack is completed by the above series of processing, the value of the variable designating the thread stack is set to 1 in order to perform the same series of processing for the next thread stack. Only (step S9).

【0018】すべてのスレッドスタックについて処理が
完了したか否かを調べる(ステップS10)。完了して
いなければ前記変数により指定される未処理のスレッド
スタックに関して、ステップS3〜ステップS7の処理
を行なう。すべてのスレッドスタックに関して処理が終
了していれば、一時停止していた全スレッドの機能を再
起動する(ステップS11)。
It is checked whether processing has been completed for all thread stacks (step S10). If not completed, the processes of steps S3 to S7 are performed on the unprocessed thread stack specified by the variable. If the processing has been completed for all thread stacks, the functions of all the suspended threads are restarted (step S11).

【0019】以上の一連の処理は、適宜に繰り返して行
なう。例えば、タイマーによって一定時間間隔(例、5
分)毎に制御を行なうようにしたり、あるいは特定事象
(例、スワップの残りが一定レベルを下回ったなど)に
よって制御を行なう。
The above-described series of processing is appropriately repeated. For example, with a timer, a certain time interval (eg, 5
Every minute), or by a specific event (eg, the remaining swap is below a certain level).

【0020】[0020]

【発明の効果】本発明によれば、スレッドスタックのた
めのスワップ領域の割り付けを、各スレッドスタック毎
にその有効領域に基づいて、更新するようにしたので、
スレッドスタックのためのスワップ領域を最小限にする
ことができ、記憶装置の容量を従来のように大きくとる
必要がないなど装置資源の有効的な利用が可能となる。
また、従来と同じ資源の場合には更に多くのスレッドス
タックを使用するプログラムの実行が可能となる。
According to the present invention, the allocation of the swap area for the thread stack is updated based on the effective area of each thread stack.
The swap area for the thread stack can be minimized, and it is possible to effectively use the device resources such as not requiring a large storage device capacity as in the conventional case.
Further, if the same resources as the conventional one are used, it is possible to execute a program using a larger number of thread stacks.

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

【図1】 本実施例のスワップ領域制御方法における処
理の流れを示す図
FIG. 1 is a diagram showing a flow of processing in a swap area control method of this embodiment.

【図2】 本発明のスワップ領域制御方法が適用される
情報処理装置の基本構成を示すブロック図
FIG. 2 is a block diagram showing the basic configuration of an information processing apparatus to which the swap area control method of the present invention is applied.

【図3】 スレッドスタックとスワップ領域との関係を
示す図
FIG. 3 is a diagram showing a relationship between a thread stack and a swap area.

【図4】 ある時点のあるスレッドスタックの状態を示
す図
FIG. 4 is a diagram showing a state of a thread stack at a certain time point.

【図5】 本実施例のスワップ領域制御方法を説明する
ための図
FIG. 5 is a diagram for explaining a swap area control method according to the present embodiment.

【符号の説明】[Explanation of symbols]

21…中央処理装置、22…主記憶装置、23…外部記
憶装置、24…結合手段。
21 ... Central processing unit, 22 ... Main storage device, 23 ... External storage device, 24 ... Coupling means.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 中央処理装置と、仮想記憶空間に複数の
スレッドスタックを有する主記憶装置と、前記スレッド
スタックに対応するスワップ領域を確保した外部記憶装
置とを備えた情報処理装置のスワップ領域制御方法であ
って、 一時的にスレッドを停止させるステップと、 新たなスワップ領域を生成するステップと、 各スレッド毎に有効領域のみを新たなスワップ領域に移
すステップと、 スレッドスタックと新たなスワップ領域との対応付けを
しなおし、元のスワップ領域をすべて解放するステップ
とを有することを特徴とするスワップ領域制御方法。
1. A swap area control of an information processing apparatus comprising a central processing unit, a main storage device having a plurality of thread stacks in a virtual storage space, and an external storage device having a swap area corresponding to the thread stacks. A method of temporarily stopping the thread, creating a new swap area, moving only the effective area to a new swap area for each thread, thread stack and new swap area. And the step of releasing all the original swap areas, the swap area control method.
【請求項2】 所定の時間間隔、あるいはスワップ領域
の残り量などの特定の事象によって、前記スワップ領域
の制御を行うことを特徴とする請求項1記載のスワップ
領域制御方法。
2. The swap area control method according to claim 1, wherein the swap area is controlled by a predetermined time interval or a specific event such as a remaining amount of the swap area.
JP5062475A 1993-03-01 1993-03-01 Swap area control method Pending JPH06250923A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5062475A JPH06250923A (en) 1993-03-01 1993-03-01 Swap area control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5062475A JPH06250923A (en) 1993-03-01 1993-03-01 Swap area control method

Publications (1)

Publication Number Publication Date
JPH06250923A true JPH06250923A (en) 1994-09-09

Family

ID=13201258

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5062475A Pending JPH06250923A (en) 1993-03-01 1993-03-01 Swap area control method

Country Status (1)

Country Link
JP (1) JPH06250923A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9940029B2 (en) 2015-03-23 2018-04-10 Toshiba Memory Corporation Semiconductor memory device that switches between states and moves data in accordance with a current state

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9940029B2 (en) 2015-03-23 2018-04-10 Toshiba Memory Corporation Semiconductor memory device that switches between states and moves data in accordance with a current state

Similar Documents

Publication Publication Date Title
EP0473802B1 (en) Computer with extended virtual storage concept
CA1296432C (en) Controlled dynamic load balancing for a multiprocessor system
CN110471647A (en) Embedded partitions operating system and its design method based on microkernel architecture
US5355488A (en) Method for adaptively building a library of program threads
JPH03257644A (en) Main memory control method
EP0362903A2 (en) A special purpose processor for off-loading many operating system functions in a large data processing system
JPH06250923A (en) Swap area control method
JPH02122365A (en) Processor assignment system
JPH01195562A (en) Control system for allocation of input/output device
JPS6152761A (en) Arithmetic unit
JPS635780B2 (en)
JPS6364146A (en) Logical space control system
JPS63636A (en) Task control system
JP2003076562A (en) Method, device for quantitatively controlling memory, computer program and recording medium
JP2571260B2 (en) Operating environment selection processing method using logic clock
JPH01309118A (en) File/device control system
KR940002148B1 (en) Job-scheduling method by using semaphore conception
JPH0296833A (en) Different type job control system
JPH02127732A (en) Job control system
JPS63247824A (en) Expanding method for number of defining blocks of data entry screen
JPH0319051A (en) Main storage control system for virtual computer
JPH076045A (en) Memory managing method of multi-processing system
JPH0348950A (en) Memory control system
JPS61139842A (en) Save control system of program
JPH0342740A (en) Allocation method for medium of file