JPH03141442A - Task control system - Google Patents

Task control system

Info

Publication number
JPH03141442A
JPH03141442A JP1278373A JP27837389A JPH03141442A JP H03141442 A JPH03141442 A JP H03141442A JP 1278373 A JP1278373 A JP 1278373A JP 27837389 A JP27837389 A JP 27837389A JP H03141442 A JPH03141442 A JP H03141442A
Authority
JP
Japan
Prior art keywords
task
main memory
page
processing
tasks
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
JP1278373A
Other languages
Japanese (ja)
Inventor
Naomichi Nonaka
尚道 野中
Keiichi Nakane
啓一 中根
Teiji Kuwabara
禎司 桑原
Hiroyuki Koreeda
浩行 是枝
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP1278373A priority Critical patent/JPH03141442A/en
Publication of JPH03141442A publication Critical patent/JPH03141442A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)
  • Memory System (AREA)

Abstract

PURPOSE:To prevent the deterioration of response to the user input by performing the compaction processing with repetition of the transfer of units that is uninterruptable and processed in a short time and performing the unit transfer processing in an idle state of a system. CONSTITUTION:A data processor allocates dynamically plural tasks into a main memory 2 and saving/recovering these tasks between the memory 2 and the secondary storages 3 and 4 to perform the multi-task processing. Then the compaction processing is carried out to collect the idle areas of the memory in a single place with repetition of the transfer of units that is uninterruptable and processed in a short time. The unit transfer processing is carried out in an idle state of a system of the data processor. Thus it is possible to prevent the deterioration of response to the user input and to perform the compaction processing with the reduced overhead.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、対話的操作により処理を行うデータ処理装置
において、マルチタスク方式を実現するためのタスク制
御方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a task control method for realizing a multitasking method in a data processing device that performs processing through interactive operations.

〔従来の技術〕[Conventional technology]

従来、ワードプロセッサ、コンビエータ等のデータ処理
装置におけるコンピュータシステムの利用方法として、
システムが行うべき処理を、タスクと呼ぶ独立した処理
単位に分割して、複数のタスクを並行して動作させるこ
とkより、システム全体としての処理を行うマルチタス
ク方式が、広く採用されている。
Conventionally, as a method of using computer systems in data processing devices such as word processors and combinators,
A multitasking method is widely adopted in which the processing to be performed by a system is divided into independent processing units called tasks, and multiple tasks are operated in parallel, thereby processing the entire system.

この場合、各タスクの内容全てを、常に、主メモリ上に
保持しておかずに、必要に応じて、ハードディスク等の
2次記憶装置との間で退避/回復処理を行うことで、主
メモリ容量の制約以上のメモリ容量な必要とする複数の
タスクを動作させることが可能となる。
In this case, instead of keeping all the contents of each task in the main memory at all times, the main memory capacity can be increased by saving and restoring the contents of each task to and from a secondary storage device such as a hard disk as needed. It becomes possible to run multiple tasks that require memory capacity that exceeds the constraints of .

このように、タスクの退避/回復を行う際の方式として
は、退避を行う処理単位だより、スワップ方式と仮想メ
モリ方式とく大別できる。スワップ方式では、退避/回
復処理の単位はタスクであり、実行されているタスクは
、常に、その全体が主メモリ上に存在する。一方、仮想
メモリ方式では、退避/回復処理の単位は、タスクより
も小さなページと呼ばれるメモリの断片であり、あるタ
スクが実行されているからといって、必ずしもそのタス
クの全体が主メモリ上に存在するわけではない。
As described above, the methods for saving/recovering tasks can be roughly divided into the swap method and the virtual memory method based on the processing unit for saving. In the swap method, the unit of save/restore processing is a task, and the task being executed always exists entirely in the main memory. On the other hand, in the virtual memory method, the unit of evacuation/recovery processing is a memory fragment called a page that is smaller than a task, and just because a task is being executed does not mean that the entire task is stored in main memory. It doesn't exist.

上記2つの方式では、仮想メモリ方式の方が主メモリの
利用効率が高く、スワップ方式に比べて、主メモリと2
次記憶装置との間のデータ転送量を。
Of the above two methods, the virtual memory method has higher main memory usage efficiency, and compared to the swap method, the main memory
The amount of data transferred to and from the storage device.

少なくすることができるため、より高速に処理が行なえ
る。しかし、仮想メモリ方式を実現するためには、高価
なメモリ管理機構をハードウェアとして備える必要があ
るため、コスト・パフォーマンスの点では必ずしも良い
方式とはいえない。
Since the number can be reduced, processing can be performed faster. However, in order to implement the virtual memory method, it is necessary to provide an expensive memory management mechanism as hardware, so it is not necessarily a good method in terms of cost performance.

スワップ方式では、仮想メモリ方式とは反対に、高価な
メモリ管理機構は必要としないが、1つのタスクに1そ
のタスク全体を格納できる主メモリを割当てる必要があ
る。タスクの大きさは一定ではなく、主メモリに対して
異なる大きさのタスクの割当て/解放をくり返すと、主
メモリ上に異なる大きさの空きエリアが散在する断片化
と呼ばれる状態が生じ、空きエリアの総量は十分圧大き
いくもかかわらず、個々の空きエリアの大きさがタスク
の大きさよりも小さいために、タスクをメモリ上に置く
ことができなくなり、メモリの利用効率が低下して、タ
スクの退避/回復処理に要する時間が増加し、性能が低
下する。
In contrast to the virtual memory method, the swap method does not require an expensive memory management mechanism, but it is necessary to allocate main memory that can store the entire task to one task. The size of a task is not constant, and if tasks of different sizes are repeatedly allocated/released from main memory, a state called fragmentation occurs in which free areas of different sizes are scattered in main memory, and the free space increases. Although the total amount of area is large enough, the size of each free area is smaller than the size of the task, so tasks cannot be placed in memory, reducing memory usage efficiency and The time required for evacuation/recovery processing increases and performance deteriorates.

そこで、スワップ方式においては、上記断片化による性
能低下を防ぐ方法として、主メモリ上でタスクを移動し
て、連続した一ケ所へ空きエリアをまとめるコンパクシ
冒ン処境を行うことで、上記断片化状態を解消すること
が知られている。このようなコンパクシ冒ン処理を行う
装置としては、例えば、特開昭60−97444号公報
に記載の装置があげられる。
Therefore, in the swap method, as a way to prevent performance degradation due to the above fragmentation, tasks are moved in main memory and the free area is consolidated into one continuous location. It is known to cure the condition. An example of an apparatus for carrying out such a compaction treatment is the apparatus described in Japanese Patent Application Laid-Open No. 60-97444.

〔発明が解決しようとする課題〕 上記コンパクシ田ン処理は、主メモリ上でメモリ間転送
処理を行って多数のタスクを移動するために、多量のC
PU処理時間を必要とする。また、タスクを主メモリ上
で移動している間は、タスクの内容は部分的にしか正し
くないため、そのタスりを実行することはできない。
[Problems to be Solved by the Invention] The compaction processing described above requires a large amount of C to move a large number of tasks by performing inter-memory transfer processing on the main memory.
Requires PU processing time. Further, while a task is being moved in main memory, the contents of the task are only partially correct and the task cannot be executed.

コンパクシ曹ン処理は、主メモリ全体を対象として行わ
れるため、コンパクシ曹ン処理中は、通常のタスク処理
は全く行われず、システムは、コンパクシ曹ン処理に専
念することになる。
Since the compaction process is performed on the entire main memory, no normal task processing is performed during the compaction process, and the system concentrates on the compaction process.

従って、ワープロ等の対話的データ処理システムにおい
て、上記コンパクション処理を実現すると、コンパクシ
冒ン処理中はユーザからの処理要求が全く受付けられな
いため、対話的処理を行う際に最も重要な性能であるユ
ーザ人力に対する応答性が悪化してしまうという問題が
あった。
Therefore, if the above compaction processing is implemented in an interactive data processing system such as a word processor, no processing requests from the user will be accepted during the compaction processing, so this is the most important performance when performing interactive processing. There was a problem in that the responsiveness to the user's human power deteriorated.

本発明の目的は、対話的処理システムにおいて、オーバ
ーヘッドの少ない;ンパクシ璽ン処理を実現することに
あり、さらに、ユーザ入力に対する応答性が悪化しない
コンパクション処理を実現することにある。
SUMMARY OF THE INVENTION An object of the present invention is to realize compaction processing with little overhead in an interactive processing system, and further, to realize compaction processing that does not deteriorate responsiveness to user input.

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

上記目的を達成するために、本発明は、主メモリ内に複
数個のタスクを動的に割当て、上記主メモリと2次記憶
装置との間で、上記タスクの退避/回復処理を行って、
マルチタスク処理を行うデータ処理装置において、上記
主メモリ内の空きエリアを1ケ所Kまとめるコンバク7
1ン処理を、中断不可能な短時間の処理である単位転送
処理の繰返しにより実現し、上記単位転送処理を、上記
データ処理装置のシステムのアイドル状態時に行うよう
にする。
In order to achieve the above object, the present invention dynamically allocates a plurality of tasks in main memory, performs the saving/recovery processing of the tasks between the main memory and the secondary storage device,
In a data processing device that performs multitasking processing, the above-mentioned free areas in the main memory are grouped together in one place K.
One-time processing is realized by repeating unit transfer processing, which is a short-time process that cannot be interrupted, and the unit transfer processing is performed when the system of the data processing device is in an idle state.

つまり、上記単位転送処理を、上記タスクの1つを上記
主メモリ内で移動する処理とし、通常モードでは、この
単位転送処理の起動条件を、上記システムのアイドル状
態が一定時間以上続くこととする。
In other words, the unit transfer process is a process of moving one of the tasks in the main memory, and in normal mode, the activation condition for this unit transfer process is that the system remains idle for a certain period of time or more. .

この一定時間とは、ユーザに対する応答待ち時間である
と判断できる値であるようにするのが好ましい。
Preferably, this fixed time is a value that can be determined to be a response waiting time for the user.

そのために1本発明は、主メモリ内に複数個のタスクを
動的に割当て、上記主メモリと2次記憶装置との間で、
上記タスクの退避/回復処理を行って、マルチタスク処
理を行うデータ処理装置において、上記タスクの状態と
上記タスクの上記主メモリ内での割当て状態を管理する
第1のテーブル(以下、タスク管理テーブルと呼ぶ、)
と、上記主メモリの使用状態を管理する第2のテーブル
(以下、ページ管理テーブルと呼ぶ、)と、上記タスク
の上記2次記憶装置への退避状態を管理する第5のテー
ブル(以下、退避管理テーブルと呼ぶ、)と、上記タス
ク管理テーブルおよび上記ページ管理テーブルを用いて
、上記主メモリ内の空きエリアを1ケ所にまとめるため
に、上記タスクの1つを上記主メモリ内で移動する手段
と、上記タスク管理テーブル、上記ページ管理テーブル
および上記退避管理テーブルを用いて、上記タスクの上
記主メモリ内での割当て/解放処理を行う手段と、上記
タスク管理テーブル、上記ページ管理テーブルおよび上
記退避管理テーブルを用いて、上記タスクの上記2次記
憶装置への退避/回復処理を行う手段と、上記割当て/
解放手段により、優先モードにおいては、上記タスクが
上記主メモリ内に割当てられない場合に、上記移動手段
を起動する手段と、上記タスクの実行を制御し、実行す
べきタスクが上記主メモリ上に存在しない場合は、上記
割当て/解放手段および上記退避/回復手段を起動し、
また、実行すべきタスクが存在しない状態が一定時間以
上続いた場合は、上記移動手段を起動する手段とを備え
て構成される。
To this end, one aspect of the present invention is to dynamically allocate a plurality of tasks within the main memory, and between the main memory and the secondary storage device.
In a data processing device that performs multitasking processing by performing the task save/recovery process, a first table (hereinafter referred to as a task management table) that manages the state of the task and the allocation state of the task in the main memory is provided. )
a second table (hereinafter referred to as page management table) that manages the usage state of the main memory, and a fifth table (hereinafter referred to as the "page management table") that manages the save state of the task to the secondary storage device. means for moving one of the tasks in the main memory in order to consolidate free areas in the main memory into one place using the task management table (referred to as a management table), the task management table, and the page management table; and a means for performing allocation/release processing of the task in the main memory using the task management table, the page management table, and the evacuation management table; Means for saving/recovering the task to/from the secondary storage device using a management table;
In the priority mode, the releasing means controls the execution of the moving means and the means for activating the moving means when the task is not allocated in the main memory, and the task to be executed is stored in the main memory. If it does not exist, start the above allocation/release means and the above evacuation/recovery means,
Further, if a state in which there is no task to be executed continues for a certain period of time or more, means for activating the above-mentioned moving means is provided.

具体的には、上記割当て/解放手段および上記退避/回
復手段は、スワップタスクと呼ばれるタスクにより実現
され、上記移動手段は、GC(ガベージ−コレクシ璽ン
)タスクと呼ばれるタスクにより実現される。
Specifically, the allocation/release means and the save/recovery means are realized by a task called a swap task, and the movement means is realized by a task called a GC (garbage collection) task.

また、その他の手段は、O8(オペレーティングシステ
ム)の一部として実現される。
Further, other means are realized as part of O8 (operating system).

〔作用〕[Effect]

タスク管理テーブルは、タスクの実行状態やメモリの割
当て状態を管理する。
The task management table manages the execution status of tasks and memory allocation status.

主メモリは、ページと呼ぶ固定長の管理単位に分割して
管理され、個々のページの使用状態をページ管理テーブ
ルが管理する。
The main memory is managed by being divided into fixed-length management units called pages, and a page management table manages the usage status of each page.

退避管理テーブルは、2次記憶装置上に退避されている
タスクとその位置を管理する。
The save management table manages tasks saved on the secondary storage device and their positions.

スワップタスクは、O8により起動され、上記3つの管
理テーブルの8照/更新を行って、タスクの主メモリへ
の割当て/解放処理およびタスクの2次記憶装置への退
避/回復処理を行い、また、タスクを主メモリへ割当て
られない場合に、GCタスクを起動して、主メモリ内の
コンパクション処理を行わせる。
The swap task is started by the O8, checks/updates the three management tables mentioned above, allocates/releases the task to the main memory, and saves/recovers the task to the secondary storage device. , if the task cannot be allocated to the main memory, the GC task is activated to perform compaction processing in the main memory.

GCタスクは、O8またはスワップタスクにより起動さ
れ、タスク管理テーブルとページ管理テーブルとを参照
し、主メモリ内でタスクに割当てられていない部分を1
ケ所にまとめるコンノ(クシ曹ン処理を行う。
The GC task is started by the O8 or the swap task, refers to the task management table and the page management table, and clears the portion of main memory that is not allocated to the task.
Put the pieces together in one place (process the comb).

GCタスクは、1回起動されると、高々1つのタスクを
主メモリ内で移動して処理を終了する。
Once activated, the GC task moves at most one task within the main memory and finishes processing.

主メモリ全体のコンパクシ目ンは、GOタスクを何度も
繰返し起動することによって実現される。
Compacting the entire main memory is achieved by repeatedly activating the GO task.

O8は、システム全体の制御を行い、特に、タスク制御
の部分では、実行すべきタスクが主メモリ上に存在しな
い場合は、スワップタスクを起動して、実行すべきタス
クを主メモリ上に回復してからタスクを実行する。
O8 controls the entire system, and in particular, in the task control part, if the task to be executed does not exist in the main memory, it starts a swap task and restores the task to be executed in the main memory. then run the task.

また、O8は、システムとして行う処理が伺もないアイ
ドル状態の継続時間を管理し、アイドル状態が一定時間
続くと、QCタスクを起動して、主メモリのコンパクシ
ョン処理を行わせる。
The O8 also manages the duration of an idle state in which no processing is performed by the system, and when the idle state continues for a certain period of time, it starts a QC task to perform main memory compaction processing.

このように、O8がシステムのアイドル状態を検出して
、コンパクシ冒ン処理を行わせることで、システムの処
理能力に負担をかけることなく、主メモリのコンパクシ
冒ン処理を行うことができるため、主メモリの利用効率
が向上し、システムの処理能力が向上する。
In this way, the O8 detects the idle state of the system and performs compaction processing, so that the main memory compaction processing can be performed without putting a burden on the system processing capacity. Main memory is used more efficiently, increasing system processing power.

また、GCタスクの1回の起動処理では、移動するデー
タの量が限定されており、コンパクシ目ン処理は、1回
の連続した処理で行われるのではなく、短時間の処理の
集積として実現されるため、コンパクション処理中に他
の処理要求が発生した場合は、高々1回のGOタスクの
処理時間分だけ、該処理要求が待たされるだけであり、
システムの応答性能はほとんど悪化しない。
In addition, the amount of data to be moved is limited in one activation process of a GC task, and the compaction process is not performed in one continuous process, but is realized as an accumulation of short-time processes. Therefore, if another processing request occurs during compaction processing, the processing request will be kept waiting for at most one GO task processing time.
The response performance of the system hardly deteriorates.

なお、スワップタスクおよびGCタスクは、割当て/解
放処理および退避/回復処理の対象とせず、主メモリ上
の決められた位置に、常に割当てられているものとする
It is assumed that the swap task and the GC task are not subject to allocation/release processing or save/recovery processing, and are always allocated to a predetermined location on the main memory.

〔実施例〕〔Example〕

以下、本発明の一実施例を図面を用いて説明する。 An embodiment of the present invention will be described below with reference to the drawings.

第2図は実施例に係るハードウェア構成区である。FIG. 2 shows the hardware configuration according to the embodiment.

本実施例のハードウェアは、データ処理を行うCPU 
(処理装置!、CPU1が実行するプログラムやデータ
を記憶する主メモリ2、プログラムやデータを格納する
2次記憶装置であるハードディスク(以下HDと略す)
3および70ツピ4、文字や機能を入力するキーボード
5およびマウス6、処理結果等を表示するデイスプレィ
7、処理結果等を印刷するプリンタ8.CPU1が出力
するメモリアドレスである論理アドレスを主メモリ2を
アクセスする際に使用されるメモリアドレスである物理
アドレスに変換するアドレス変換器9より構成される。
The hardware of this embodiment is a CPU that performs data processing.
(Processing device!, main memory 2 that stores programs and data executed by the CPU 1, hard disk (hereinafter abbreviated as HD) which is a secondary storage device that stores programs and data
3 and 70 tips 4, a keyboard 5 and a mouse 6 for inputting characters and functions, a display 7 for displaying processing results, etc., and a printer 8 for printing processing results, etc. It is comprised of an address converter 9 that converts a logical address, which is a memory address output by the CPU 1, into a physical address, which is a memory address used when accessing the main memory 2.

第3図建アドレス変換器9の構成を示す。Figure 3 shows the configuration of the address converter 9.

アドレス変換器9は、アドレス比較器91、アドレス切
替器92、アドレス加算器95、ベースレジスタ94に
より構成される。
The address converter 9 includes an address comparator 91, an address switch 92, an address adder 95, and a base register 94.

アドレス比較器91は、論理アドレスを人力とし、入力
された論理アドレスの値が、予めアドレス比較器91内
に設定されている分割点アドレス以上であるかどうかの
比較結果を出力する。
The address comparator 91 manually calculates the logical address and outputs a comparison result to determine whether the value of the input logical address is greater than or equal to the division point address preset in the address comparator 91.

分割点アドレスとは、論理アドレス空間において、直接
空間とウィンドウ空間との境界を示すアドレスである。
The division point address is an address that indicates the boundary between the direct space and the window space in the logical address space.

ベースレジスタ94は、CPU1により値が設定される
レジスタであり、アドレス変換を行う際の加算オフセッ
ト値を保持する。
The base register 94 is a register whose value is set by the CPU 1, and holds an addition offset value when performing address conversion.

アドレス加算器95は、論理アドレスとベースレジスタ
94の値とを入力とし、両者を加算した値を出力とする
The address adder 95 inputs the logical address and the value of the base register 94, and outputs the sum of the two.

アドレス切替器92は、論理アドレス、アドレス加算器
95の出力およびアドレス比較器91の出力を入力とし
、アドレス比較器91の比較結果に従って、論理アドレ
スの値が分割点アドレスより小さい場合は、論理アドレ
スの値をそのまま出力し、論理アドレスの値が分割点ア
ドレス以上の場合は、アドレス加算器93の出力値を、
それぞれ、アドレス切替器92の出力とする。
The address switch 92 receives the logical address, the output of the address adder 95, and the output of the address comparator 91 as inputs, and according to the comparison result of the address comparator 91, if the value of the logical address is smaller than the division point address, the logical address The value of the address adder 93 is output as is, and if the value of the logical address is greater than or equal to the division point address, the output value of the address adder 93 is
Each of these is the output of the address switch 92.

このアドレス変換器9による論理アドレスから物理アド
レスへの変換の様子を第4図に示す。
FIG. 4 shows how the address converter 9 converts a logical address into a physical address.

論理アドレス空間は、分割点アドレスにより、直接空間
とウィンドウ空間と釦分割される。論理アドレス値が直
接空間内に存在する場合は、論理アドレス値、と物理ア
ドレス値とは等しく、論理アドレス値がウィンドウ空間
内にある場合は、物理アドレス値は、論理アドレス値に
ベースレジスタ94の値を加えた値となる。ベースレジ
スタ94の値を変換することで、ウィンドウ空間内の論
理アドレスと物理アドレスとの対応付けを動的に変更す
ることができる。
The logical address space is divided into a direct space and a window space according to the division point address. If the logical address value is in the direct space, the logical address value and the physical address value are equal; if the logical address value is in the window space, the physical address value is equal to the logical address value in the base register 94. The value is the sum of the values. By converting the value of the base register 94, the correspondence between logical addresses and physical addresses in the window space can be dynamically changed.

このようなハードウェア構成のもとでのシステムのソフ
トウェア構成を第1図に示す。
FIG. 1 shows the software configuration of the system based on such a hardware configuration.

本システムのソフトウェアは、OS(オペレーティング
システム)20、スワップタスク30、GCCjjペー
ジ・コレクシヨン)タスク40、複数個のAP(アプリ
ケージ1))タスク50より構成される。
The software of this system includes an OS (operating system) 20, a swap task 30, a GCCjj page collection task 40, and a plurality of AP (application cage 1) tasks 50.

0820は、スワップタスク30、GCり不り40およ
びAPタスク50のマルチタスク処理を実現する。マル
チタスク処理は、コンビ纂−タシステムの制御方式とし
て広く知られている方式であるため、詳細な説明は行わ
ない。
0820 realizes multitask processing of the swap task 30, GC rifuri 40, and AP task 50. Multitask processing is a widely known control method for combinator systems, so a detailed explanation will not be provided.

スワップタスク30は、主メモリ2とID3との間でA
Pタスク50を転送し、主メモリ2の容、量以上のAP
タスク50の実行を可能とする。
Swap task 30 swaps A between main memory 2 and ID3.
P task 50 is transferred to an AP whose capacity is larger than that of main memory 2.
Enables task 50 to be executed.

GCタスク40は、主メモリ2上でAPタスク50が置
かれる位置を移動し、主メモリ2上により多くの・AP
タスク50が存在できるようにする。
The GC task 40 moves the position where the AP task 50 is placed on the main memory 2 and stores more AP tasks on the main memory 2.
Allow task 50 to exist.

APタスク50は、システムとして要求される文書編集
処理、データベース処理等のデータ処理を行う。APタ
スク50は、常に主メモリ2上に存在するわけではなく
、実行されていない場合は、ID3上へと退避されるこ
ともありえるので、このようなタスクは、非常駐タスク
と呼ばれる。
The AP task 50 performs data processing such as document editing processing and database processing required by the system. The AP task 50 does not always exist in the main memory 2, and if it is not being executed, it may be saved to the ID3, so such a task is called a non-resident task.

主メモリ上のAPタスク50の位置、つまり、物理アド
レスは、固定ではなく、動的に変化するが、0820が
アドレス変換器9のベースレジスタ94の値を変更する
ことKより、論理アドレス空間では、常に一定のアドレ
スを占めるように制御する。第4図に従って説明すると
、APタスク50、は、論理アドレス空間上ではウィン
ドウ空間に配置され、APタスク50の論理先頭アドレ
スは、常に、分割点アドレスと等しくなる。
The location of the AP task 50 on the main memory, that is, the physical address, is not fixed and changes dynamically, but since 0820 changes the value of the base register 94 of the address translator 9, in the logical address space. , so that it always occupies a certain address. Explaining according to FIG. 4, the AP task 50 is arranged in a window space on the logical address space, and the logical start address of the AP task 50 is always equal to the division point address.

一方、0820、スワップタスク30およびGCタスク
40は、論理空間上では直接空間に配置され、物理空間
上の位置が変わることはない。
On the other hand, 0820, swap task 30, and GC task 40 are placed directly in the logical space, and their positions in the physical space do not change.

0820は、あるAPタスク50を動作させる場合、主
メモリ2上に、そのAPタスク50を置くのに十分な大
きさのエリアを確保する必要がある0本システムでは、
主メモリ2を固定長のベージ60に分割して管理し、A
Pタスク50に対する主メモリの割当ては、ベージ60
を臀位として行う。
0820 is a system in which when operating a certain AP task 50, it is necessary to secure an area large enough to place the AP task 50 on the main memory 2.
The main memory 2 is divided into fixed-length pages 60 and managed.
The main memory allocation for P task 50 is page 60.
Perform this in the buttocks position.

APタスク50の大きさは、個々のAPタスクにより異
なり、その最大サイズは、論理アドレス空間上のウィン
ドウ空間の大きさである。このように、可変容鷺のメモ
リ割当てを行うために、1つのベージ60の大きさは、
最大APタスクサイズより小さな値(例えば、8分の1
)とし、1つのAPタスク50には、1つ以上の連続し
たベージ60を割当てて処理を行う。
The size of the AP task 50 varies depending on each AP task, and its maximum size is the size of the window space on the logical address space. In this way, in order to allocate memory for the variable capacity heron, the size of one page 60 is
A value smaller than the maximum AP task size (for example, 1/8
), one or more consecutive pages 60 are assigned to one AP task 50 for processing.

主メモリ2上のベージ60の数は有限であるから、次々
に異なるAPタスク50が動作すると、ある時点で、A
Pタスク50に対するベージ600割当てが不可能にな
る。その場合は、その時点で動作していないAPタスク
50をID3へと退避して、そのAPタスク50に対す
るベージ600割当てを解除して、ベージ60に空きを
作成し、動作すべきAPタスク50に割当てる。
Since the number of pages 60 in the main memory 2 is finite, when different AP tasks 50 operate one after another, at a certain point, A
It becomes impossible to allocate page 600 to P task 50. In that case, save the AP task 50 that is not running at that time to ID3, release the page 600 assignment for that AP task 50, create a free space in the page 60, and move the AP task 50 that should be running. Assign.

)ID5に退避したAPタスク50がその後動作する場
合は、退避したタスクの内容を主メモリ2上に回復して
動作させる。その場合も、轟然、APタスク50に対す
るベージ60の割当てが必要であり、必要があれば、他
のAPタスク50を退避してから主メモリ2への回復を
行う。このようなAPタスク500HD3への退避をス
ワップアウト処理と呼び、主メモリ2への回復をスワッ
プイン処理と呼ぶ。
) When the AP task 50 that was saved to ID5 is to be operated thereafter, the contents of the saved task are restored to the main memory 2 and operated. In that case as well, it is necessary to allocate the page 60 to the AP task 50, and if necessary, other AP tasks 50 are evacuated and then restored to the main memory 2. Such evacuation to the AP task 500HD3 is called swap-out processing, and restoration to the main memory 2 is called swap-in processing.

このようなスワップイン/アウト処理をくり返すと、主
メモリ2上には、APタスクに割当てられていないベー
ジ60が散在し、未使用ページの総数としては、APタ
スク50に必要な量よりも多いKもかかわらず、散在し
ている個々の連続した未使用ページの大きさは、どれも
必要蓋にたりないため、割当てることができないという
状況が生じる。このような状況を、主メモリ2に断片化
が生じているという。
When such swap-in/out processing is repeated, pages 60 that are not allocated to the AP task are scattered on the main memory 2, and the total number of unused pages is larger than the amount required for the AP task 50. Despite the large number of pages K, a situation arises in which the size of the individual consecutive unused pages scattered about cannot be allocated because none of them are large enough to cover the required amount. This situation is said to be fragmentation occurring in the main memory 2.

断片化は、主メモリ2上でメモリ間コピーを行ってAP
タスク50の位置を移動し、未使用ページを1ケ所に集
めることによって解消できる。このように、未使用ペー
ジを1ケ所に集める処理をコンパクション処理と呼ぶ。
Fragmentation is achieved by performing memory-to-memory copy on main memory 2.
This problem can be solved by moving the position of the task 50 and collecting unused pages in one place. The process of collecting unused pages in one place in this way is called compaction process.

一般に、コンパクシ1ン処理に要する時間は、主メモリ
2上の割当て済のベージ60の量に比例するため、未使
用ページ総量が少なく、コンバクシラン処理の必要度が
高いほど、コンパクシ冒ン処理時間が長くなるという性
質を持りている。
Generally, the time required for compaction processing is proportional to the amount of allocated pages 60 in main memory 2, so the smaller the total amount of unused pages and the greater the need for compaction processing, the longer the compaction processing time will be. It has the property of being long.

本発明では、システムのアイドル時にコンパクション処
理を実行することで、コンバクシラン処理の負荷を少な
くシ、また、コンパクション処理を単位転送処理と呼ぶ
短時間の処理に分割して実行し、任意の単位転送処理終
了時にコンパクション処理の中断を可能とすることで、
システム全体の応答性を低下させることなく、アイドル
時にコンパクシ冒ン処理を行うことる可能とする。
In the present invention, by executing the compaction process when the system is idle, the load of the convax run process can be reduced, and the compaction process can be divided into short-time processes called unit transfer processes and executed, and arbitrary unit transfer processes can be performed. By making it possible to interrupt the compaction process at the end,
To perform compaction processing during idle time without reducing the responsiveness of the entire system.

以下、これまで説明してきた処理を実理するための具体
的なデータ構造とプログラムの流れについて、説明を行
う。
Below, we will explain the specific data structure and program flow for implementing the processes described so far.

第5図から第8図に本実施例で使用するデータ構造を示
す。
FIGS. 5 to 8 show data structures used in this embodiment.

本実施例では、タスクを管理するためのタスク制御ブロ
ック(以下、’I’CBと略す)25、主メモリ2上の
ベージ60を管理するページ制御ブロック(以下、PC
Bと略す)65、HDS上にタスクを退避する際のHD
3内を管理する退避制御ブロック(以下、E3CBと略
す)35058i類のデータを使用する。
In this embodiment, a task control block (hereinafter abbreviated as 'I'CB) 25 for managing tasks and a page control block (hereinafter abbreviated as 'I'CB) for managing a page 60 on the main memory 2 are used.
(abbreviated as B) 65, HD when saving tasks to HDS
Data of the evacuation control block (hereinafter abbreviated as E3CB) 35058i that manages E3CB is used.

第5図にTCB25の構成を示す。FIG. 5 shows the configuration of the TCB 25.

TCB25は、タスクと1対1に対応しており、APタ
スク50だけでなく、スワップタスク30、GCタスク
40も?CB25により管理される。
The TCB 25 has a one-to-one correspondence with tasks, and not only the AP task 50 but also the swap task 30 and the GC task 40? Managed by CB25.

TCB25内には、リンクポインタ2501、タスク優
先度2502、タスク状態2503、メモリ状態250
4、スケジュール時刻2506、レジスタ退避2507
、タスクサイズ2508、タスクタイプ2509、PC
Bポインタ2510、SCBポインタ2511の各フィ
ールドが存在する。
The TCB 25 includes a link pointer 2501, task priority 2502, task status 2503, and memory status 250.
4. Schedule time 2506, register save 2507
, task size 2508, task type 2509, PC
There are fields for a B pointer 2510 and an SCB pointer 2511.

リンクポインタ2501は、他のTCB25のアドレス
を示し、レディキエーや種々の待ち行列を作成するため
に使用される。
Link pointer 2501 indicates the address of another TCB 25 and is used to create ready keys and various queues.

タスク優先度2502は、タスクが実行される際の優先
度を示す。
Task priority 2502 indicates the priority at which a task is executed.

タスク状態2503は、休止中、実行可能および待ちと
いう5種類の状態を示す。
The task status 2503 shows five types of status: paused, executable, and waiting.

休止中状態とは、タスクが存在してはいるが起動されて
いない状態であり、この状態のタスクは実行の対象とな
らない、タスクは、他のタスクから起動要求が発行され
ると実行可能状態となる。
A dormant state is a state in which a task exists but has not been started.A task in this state is not subject to execution.A task becomes executable when a start request is issued from another task. becomes.

実行可能状態とは、0320のタスクスケジエーリング
処理の対象となる状態であり、この状態のタスクのいず
れかが0820により選択されて、タスク処理が実行さ
れる。待ち状態とは、タスクが入出力要求等の種々の処
理要求を行い、その完了を待っている状態であり、待ち
状態のタスクは実行の対象とはならない。
The executable state is a state that is a target of task scheduling processing at 0320, and any task in this state is selected at 0820 and task processing is executed. A waiting state is a state in which a task makes various processing requests such as input/output requests and is waiting for their completion, and a task in a waiting state is not subject to execution.

メモリ状態2504は、タスクのメモリ使用状態を示す
状態であり、タスク状態2505とは独立した状態であ
る。
The memory state 2504 is a state indicating the memory usage state of a task, and is a state independent of the task state 2505.

タスク状態2504には、退避中、退避可能、退避禁止
、移動禁止の4種類の状態が存在する。
The task status 2504 has four types: evacuating, evacuating possible, evacuating prohibited, and movement prohibited.

退避中状態とは、タスクが主メモリ2上には存在せず、
HDA上に退避されている状態を示す。
The saving state means that the task does not exist in the main memory 2,
Indicates the status of being saved on the HDA.

退避可能、退避禁止、移動禁止の3状態は、いずれも、
タスクが主メモリ2上に存在する場合の状態であり、退
避可能状態とは、タスクのHD3への退避およびタスク
の主メモリ2上での移動のいずれの処理も行いうる状態
であり、退避禁止状態とは、HD3への退避は行いうる
が、主メモリ2上での移動は行えない状態であり、移動
禁止状態とは、退避も移動も行えない状態である。
The three states of evacuation possible, evacuation prohibited, and movement prohibited are all
This is the state when a task exists on the main memory 2, and the evacuation enabled state is a state in which the task can be saved to the HD 3 and the task can be moved on the main memory 2, and the evacuation is prohibited. The state is a state in which data can be saved to the HD 3 but cannot be moved on the main memory 2, and the movement prohibited state is a state in which neither evacuation nor movement can be performed.

タスクは、通常は、退避可能状態であり、退避禁止状態
となるのは、例えば、セマフォ等を使用してシステム資
源を獲得中の場合であり、このような場合は、デッドロ
ックの発生を抑えるために、タスクの退避を禁止する。
A task is normally in an evacuation-enabled state, but becomes in an evacuation-prohibited state, for example, when it is acquiring system resources using a semaphore, etc. In such cases, it is necessary to prevent deadlocks from occurring. Therefore, saving tasks is prohibited.

また、移動禁止状態となるのは、タスクが入出力要求を
出している最中であり、主メモリ2とHD3等との間の
データ転送はCPU1を介することなく直接物理アドレ
スを指定して実行するため、その間はタスクの退避も移
動も禁止する。
In addition, the movement prohibited state occurs while the task is issuing an input/output request, and data transfer between the main memory 2 and the HD 3 etc. is performed by directly specifying the physical address without going through the CPU 1. Therefore, saving or moving tasks is prohibited during that time.

スケジュール時刻2506は、0820によりタスクが
実行の対象として選択された最新の時刻を保持するため
に使用される。スケジュール時刻2506は、スワップ
タスク30が退避すべきタスクを決定する際に使用され
る。
Schedule time 2506 is used to hold the latest time at which a task was selected for execution by 0820. The schedule time 2506 is used when the swap task 30 determines a task to be evacuated.

レジスタ退避2507は、CPU1の内部レジスタの値
を格納するエリアであり、タスク処理の中断/再開を正
しく行うために使用される。他のタスクの実行を開始す
るために、あるタスクの実行が中断されると、その時点
でのCPU 1の内部レジスタの値がレジスタ退避25
07に退避され、再びそのタスクの処理が再開される場
合は、レジスタ退避2507に格納されている値をCP
U 1の内部レジスタに再設定することで、中断時と同
一のタスク実行環境を回復することができ、タスク処理
が正しく再開される。
The register save 2507 is an area for storing the values of internal registers of the CPU 1, and is used to correctly suspend/restart task processing. When the execution of a certain task is interrupted to start execution of another task, the value of the internal register of CPU 1 at that point is saved in the register save 25.
07, and when the processing of that task is resumed, the value stored in the register save 2507 is saved to CP.
By resetting the internal register of U1, it is possible to restore the same task execution environment as at the time of interruption, and task processing is restarted correctly.

タスクサイズ2508は、そのタスクを実行するために
必要なページ60の数であり、タスクにページ60を割
当てる際に使用される。
Task size 2508 is the number of pages 60 required to execute the task, and is used when allocating pages 60 to a task.

タスクタイプ2509は、タスクのメモリ利用に関する
型を示し、常駐、再利用度、再利用不可という3種類が
存在する。
The task type 2509 indicates the type of memory usage of the task, and there are three types: resident, reusable, and non-reusable.

常駐とは、スワップタスク50およびGCタスク40の
型であり、APタスク50は、再利用可および再利用不
可のどちらかの型を持つ。常駐をのタスクは、主メモリ
2上の位置は固定であり、退避されることは決してなく
、常に主メモリ2上に存在する。再利用打型および再利
用不可型のタスクは、HD3への退避が行えるタスクの
型であり、 この2つの型を総称して、非常駐型と呼ぶ、再利用打型
と再利用不可型との違いは、タスクが処理を終了して実
行可能状態から休止中状態に移った後、再び起動されて
実行可能状態に移る際に1以前実行可能状態であった時
のタスクのメモリイメージを、再び利用できるか否かで
あり、再利用打型は利用可能であるが、再利用不可型は
、新たにタスクの初期メモリイメージをメモリ上にロー
ディングする必要がある。
Resident is the type of the swap task 50 and GC task 40, and the AP task 50 has either a reusable type or a non-reusable type. A resident task has a fixed location in the main memory 2, is never saved, and always exists in the main memory 2. Reusable type and non-reusable type tasks are task types that can be saved to HD3, and these two types are collectively called non-resident types. The difference is that after a task finishes processing and moves from the executable state to the dormant state, when it is restarted and moves to the executable state, the memory image of the task that was in the executable state before 1 is restored again. The question is whether or not it can be used.A reusable type can be used, but a non-reusable type requires a new initial memory image of the task to be loaded onto the memory.

PCBポインタ2510は、タスクに割当てられている
ページ60を示すPCB25のアドレスが格納される。
The PCB pointer 2510 stores the address of the PCB 25 indicating the page 60 allocated to the task.

PCBポインタ2510の値が00場合は、タスクにペ
ージ60が割当てられていないことを示す。
When the value of PCB pointer 2510 is 00, it indicates that page 60 is not allocated to the task.

SCBポインタ2511は、タスクが退避中の場合に、
タスクが退避されているエリアを示す5CB35のアド
レスが格納される。SCBポインタ35の値が0の場合
は、タスクが退避されていないことを示す。
The SCB pointer 2511 is set when the task is being saved.
The address of 5CB35 indicating the area where the task is saved is stored. If the value of the SCB pointer 35 is 0, this indicates that the task has not been saved.

第6図に5CB35の構成を示す。FIG. 6 shows the configuration of 5CB35.

HD3上には、最大タスクサイズと同じ大きさのタスク
退避エリアが複数個確保され、それらタスク退避エリア
は、5CB35により管理される。
A plurality of task save areas having the same size as the maximum task size are secured on the HD 3, and these task save areas are managed by the 5CB35.

5CB35には、HD上位置3501と退避中タスク3
502との2つのフィールドが存在する。
5CB35 has HD position 3501 and evacuating task 3.
There are two fields: 502.

HD上位[3501は、上記タスク退避エリアのHDS
上での位置を保持し、退避中タスク3502は、そのタ
スク退避エリアに退避されているタスクのTCB25の
アドレスを保持する。タスク退避エリアにタスクが退避
されていない場合は、退避中タスク5502の値は0と
なる。
HD upper [3501 is the HDS of the task save area above]
The task 3502 that is being saved holds the address of the TCB 25 of the task that has been saved to the task save area. If no task has been saved in the task save area, the value of the task being saved 5502 is 0.

第7図VCPCB65の構成を示す。FIG. 7 shows the configuration of the VCPCB 65.

PCB65には、ページ連結状態6501、ページ状態
6502、ビジー7ラグ6503、更新フラグ6504
、ページタイプ6505、ページ連長6506、割当て
タスク6507、空きページ連リンク6508の各フィ
ールドが存在する。
The PCB 65 includes a page connection state 6501, a page state 6502, a busy 7 lag 6503, and an update flag 6504.
, page type 6505, page length 6506, assigned task 6507, and empty page link 6508.

PCB65は、ページ60と2対2に対応し、ページと
ページとの関係およびページとタスクとの関係を管理す
る。
The PCB 65 has a two-to-two correspondence with the pages 60, and manages the relationship between pages and the relationship between pages and tasks.

2つ以上の連続したページの連なりをページ連と呼ぶ、
ページ間の連なり状態は、ページ連結状態6501iC
よって管理される。
A series of two or more consecutive pages is called a page series.
The connection state between pages is page connection state 6501iC
Therefore, it is managed.

ページ連結状態6501には、先頭、中間、最終および
独立の4つの状態があり、ページ連結状態6501の値
が先頭であるページを先頭ページと呼ぶ、中間ページ、
最終ページ、独立ページという呼び方も同様の意味であ
る。
The page connection state 6501 has four states: first, intermediate, final, and independent, and the page whose value in the page connection state 6501 is "first" is called the first page, an intermediate page,
The terms "final page" and "independent page" have the same meaning.

ページ連とは、独立ページかまたは先頭ページの後に0
個以上の中間ページと1つの最終ページが並んでいる一
連のページのことを示す。
A page series is an independent page or 0 pages after the first page.
Refers to a series of pages that are lined up with one or more intermediate pages and one final page.

ページ連の状態は、その先頭のページ、すなわち、独立
ページまたは先頭ページの状態によって管理される。従
って、中間ページや最終ページでは、PCB65中のペ
ージ連結状態6501以外のフィールドの内容は無効で
あり、ページ連の状態には何の影醤も及ぼさない。
The state of a page series is managed by the state of its first page, that is, an independent page or a first page. Therefore, in the intermediate page and the final page, the contents of fields other than the page connection status 6501 in the PCB 65 are invalid and have no effect on the page series status.

ページ状態6502は、未使用、使用中および予約中と
いう5種類の値をとる。
The page status 6502 takes on five types of values: unused, in use, and reserved.

未使用とは、そのページ連がタスクに割当てられていな
い状態、使用中は、タスクに割当てられている状態を示
し、予約中は、そのページはタスクの格納以外の目的に
使われており、割当てを解除することのできないページ
連であることを示す。
Unused indicates that the page is not assigned to a task, while used indicates that it is assigned to a task, and reserved indicates that the page is used for purposes other than storing tasks. Indicates that this is a page series that cannot be deallocated.

ページ連が予約中となるのは、そのページ内KO320
や常駐タスクが存在する場合である。
Page series are currently reserved for KO320 on that page.
This is the case when there is a resident task.

ビジー7ラグ6505は、そのページ連に割当てられて
いるタスクがページ連を使用できるかどうかを示す、ビ
ジーフラグ6503が真である場合は使用不可であり、
偽である場合は使用可であることを示す、ビジー7/l
グ6503は、そのページ連に対して、退避/回復処理
やコンパクション処理が行われている場合に真となり、
それら処理が終了すると偽となる。
The busy 7 lag 6505 is unavailable if the busy flag 6503, which indicates whether the task assigned to the page set can use the page set, is true.
Busy7/l indicates available if false
The flag 6503 is true if the evacuation/recovery processing or compaction processing is being performed for the page series.
When these processes are completed, it becomes false.

更新フラグ6504は、そのページ連に割当てられたタ
スクがディスパッチされた時に真となり、ページ連の内
容がHD!SK退避された時に偽となる。更新フラグ6
504は、ページ連の内容が変化した可能性があるかど
うかを示し、真である場合は、メモリ上のページ連の内
容とHO2に退避されている内容とが一致していない可
能性があることを示し、偽である場合は、両者の内容が
一致していることを示す。
The update flag 6504 becomes true when the task assigned to the page series is dispatched, and the contents of the page series are HD! Becomes false when SK is evacuated. Update flag 6
504 indicates whether there is a possibility that the contents of the page series have changed, and if true, there is a possibility that the contents of the page series in memory and the contents saved in HO2 do not match. If it is false, it means that the contents of the two match.

ページタイプ6505は、そのページ連のタイプを示す
、ページ連のタイプとしては、システム型とタスク型が
ある。
The page type 6505 indicates the type of the page series. Types of page series include system type and task type.

システム型は、そのページ連が0820や常駐タスク等
釦よって直接使用されている場合の型であり、タスク型
は、そのページ連が0820によって管理され、非常駐
タスクをローディングするために使われる場合の型であ
る。
The system type is the type when the page series is directly used by the 0820 or a button such as a resident task, and the task type is the type when the page series is managed by the 0820 and used to load a non-resident task. It is a type.

ページタイプ6505がシステム型である場合、ページ
状態6502は必ず予約中となる。また、ページタイプ
6505がタスク型である場合は、ベージ状態6502
は、未使用および使用中のいずれかの状態となり、予約
中とはならない。
When the page type 6505 is system type, the page status 6502 is always reserved. In addition, if the page type 6505 is a task type, the page state 6502
will be either unused or in use, and will not be reserved.

ページ連長6506は、そのページ連を構成するページ
の数を示す0例えば、先頭ページに続いて3つの中間ペ
ージがあり、次に最終ページがある場合のページ連の長
さは、5であり、先頭ページのページ連長6506には
、5が設定される。
The page run length 6506 indicates the number of pages that make up the page run. For example, if there are three intermediate pages following the first page and then the last page, the length of the page run is 5. , 5 is set in the page length 6506 of the first page.

あるページ連の次のページ連の先頭のページは、各ペー
ジのページ連結状態’6501を次々と調べることによ
って求めることもできるが、さ−ジ連長6506の値を
用いることにより、常に、一定の時間で次のページ連の
先頭のページを求めることができる。
The first page of the next page series after a certain page series can be found by checking the page concatenation status '6501 of each page one after another, but by using the value of the series series length 6506, it can always be kept constant. The first page of the next page series can be found in the time .

割当てタスク6507は、そのベージ連に割当てられて
いるタスクのTCB25のアドレスを示す。
The assigned task 6507 indicates the address of the TCB 25 of the task assigned to the page group.

ページ連にタスクが割当てられていない場合は、割当て
タスク6507の値は0となる。
If no task is assigned to the page series, the value of the assigned task 6507 is 0.

空きページ連リンク6508は、そのページ連のページ
状態6502が未使用の場合のみ意味をもち、次の未使
用状態のページ連の先頭のページに対するPCB65の
アドレスを示す、空きページ連リンク6508は、未使
用状態のページ連の探索を高速化するために使用される
The empty page series link 6508 has meaning only when the page status 6502 of the page series is unused. Used to speed up searching for unused page sets.

第8図に本実施例で使用するその他のデータ構造を示す
FIG. 8 shows other data structures used in this embodiment.

レディキューヘッダ2601は、タスク状態2503が
実行可能であるTCB25をリンクポインタ2501で
つないで構成されるレディキューの先頭のTCB25の
アドレスを示す。
The ready queue header 2601 indicates the address of the first TCB 25 of the ready queue, which is configured by connecting TCBs 25 in which the task state 2503 is executable using the link pointer 2501.

空きページ連ヘッダ2602は、ページ状fi6502
が未使用であるPCB65を空きページ連リンク650
8でつないで構成される空きページ連リストの先頭のP
CB65のアドレスを示す。
Empty page series header 2602 is page-shaped fi6502
PCB 65 which is unused is empty page link 650
P at the beginning of a list of empty pages connected by 8's
Indicates the address of CB65.

アイドル計時カウンタ2603は、実行すべきタスクが
何もない状態であるアイドル状態の時間を計測するため
に使用され、アイドル状態にコンiくクシ日ン処理を実
行する際のタイミングを決定するために使用される。
The idle time counter 2603 is used to measure the time in the idle state when there is no task to be executed, and is used to determine the timing when executing processing to return to the idle state. used.

以上が本実施例で使用されるデータ構造の説明である。The above is an explanation of the data structure used in this embodiment.

次に、上記データ構造を用いて本実施例が行う処理につ
いて、流出図を用いて説明する。
Next, the processing performed by this embodiment using the above data structure will be explained using an outflow diagram.

第9図は0820の処理の中で、タスク・スケジューリ
ングを行う部分の処理の流れ図である。
FIG. 9 is a flowchart of the task scheduling portion of the 0820 process.

0820は、まず、ステップ2001で、レディキュー
ヘッダ2601につながれるレディーキュー内の各TC
B25のタスク優先度2502を調べ、最も優先度の高
いタスクを選び出し、ステップ2002へ進む。
0820 first, in step 2001, each TC in the ready queue connected to the ready queue header 2601.
The task priority level 2502 of B25 is checked, the task with the highest priority is selected, and the process proceeds to step 2002.

レディキューヘツダ2601の値が0の場合は、実行可
能状態のタスクが1つもないことを示すため、その場合
は、ステップ2002の判定の結果、ステップ2020
へと進む、タスクが選び出せた場合は、ステップ200
2の判定により、ステップ2005へ進み、選んだTC
B25のメモリ状態2504の値を調べ、退避中であれ
ば、ステップ2004へ、そうでなければ、ステップ2
005へと進む。
If the value of the ready queue header 2601 is 0, this indicates that there is no task in an executable state.
If the task can be selected, proceed to step 200.
2, the process advances to step 2005 and the selected TC
Check the value of the memory status 2504 of B25, and if it is being saved, proceed to step 2004; otherwise, proceed to step 2.
Proceed to 005.

ステップ2004では、選んだ’I’CB25をパラメ
ータとして、スワップタスク30を起動し、引き続いて
、ステップ2001へと戻る。
In step 2004, the swap task 30 is started using the selected 'I'CB 25 as a parameter, and then the process returns to step 2001.

スワップタスク50は、0820によってスケジュール
されるタスクであり、全タスク中で最も高い優先度を持
つため、ステップ2001では、必ずスワップタスク5
0が選ばれて実行され、スワップタスク50の処理によ
り、先はど選ばれたタスクのスワップイン処理が行われ
る。スワップタスク50の処理については後述する。
Swap task 50 is a task scheduled by 0820 and has the highest priority among all tasks, so swap task 50 is always scheduled in step 2001.
0 is selected and executed, and through the processing of the swap task 50, the swap-in processing of the task selected first is performed. The processing of the swap task 50 will be described later.

さて、タスクがメモリ上に存在する場合のステップ20
05の処理では、タスクに割当てられているページ連の
ビジー7ラグ6503を調べ、タスクがそのページ連を
使用可能であるかどうかを判定する。
Now, step 20 when the task exists in memory
In the process of 05, the busy 7 lag 6503 of the page series assigned to the task is checked to determine whether the page series can be used by the task.

ビジーフラグ6503が真であれば、不可能であり、そ
の場合は、ステップ2010へと移って、レディキュー
中から、次に優先度の高いタスクを選んで、ステップ2
002へと進み、そのタスクの実行を試みる。
If the busy flag 6503 is true, it is not possible, and in that case, the process moves to step 2010, selects the task with the next highest priority from the ready queue, and performs step 2010.
002 and attempts to execute the task.

ビジーフラグ6503が偽で、タスクが割当てられてい
るページ連を使用可能な場合は、ステップ2006へと
進み、タスクの起動準備を行う、まず、ステップ200
6では、’1’CB25内のスケジューリング2506
に現在の時刻を設定し、続いて、ステップ2007で、
タスクに割当てられているPCB650更新フラグ65
04を真とする。
If the busy flag 6503 is false and the page set to which the task is assigned is usable, the process proceeds to step 2006, where preparations for starting the task are made.
6, scheduling 2506 in '1' CB25
Set the current time to , and then in step 2007,
PCB 650 update flag 65 assigned to the task
04 is true.

次に、ステップ2008で、アドレス変換器90ペース
レジスタ94に値を設定し、ウィンドウ空間のマツピン
グを変更して、論理アドレス空間上にこれから実行すべ
きタスクが見えるようにする。
Next, in step 2008, a value is set in the address translator 90 pace register 94 and the window space mapping is changed so that the task to be executed is visible on the logical address space.

ペースレジスタ94GC設定する値は、以下の様にして
求めることができる。
The value to be set in the pace register 94GC can be determined as follows.

TCB25のPCBポインタ2510は、タスクに割当
てられているページ連の先頭のページのアドレスを保持
しているが、PCB65とページ60とは1対1に対応
しているため、PCBアドレスにより、対応するページ
がn個の中の何番目であるかを特定することができる。
The PCB pointer 2510 of the TCB 25 holds the address of the first page of the page series assigned to the task, but since the PCB 65 and page 60 have a one-to-one correspondence, the corresponding PCB address is used. It is possible to specify the number of pages out of n.

各ページの長さは一定であり、システムに固有の値であ
るため、1番目のページの物理アドレスは、 物理アドレス−ベージ長X(i−1) という弐により求めることができる。こうして求めたペ
ージの物理アドレスから分割点アドレスを引いた値が、
ベースレジスタ94に設定すべき値である。
Since the length of each page is constant and a value unique to the system, the physical address of the first page can be found by the following formula: Physical address - Page length X(i-1). The value obtained by subtracting the division point address from the physical address of the page obtained in this way is
This is the value to be set in the base register 94.

論理アドレスの切換えを終えると、ステップ2009で
、タスクの実行環境を復元し、0820の処理を終えて
、タスク処理を再開する。タスク処理の再開は、TCB
25のレジスタ退避2507の内容をCPU1の内部レ
ジスタに設定することにより行う。
When the switching of the logical address is completed, the task execution environment is restored in step 2009, the process of 0820 is completed, and task processing is restarted. To resume task processing, TCB
This is done by setting the contents of the register save 2507 of No. 25 in the internal register of the CPU 1.

さて、実行すべきタスクが1つもない場合のステップ2
020では、まず、アイドル計時カウンタ2603の値
を0に設定する。
Now, step 2 when there is no task to execute.
At step 020, first, the value of the idle time counter 2603 is set to 0.

次に、ステップ2021で、アイドル計時カウンタ26
03の値を1増やし、予め設定しである値を越えたかど
うかを判定する。越えていなければ、再びステップ20
21へと戻って、計時を続け、越えている場合は、ステ
ップ2022へと進んで、通常モードをパラメータとし
て、GCタスク40を起動シ、コンパクシ冒ン処理を行
う。
Next, in step 2021, the idle time counter 26
The value of 03 is increased by 1, and it is determined whether it exceeds a preset value. If not, go to step 20 again.
The process returns to step 2021 to continue counting the time, and if the time has exceeded the time, the process proceeds to step 2022, where the GC task 40 is activated with the normal mode as a parameter, and compaction processing is performed.

GCタスク40は、スワップタスク50の次に高い優先
度を持つタスクであり、その処理内容については後述す
る。
The GC task 40 is a task with the next highest priority after the swap task 50, and its processing details will be described later.

ステップ2021での時間の測定は、CPU1が命令を
実行する速度によって、設定する具体的な値は異なるが
、秒に換算した場合、300〜2秒となる値を設定する
Although the specific value to be set for measuring the time in step 2021 varies depending on the speed at which the CPU 1 executes the command, a value that is 300 to 2 seconds when converted to seconds is set.

システムがアイドル状態となる要因としては、大別して
、HD!5.70ツピ4のように、一定時間が経過する
と応答が返ってくることが期待できる周辺機器釦対する
応答待ちとなっている場合と、キーボード5のように、
ユーザの操作によって応答が行われるので、応答待ち時
間が不定の状態で応答待ちとなっている場合とがある。
The factors that cause the system to be in an idle state can be roughly divided into HD! 5. As in 70 Tsupi 4, there are cases where a response is being waited for for a peripheral device button that can be expected to return a response after a certain period of time, and as with keyboard 5,
Since a response is made in response to a user's operation, there are cases where the response is waited for with an indefinite response waiting time.

対話的処理を行うシステムの特徴として、前者の応答待
ちと比べて、後者の応答待ち時間の方が圧倒的に長いと
いう点があり、後者の待ち時間にコンパクシ薗ン処理を
行うことが、本発明の特徴の1つであるが、そのために
は、2通りの待ちを区別する必要があり、その判別を、
ステップ2021で行っている。
A characteristic of systems that perform interactive processing is that the waiting time for the latter response is overwhelmingly longer than the waiting time for the former response. One of the features of the invention is that in order to do so, it is necessary to distinguish between two types of waiting.
This is done in step 2021.

HD5に対する応答待ち時間は、通常、数十ミリ秒であ
り、70ツピ4に対する応答待ち時間は、200 ミI
J秒以下である。従ってアイドル状態が300ミリ秒続
けば、ユーザに対する応答待ちとなっていると判断でき
る。一方、2秒以上キー人力が行われない場合は、ユー
ザが入力作業を中断して思索中であると判断できるため
、300 ミリ秒から2秒の間で、コンパクシ璽ン処理
を起動することで、ユーザが入力作業を中断している最
中に、コンパクシ冒ン処理を行うことができる。
The response latency for HD5 is typically several tens of milliseconds, and the response latency for 70Tpi4 is 200 milliseconds.
J seconds or less. Therefore, if the idle state continues for 300 milliseconds, it can be determined that the device is waiting for a response from the user. On the other hand, if the user does not press any key for more than 2 seconds, it can be determined that the user has stopped inputting and is thinking. , it is possible to perform compaction processing while the user is interrupting input work.

次に、スワップタスク30の処理の流れ図を第10図に
示す。
Next, a flowchart of the processing of the swap task 30 is shown in FIG.

スワップタスク50は、スワップインすべきタスクの’
L’CBアドレスをパラメータとして起動され、まず、
ステップ3001で必要な大きさのページ連が割当て可
能かどうかを判定する。
The swap task 50 is a task to be swapped in.
It is started with the L'CB address as a parameter, and first,
In step 3001, it is determined whether a set of pages of the required size can be allocated.

割当てるべきページ連の大きさは、’I’CB25内の
タスクサイズ2508より求める0割当てるベージ連の
探索は、以下の3段階で行われる。
The size of the page series to be allocated is determined from the task size 2508 in the 'I' CB 25. The search for a page series to be allocated with 0 is performed in the following three stages.

まず、ページ状態6502が未使用で、かつ、とジ−フ
ラグが偽であるページ連を対象として行われ、続いて、
ページ状態6502が使用中であり、かつ、更新フラグ
およびビジー7ラグが偽であるページ連を対象として行
われ、最後に、上記2通りの状態のページ連が1つ以上
続いているページ連の連なりを対象として行う、いずれ
の場合も、探索は、最先優先(first −fit+
 )法で行われ、求める大きさ以上のページ連(または
その連なり)が初めて見つかりた時点で探索を中止して
、そのページ連を探索結果とする。
First, the process is performed for pages whose page status 6502 is unused and whose g-flag is false, and then,
This is performed for page series in which the page status 6502 is in use and the update flag and busy7 lag are false. In either case, the search is performed with the first priority (first − fit +
) method, and the search is stopped when a page series (or a series of pages) larger than the desired size is found for the first time, and that page series is taken as the search result.

割当てが可能な場合は、ステップ3006へ進み、タス
クにページ連を割当てる。使用中のページ連を割当てる
場合は、まず、使用中ブロック連のタスクの割当てを解
除して未使用状態とした後で、新たなタスクに割当てる
If assignment is possible, the process advances to step 3006, and the page series is assigned to the task. When allocating a set of pages that are currently in use, first, the assignments of tasks in the currently used block set are canceled to make them unused, and then the blocks are assigned to a new task.

ページ連のタスク割当て解除は、ページ連に割当てられ
たタスクの’rCB25内のPCBポインタ2510に
0、メモリ状態2503に退避中を設定し、続いて、P
CB650割当てタスク6507にOlべ−ジ状態65
02に未使用を設定することKよって行う。
To cancel task assignment of a page series, set the PCB pointer 2510 in the 'rCB25 of the task assigned to the page series to 0, and set the memory status 2503 to "Saving", and then
CB650 assigned task 6507 is in old state 65
This is done by setting 02 to unused.

また、タスクに対するページ連の割当ては、割当てるタ
スクのTCB25内のPCBポインタ2510にページ
連のPCB65のアドレスを設定してメモリ状態250
4を退避可能とし、続いて、PCB650割当てタスク
6507に割当てるタスクのTCBアドレスを設定し、
ページ状態6502を使用中とすることにより行う。
In addition, to allocate a page series to a task, set the address of the page series PCB 65 in the PCB pointer 2510 in the TCB 25 of the task to be assigned, and change the memory state 250.
4 can be saved, then set the TCB address of the task to be assigned to the PCB 650 assigned task 6507,
This is done by setting the page status 6502 to be in use.

尚、ページ連の割当てを行う際、ページ連の長さが割当
てるタスクサイズより大きい場合は、タスクサイズと同
じ大きさのページ連と残りのページ連とにページ連を分
割し、必要なだけの大きさのページ連をタスクに割当て
る。また、ページ連のページ状態6502を未使用とす
る場合は、その前後のページ連の状態を調べ、未使用状
態のベージ連がつづいている場合は、それらのページ連
を合併して1つの未使用状態のページ連へとまとめる作
業も行う。
When allocating a page series, if the length of the page series is larger than the assigned task size, divide the page series into a page series of the same size as the task size and the remaining page series, and then divide the page series as needed. Assign a set of pages of size to a task. In addition, when setting the page status 6502 of a page series as unused, check the status of the page series before and after it, and if there are consecutive page series that are unused, merge those page series to create one unused page series. We also perform the task of organizing pages in their usage status.

ページ連の割当てが終了すると、ステップ3007へと
進み、割当てたページ連内にタスクの内容を回復するス
ワップイン処理を行う。
When the assignment of the page series is completed, the process advances to step 3007, and a swap-in process is performed to restore the task contents to the assigned page series.

スワップイン処理では、まず、スワップインするタスク
に割当てられているページ連のビジーフラグ6505を
セットし、続いて、HD3よりタスクの内容を主メモリ
2上に読み出す、読み出しを行う際の転送元のHD上の
位置は、’1’CB25内のSCBポインタ2511が
示す8CB55のHD上位置5501より求まり、転送
先の主メモリ2上の位置は、TCB25内のPCBポイ
ンタ2510の値より求まる。
In the swap-in process, first, the busy flag 6505 of the page group assigned to the task to be swapped in is set, and then the contents of the task are read from the HD 3 onto the main memory 2. The upper position is determined from the HD position 5501 of the 8CB 55 indicated by the SCB pointer 2511 in the '1' CB 25, and the transfer destination location in the main memory 2 is determined from the value of the PCB pointer 2510 in the TCB 25.

転送が終了すると、1B4s5の退避中タスク!550
2KOを設定し、’I’CB25内のSCBポインタ2
511にも0を設定して、タスクに対する退避エリアの
割当てを解放Tる。続いて、PCB65のビジーフラグ
6505をクリアして、スワップイン処理を終了し、ス
ワップタスク30は処理を終える。
When the transfer is completed, the task being saved is 1B4s5! 550
Set 2KO, SCB pointer 2 in 'I'CB25
511 is also set to 0 to release the allocation of the save area to the task. Subsequently, the busy flag 6505 of the PCB 65 is cleared, the swap-in process is ended, and the swap task 30 ends the process.

ステップ5001の判定の結果、ページ連の割当てが行
えなかった場合は、ステップ3002へと進み、退避可
能なタスクがあるかどうかを判定する。
If the result of the determination in step 5001 is that the page series cannot be allocated, the process advances to step 3002, and it is determined whether there are any tasks that can be saved.

退避可能なタスクとは、TCB25内のタスク状態25
03が退避可能であり、かつTCB25内のPCBポイ
ンタ2510が示すPCB65内のビジーフラグ650
3が偽であり、更新フラグ6504が真であるタスクで
ある。そのようなタスクが存在すれば、ステップ300
5へ、存在しなければ、ステップ3005へと進む。
A task that can be saved is the task status 25 in the TCB 25.
03 can be saved and the busy flag 650 in the PCB 65 indicated by the PCB pointer 2510 in the TCB 25
3 is false, and the update flag 6504 is true. If such a task exists, step 300
5, if it does not exist, proceed to step 3005.

ステップ3005では、優先モードをパラメータとして
GCタスク40を起動し、GCタスク40の処理が終了
すると、ステップ3001へ戻って、再び、ページ連の
割当てを試みる。
In step 3005, the GC task 40 is started using the priority mode as a parameter, and when the processing of the GC task 40 is completed, the process returns to step 3001 and attempts to allocate the page series again.

GCタスク40の処理は後述する。The processing of the GC task 40 will be described later.

退避可能なタスクが存在する場合のステップ3003で
は、TCB25内のスケジュール時刻2506を調べ、
スケジュール時刻の最も旧いタスクを退避すべきタスク
として決定し、引き続いて、ステップ3004で選んだ
タスクのスワップアウト処理を行い、スワップアウト処
理が終了すると、ステップ3001へ戻って、再び、ペ
ージ連の割当てを試みる。
In step 3003 when there is a task that can be saved, the schedule time 2506 in the TCB 25 is checked,
The task with the oldest scheduled time is determined as the task to be evacuated, and then the swap-out process for the selected task is performed in step 3004. When the swap-out process is completed, the process returns to step 3001 and the page series is allocated again. try.

スワップアウト処理は、以下の様にして行う。Swap out processing is performed as follows.

まず、5CB35内の退避中タスク3502が0である
5CB35を探す、そのようなSCBが存在しない場合
は、J(D3上の退避エリアに空きがない状態であるか
ら、直ちに、スワップアウト処理を終了する。空いてい
る退避エリアが存在する場合は、その5CB35のアド
レスをTCB25内のSCBポインタ2511に設定し
、5CB35内の退避中タスク3502に、スワップア
ウトするタスクのTCBアドレスを設定することで、タ
スクに退避エリアを割当てる。
First, search for 5CB35 in which the task 3502 being saved in 5CB35 is 0. If such an SCB does not exist, immediately terminate the swap-out process because there is no space in the save area on J(D3). If there is a vacant evacuation area, set the address of the 5CB35 in the SCB pointer 2511 in the TCB25, and set the TCB address of the task to be swapped out in the evacuation task 3502 in the 5CB35. Assign an evacuation area to a task.

次に、タスクに割当てられているページ連のビジー7ラ
グを真とし、主メモリ2からHD3へのベージ連内容の
転送処理を行う、転送する位置は、先はどのスワップイ
ン処理と同様に求めることができる。
Next, the busy 7 lag of the page series assigned to the task is set to true, and the page series contents are transferred from the main memory 2 to the HD 3.The transfer position is determined in the same way as any swap-in process. be able to.

転送が終了すると、PCB650更新7ラグ6504を
偽とし、ビジー7ラグ6503も偽として、スワップア
ウト処理を終了する。
When the transfer is completed, the PCB 650 update 7 lag 6504 is set to false, the busy 7 lag 6503 is also set to false, and the swap-out process is completed.

次K、第t 1図にコンパクシ璽ン処理を行う際の単位
転送処理の概念図を示す。
Figure 1 shows a conceptual diagram of unit transfer processing when performing compaction processing.

単位転送処理には、スライド転送処理とスワップ転送処
理とが存在し、それぞれの処理内容を、第11図(a)
および第11図(b)に示す。
The unit transfer process includes slide transfer process and swap transfer process, and the contents of each process are shown in FIG. 11(a).
and shown in FIG. 11(b).

単位転送処理の説明を行う前に、まず、コンパクシ冒ン
処理の対象となるページ連の状態について説明する。
Before explaining the unit transfer process, first, the state of the page series to be subjected to the compaction transfer process will be explained.

コンパクシ冒ン処理の対象となるページ連は、ページ状
態6502が未使用で、ビジー7ラグ6505が偽であ
るページ連と、ページ連のページ状態6502が使用中
で、ビジーフラグ6503が偽であり、ページ連に割当
てられているタスクのTCB25内のメモリ状態250
4が移動禁止以外の状態であるページ連である。後者の
状態のページ連を、移動可能ページ連と呼ぶ。
The page series targeted for compaction processing are the page series whose page status 6502 is unused and the busy 7 lag 6505 is false, and the page series whose page status 6502 is in use and the busy flag 6503 is false. Memory status 250 in the TCB 25 of the task assigned to the page series
4 is a page series in a state other than movement prohibited. A page series in the latter state is called a movable page series.

スライド転送処理は、未使用ページ連と、その直後の移
動可能ページ連との間で行われる転送処理であり、移動
可能ページ連の内容を、未使用ページ連の先頭へと順に
複写することで、移動可能ページ連の内容を前方(アド
レス減少方向)へと移動し、未使用ページ連を後方(ア
ドレス増加方向)へと移動する。スライド転送処理では
、移動する2つのページ連の位置関係には制約があるが
、移動する長さには制約がない。
Slide transfer processing is a transfer process performed between an unused page series and the movable page series immediately after it, and is a transfer process that is performed by copying the contents of the movable page series to the beginning of the unused page series in order. , moves the contents of the movable page series forward (in the direction of decreasing addresses) and moves the unused page series backward (in the direction of increasing addresses). In the slide transfer process, there are restrictions on the positional relationship between two sets of pages to be moved, but there are no restrictions on the length of the movement.

スワップ転送処理は、未使用ページ連と、その未使用ペ
ージ連以下の大きさの移動可能ページ連との間で行われ
る転送処理であり、移動可能ページ連の内容を、未使用
ページ連の先頭へと順に複写することで、移動可能ペー
ジ連の内容を移動する。その際、未使用ページ連の長さ
が移動可能ページ連の長さよりも長い場合は、未使用ペ
ージ連を、移動可能ページ連と未使用ページ連とに分割
し、元々の移動可能ページ連を未使用ページ連へと変更
して、位置の変更を行う。この場合は、ページ連の数が
1つ増えて、−時的にはより断片化の進んだ状態となる
。スワップ転送処理では、移動する2つのページ連の長
さには制約があるが、位置関係には制約がない。
Swap transfer processing is a transfer process performed between an unused page series and a movable page series whose size is less than the unused page series, and the contents of the movable page series are transferred to the beginning of the unused page series. You can move the contents of a movable page series by copying them in order. At that time, if the length of the unused page series is longer than the length of the movable page series, the unused page series is divided into the movable page series and the unused page series, and the original movable page series is Change to an unused page series and change the position. In this case, the number of page series increases by one, and the fragmentation becomes more advanced. In swap transfer processing, there is a restriction on the length of two page series to be moved, but there is no restriction on the positional relationship.

これら単位転送処理の組合せにより、GCタスク40は
、主メモリ2全体のコンパクションを行う。
By combining these unit transfer processes, the GC task 40 compacts the entire main memory 2.

第12図にGCタスク40の処理の流れ図を示す。FIG. 12 shows a flowchart of the processing of the GC task 40.

GCタスク40Vi、処理モードをパラメータとして起
動される。処理モードには、通常モードと優先モードと
があり、通常モードは、システムがアイドル状態の場合
に起動されるモードであり、優先モードは、スワップタ
スク30がスワップイン処理を行っている際に呼び出さ
れるモードである。
The GC task 40Vi is activated with the processing mode as a parameter. There are two processing modes: normal mode and priority mode. The normal mode is a mode activated when the system is in an idle state, and the priority mode is activated when the swap task 30 is performing swap-in processing. mode.

GOタスク40は、まず、ステップ4001で、起動モ
ードを判定し、優先モードであれば、ステップ4002
へ、通常モードであれば、ステップ4011へと進む。
The GO task 40 first determines the startup mode in step 4001, and if it is the priority mode, the GO task 40 determines the startup mode in step 4002.
If the mode is normal mode, the process advances to step 4011.

優先モード時のステップ4002では、まず、移動可能
ページ連の中で最も高位アドレスにあるページ連を探索
する。探索結果をステップ4005で判定し、見つから
なかった。つまり、移動可能ベージ連が1つも存在しな
かった場合は、行える処理が何もないため、そのまま、
GCタスク40の処理を終了する。
In step 4002 in the priority mode, first, the page set at the highest address among the movable page sets is searched. The search results are determined in step 4005, and no items were found. In other words, if there is no movable page group, there is nothing that can be done, so
The processing of the GC task 40 ends.

見つかった場合は、ステップ4004へと進み、見つか
った移動可能ページ連がスワップ転送処理により移動可
能かどうかを調べる。移動可能な場合とは、見つかった
移動可能ページ連より前方に、そのページ連以上の長さ
の未使用ページ連が存在する場合である。
If found, the process advances to step 4004 to check whether the found set of movable pages can be moved by swap transfer processing. A movable case is a case where an unused page series with a length longer than the found movable page series exists ahead of the found movable page series.

移動可能な場合は、ステップ4005へ進み、スワップ
転送処理を1回実行して、タスク処理を終了する。スワ
ップ転送の対象となる未使用ページ連が複数個存在する
場合は、それらの中で最も低位アドレスに存在する未使
用ページ連を対象としてスワップ転送処理を行う。
If it is possible to move, the process advances to step 4005, executes swap transfer processing once, and ends task processing. If there are a plurality of unused page sets to be swap transferred, the swap transfer process is performed on the unused page set at the lowest address among them.

スワップ転送が行えない場合は、ステップ4006へと
進んで、スライド転送処理が行えるかどうかを判定する
。スライド転送処理が行える場合とは、見つかった移動
可能ページ連の直前のページ連が未使用ページ連である
場合である。転送が行える場合は、ステップ4007へ
進んで、スライド転送処理を1回行ってタスク処理を終
了する。
If swap transfer cannot be performed, the process advances to step 4006 to determine whether slide transfer processing can be performed. The case where the slide transfer process can be performed is the case where the page series immediately before the found movable page series is an unused page series. If the transfer can be performed, the process advances to step 4007, performs slide transfer processing once, and ends the task processing.

スライド転送も行えない場合は、ステップ4008へと
進み、そのベージ連に対してタスク割当て解放処理の行
えるページ連の中で、最も高位アドレスに存在するペー
ジ連を探索する。タスク割当て解放処理が行えるページ
連とは、そのページ連のページ状態6502が使用中で
あり、かつ、とジ−フラグ6503および更新フラグ6
504が偽であるベージ連をいう。
If slide transfer cannot be performed, the process advances to step 4008, and searches for the page series existing at the highest address among the page series for which task allocation release processing can be performed for the page series. A page series for which task allocation release processing can be performed is one whose page status 6502 is in use, and whose page status 6502 and update flag 6503 and update flag 6 are in use.
504 is false.

探索結果をステップ4009で判定し、見つかった場合
は、ステップ4010へ進み、スワップタスク30のス
ワップアウト処理の所で説明した様に、ページ連に対し
て割当てタスクの解放処理を行い、未使用ページ連とし
て、タスク処理を終了する。
The search results are judged in step 4009, and if found, the process advances to step 4010, where the process of releasing the allocated task for the page series is performed as explained in the swap out process of the swap task 30, and unused pages are released. As a result, the task processing ends.

見つからなかった場合は、ステップ4011へと進み、
通常モードで起動された場合と同一の処理を行う。
If not found, proceed to step 4011.
Performs the same processing as when started in normal mode.

通常モードで起動された場合のステップ4011では、
まず、スライド転送の行える最も低位アドレスに存在す
る未使用ページ連を探索する。スライド転送の行える未
使用ページ連とは、その直後のページ連が移動可能ペー
ジ連である未使用ページ連を示す。
In step 4011 when started in normal mode,
First, a set of unused pages existing at the lowest address to which slide transfer can be performed is searched. An unused page series that can be transferred by slide refers to an unused page series whose immediately following page series is a movable page series.

探索結果をステップ4012で判定し、見つかった場合
は、ステップ4013へと進んで、スライド転送処理を
1回行って、タスク処理を終了する。
The search result is determined in step 4012, and if found, the process proceeds to step 4013, performs slide transfer processing once, and ends the task processing.

見つからなかった場合は、何もすることがないため、直
ちにタスク処理を終了する。
If it is not found, there is nothing to do, so immediately end the task processing.

以上がGCタスク40の処理であり、通常モード時は、
低位の未使用ページ連を次々と高位アドレス方向に移動
して断片化状態の解消をはかり、優先モード時は、断片
化の解消よりも、むしろ、高位アドレス部により大きな
未使用ページ連を作成することを目標として転送処理を
行う。いずれの場合も、GCタスク40の1回の起動で
は、高々1回の単位転送処理しか行わず、コンパクショ
ン処理を行う際に連続して長時間CPUIを専有して処
理を行うことはない。
The above is the processing of GC task 40, and in normal mode,
The program attempts to eliminate fragmentation by moving low-level unused page series one after another toward high-level addresses, and in priority mode, creates a large unused page series at high-level addresses rather than eliminating fragmentation. Transfer processing is performed with this goal in mind. In either case, when the GC task 40 is activated once, only one unit transfer process is performed at most, and when compaction processing is performed, the CPU is not monopolized for a continuous long period of time.

本実施例によれば、主メモリ2のコンパクション処理は
、ユーザからの入力が一定時間とぎれた場合に行われる
ため、システム全体としてのオーバーヘッドを増加させ
ることなく、主メモリ2のコンパクショ/が行えるため
、APタスク50が主メモリ上に存在する可能性が高く
なり、処理性能は増加する。
According to this embodiment, since the compaction process of the main memory 2 is performed when the input from the user is interrupted for a certain period of time, the compaction process of the main memory 2 can be performed without increasing the overhead of the entire system. , the possibility that the AP task 50 exists on the main memory increases, and processing performance increases.

また、コンパクション処理は、単位転送処理と呼ばれる
比較的小さな単位に分割して行われるため、コンパクシ
ョン処理中にユーザからの入力が行われた場合、主メモ
リ2全体のコンパクシ冒ン処理が完了するのを待つこと
なく、単位転送処理が終了するまで待つだけで、入力に
対する応答処理が行え、システムの応答速度をほとんど
変えずに、コンパクション処理が行えるという効果があ
る。
Furthermore, since the compaction process is divided into relatively small units called unit transfer processes, if the user inputs an input during the compaction process, the compaction process for the entire main memory 2 may not be completed. This has the effect that response processing to input can be performed by simply waiting until unit transfer processing is completed without having to wait for , and compaction processing can be performed with almost no change in system response speed.

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

以上説明したように、本発明によれば、対話的処理を行
うデータ処理装置において、ユーザ入力に対する応答性
や処理性能を悪化させることなく、主メモリのコンパク
シ璽ンが行えるため、タスクの退避/回復処理を行う回
数を減らすことができ、システム全体の性能を向上させ
ることができるという効果がある。
As described above, according to the present invention, in a data processing device that performs interactive processing, main memory can be compacted without deteriorating responsiveness to user input or processing performance. This has the effect of reducing the number of times recovery processing is performed and improving the performance of the entire system.

また、上記機能は仮想メモリシステムのような高価なメ
モリ管理機構を用いることなく、単純なアドレス変換機
構を用いるだけで実現できるため、システムのコスト・
パフォーマンスヲ増大すセルことができるという効果が
ある。
In addition, the above functions can be achieved by using a simple address translation mechanism without using an expensive memory management mechanism such as a virtual memory system, which reduces system costs.
This has the effect of increasing cell performance.

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

第1図は本発明の一実施例のソフトウェア構成図、第2
図は本実施例に係るハードウェア構成図、第5図はアド
レス変換器の内部構成図、第4図は論理アドレスから物
理アドレスへの変換方式を示す説明図、第5図はタスク
管理ブロックの構成図、第6図は退避制御ブロックの構
成図、第7図はベージ制御ブロックの構成図、第8図は
その他のデータ構造の構成図、第9図はO8の1部分の
処理の流れ図、第10図はスワップタスクの処理の流れ
図、第11図はページ連の単位転送処理の説明図、第1
2図はGCタスクの処理の流れ図である。・1・・・C
PU 2・・・主メモリ 3・・・ハードディスク 4・・・フロッピ 5・・・キーボード 6・・・マウス 7・・・デイスプレィ 8・・・プリンタ 9・・・アドレス変換器 20・・・オペレーティングシステム 50・・・スワップタスク 40・・・カヘーシ拳コレクションタスク50・・・ア
プリケーションタスク 60・・・ページ。 第 0 第 41I¥1 舎卵罰1アr[ス空M 埠勿夏眠アp゛L入空月i 第71.¥1 PCら 5 第8口 7ワヨや下2601 1!’F−f’Jti” 26”” tynt−+5sph;  ””’ 第50 ”rc8+ 第6図 第q口 第10口 第110
Figure 1 is a software configuration diagram of an embodiment of the present invention, Figure 2 is a software configuration diagram of an embodiment of the present invention.
The figure is a hardware configuration diagram according to this embodiment, Figure 5 is an internal configuration diagram of an address converter, Figure 4 is an explanatory diagram showing a conversion method from a logical address to a physical address, and Figure 5 is a diagram of a task management block. 6 is a configuration diagram of the evacuation control block, FIG. 7 is a configuration diagram of the page control block, FIG. 8 is a configuration diagram of other data structures, and FIG. 9 is a flowchart of the processing of a part of O8. Figure 10 is a flowchart of swap task processing, Figure 11 is an explanatory diagram of page series unit transfer processing, and Figure 1
FIG. 2 is a flowchart of GC task processing.・1...C
PU 2... Main memory 3... Hard disk 4... Floppy 5... Keyboard 6... Mouse 7... Display 8... Printer 9... Address converter 20... Operating system 50...Swap Task 40...Kahesh Fist Collection Task 50...Application Task 60...Page. No. 0 No. 41 I ¥1 Sha Egg Punishment 1 r ¥1 PC et al. 5 8th mouth 7 wayoya 2601 1! 'F-f'Jti"26""tynt-+5sph;""' 50th "rc8+ Figure 6 q port 10th port 110

Claims (1)

【特許請求の範囲】 1、主メモリ内に複数個のタスクを動的に割当て、上記
主メモリと2次記憶装置との間で、上記タスクの退避/
回復処理を行って、マルチタスク処理を行うデータ処理
装置において、 上記主メモリ内の空きエリアを1ケ所にまとめるコンパ
クション処理を、中断不可能な短時間の処理である単位
転送処理の繰返しにより実現し、上記単位転送処理を、
上記データ処理装置のシステムのアイドル状態時に行う
ことを特徴とするタスク制御方式。 2、上記単位転送処理を、上記タスクの1つを上記主メ
モリ内で移動する処理とすることを特徴とする請求項1
記載のタスク制御方式。 3、上記単位転送処理の起動条件として、上記システム
のアイドル状態が一定時間以上続くことを特徴とする請
求項1または2記載のタスク制御方式。 4、上記一定時間は、ユーザに対する応答待ち時間であ
ると判断できる値であることを特徴とする請求項3記載
のタスク制御方式。 5、主メモリ内に複数個のタスクを動的に割当て、上記
主メモリと2次記憶装置との間で、上記タスクの退避/
回復処理を行って、マルチタスク処理を行うデータ処理
装置において、 上記タスクの状態と上記タスクの上記主メモリ内での割
当て状態を管理する第1のテーブルと、 上記主メモリの使用状態を管理する第2のテーブルと、 上記タスクの上記2次記憶装置への退避状態を管理する
第3のテーブルと、 上記第1および第2のテーブルを用いて、上記主メモリ
内の空きエリアを1ケ所にまとめるために、上記タスク
の1つを上記主メモリ内で移動する手段と、 上記第1、第2および第3のテーブルを用いて、上記タ
スクの上記主メモリ内での割当て/解放処理を行う手段
と、 上記第1、第2および第3のテーブルを用いて、上記タ
スクの上記2次記憶装置への退避/回復処理を行う手段
と、 上記割当て/解放手段により、上記タスクが上記主メモ
リ内に割当てられない場合に、上記移動手段を起動する
手段と、 上記タスクの実行を制御し、実行すべきタスクが上記主
メモリ上に存在しない場合は、上記割当て/解放手段お
よび上記退避/回復手段を起動し、また、実行すべきタ
スクが存在しない状態が一定時間以上続いた場合は、上
記移動手段を起動する手段とを備えたことを特徴とする
タスク制御方式。
[Claims] 1. Dynamically allocate a plurality of tasks in the main memory, and save/save the tasks between the main memory and the secondary storage device.
In a data processing device that performs recovery processing and performs multitasking processing, the compaction processing that consolidates the free areas in the main memory into one place is realized by repeating unit transfer processing, which is a short-time process that cannot be interrupted. , the above unit transfer process,
A task control method characterized in that the task control method is performed when the system of the data processing device is in an idle state. 2. Claim 1, wherein the unit transfer process is a process of moving one of the tasks within the main memory.
The task control method described. 3. The task control method according to claim 1 or 2, wherein the activation condition for the unit transfer process is that the system remains idle for a certain period of time or more. 4. The task control method according to claim 3, wherein the certain time is a value that can be determined to be a response waiting time for the user. 5. Dynamically allocate multiple tasks in the main memory and save/save the tasks between the main memory and the secondary storage device.
In a data processing device that performs recovery processing and multitask processing, a first table that manages the status of the task and the allocation status of the task in the main memory; and a first table that manages the usage status of the main memory. a second table; a third table that manages the save status of the task to the secondary storage device; and the first and second tables to consolidate the free area in the main memory into one location. To sum up, means for moving one of the tasks in the main memory, and using the first, second and third tables to allocate/release the task in the main memory. means for saving/restoring the task to the secondary storage device using the first, second, and third tables; means for activating the movement means when the task is not allocated in the main memory; and means for controlling the execution of the task, and when the task to be executed does not exist in the main memory, the allocation/release means and the evacuation/recovery means. 1. A task control system comprising: means for activating said moving means; and means for activating said moving means when a state in which there is no task to be executed continues for a certain period of time or more.
JP1278373A 1989-10-27 1989-10-27 Task control system Pending JPH03141442A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1278373A JPH03141442A (en) 1989-10-27 1989-10-27 Task control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1278373A JPH03141442A (en) 1989-10-27 1989-10-27 Task control system

Publications (1)

Publication Number Publication Date
JPH03141442A true JPH03141442A (en) 1991-06-17

Family

ID=17596433

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1278373A Pending JPH03141442A (en) 1989-10-27 1989-10-27 Task control system

Country Status (1)

Country Link
JP (1) JPH03141442A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0685902A (en) * 1992-09-02 1994-03-25 Murata Mach Ltd Talking device with automatic answering/recording function
JP2008077255A (en) * 2006-09-20 2008-04-03 Nec Corp Mobile terminal device, memory management method used therefor and program therefor
US8140741B2 (en) 2010-01-29 2012-03-20 Kabushiki Kaisha Toshiba Semiconductor storage device and control method thereof
JP2013054534A (en) * 2011-09-05 2013-03-21 Fujitsu Ltd Virtual machine control device, virtual machine control program, and virtual machine control method
JP2017168088A (en) * 2016-03-17 2017-09-21 三星電子株式会社Samsung Electronics Co.,Ltd. Solid state drive, method for performing garbage collection, and article comprising storage medium
JP2019174941A (en) * 2018-03-27 2019-10-10 東芝メモリ株式会社 Storage device, computer system and operating method for storage device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0685902A (en) * 1992-09-02 1994-03-25 Murata Mach Ltd Talking device with automatic answering/recording function
JP2008077255A (en) * 2006-09-20 2008-04-03 Nec Corp Mobile terminal device, memory management method used therefor and program therefor
US8140741B2 (en) 2010-01-29 2012-03-20 Kabushiki Kaisha Toshiba Semiconductor storage device and control method thereof
US8275935B2 (en) 2010-01-29 2012-09-25 Kabushiki Kaisha Toshiba Semiconductor storage device and control method thereof
JP2013054534A (en) * 2011-09-05 2013-03-21 Fujitsu Ltd Virtual machine control device, virtual machine control program, and virtual machine control method
JP2017168088A (en) * 2016-03-17 2017-09-21 三星電子株式会社Samsung Electronics Co.,Ltd. Solid state drive, method for performing garbage collection, and article comprising storage medium
CN107203337A (en) * 2016-03-17 2017-09-26 三星电子株式会社 The passive consistency operation that user can configure
CN107203337B (en) * 2016-03-17 2021-11-09 三星电子株式会社 User configurable passive background operation
JP2019174941A (en) * 2018-03-27 2019-10-10 東芝メモリ株式会社 Storage device, computer system and operating method for storage device

Similar Documents

Publication Publication Date Title
US5613114A (en) System and method for custom context switching
JP4511653B2 (en) Method and apparatus for memory allocation in a multi-threaded virtual machine
JP5466568B2 (en) Resource management method, resource management program, and resource management apparatus
JPH08129457A (en) Method and apparatus for expansion,reduction and redistribution of external storage structure
EP1978444A1 (en) Apparatus and method for collecting resources which became unnecessary
JPH02249055A (en) Multiprocessor system, multiprocessing method and work allocation method
JPH0566621B2 (en)
KR100791296B1 (en) Apparatus and method for providing cooperative scheduling on multi-core system
EP0362880B1 (en) Process for partially swapping real storage areas used by a program between a real storage and an auxiliary storage
US3639912A (en) Management control subsystem for multiprogrammed data processing system
JPH03141442A (en) Task control system
JP2002259146A (en) Device and method for executing application
JP4862770B2 (en) Memory management method and method in virtual machine system, and program
JP3876818B2 (en) Multiprocessor computer and program
JPS603229B2 (en) Information processing method
JP2001229053A (en) Computer with dump acquiring mechanism
JP3163196B2 (en) Instruction interruption information storage control method in virtual storage control
WO2012107988A1 (en) Memory management program, memory management method and information processing device
KR100676671B1 (en) Apparatus and its method for managing user thread
JP2001142723A (en) Resource allocating method, computer system, and recording medium
EP0867811A1 (en) Accounting-information outputting device
JP5212216B2 (en) Job processing device
JP3030030B2 (en) Area management processing method
JP3880739B2 (en) Operating system processing method and operating system processing method
JPH10312297A (en) Resource managing method, resource managing device and recording medium for information processing system having multi-task function