JP3381079B2 - Exclusive control system using cache memory - Google Patents

Exclusive control system using cache memory

Info

Publication number
JP3381079B2
JP3381079B2 JP05527793A JP5527793A JP3381079B2 JP 3381079 B2 JP3381079 B2 JP 3381079B2 JP 05527793 A JP05527793 A JP 05527793A JP 5527793 A JP5527793 A JP 5527793A JP 3381079 B2 JP3381079 B2 JP 3381079B2
Authority
JP
Japan
Prior art keywords
task
entry
identification information
exclusive control
cache memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP05527793A
Other languages
Japanese (ja)
Other versions
JPH06266620A (en
Inventor
恒道 塩澤
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP05527793A priority Critical patent/JP3381079B2/en
Publication of JPH06266620A publication Critical patent/JPH06266620A/en
Application granted granted Critical
Publication of JP3381079B2 publication Critical patent/JP3381079B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数のタスクを並列に
実行するマルチタスク処理を行なう処理ユニットからの
アクセスに対するのデータの転送制御を行なうキャッシ
ュメモリを用いた排他制御技術に係わり、特に、複数の
タスク間でアクセスされるデータの無矛盾性の保証を、
効率良く行なうのに好適なキャッシュメモリを用いた排
他制御システムに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an exclusive control technique using a cache memory for controlling data transfer with respect to an access from a processing unit which performs multitask processing for executing a plurality of tasks in parallel, and more particularly, Guaranteeing consistency of data accessed between multiple tasks,
The present invention relates to an exclusive control system using a cache memory suitable for efficient execution.

【0002】[0002]

【従来の技術】一般に、メインメモリのデータ転送速度
は、処理ユニットの高速な処理速度に比べて低速であ
り、このメインメモリの低速なデータ転送動作は、シス
テムの性能低下の原因となっている。このような、問題
を解決するためには、例えば、社団法人電子情報通信学
会編「電子情報通信ハンドブック」(1988年、株式
会社オーム社発行)の第1670頁から第1671頁に
記載のように、キャッシュメモリ(バッファ記憶)を設
けることが有効である。
2. Description of the Related Art Generally, the data transfer speed of a main memory is slower than the high processing speed of a processing unit, and the low-speed data transfer operation of the main memory causes a decrease in system performance. . In order to solve such a problem, for example, as described in pages 1670 to 1671 of "Electronic Information and Communication Handbook" edited by The Institute of Electronics, Information and Communication Engineers (1988, Ohmsha, Ltd.). It is effective to provide a cache memory (buffer storage).

【0003】このようなキャッシュメモリを介して、マ
ルチタスク処理を行なう処理ユニットの各タスクが、共
通にアクセスする共通データの読み出し、および、書き
換えを行なう場合、他のタスクとの間に矛盾が発生す
る。例えば、タスクAとタスクBが、メインメモリのア
ドレスX(キャッシュメモリのエントリX)に格納して
いる値「x」に、それぞれ、「10」および「100」
を加算する場合、タスクAとタスクBの処理が矛盾なく
行なわれると、アドレスXの値は「x+110」とな
る。しかし、タスクAが、アドレスXの値「x」を読み
出してからアドレスXに値「x+10」を書き込む前
に、処理ユニットで実行されるタスクが、タスクBに切
り替わると、タスクBが、アドレスXの値「x]を読み
出し、タスクBは、アドレスXを「x+100」に書き
換える。そして、タスクAが再開されると、タスクA
は、アドレスXを「x+10」に書き換え、最終的なア
ドレスXの値は「x+10」となる。
When each task of a processing unit that performs multitask processing reads and rewrites common data that is commonly accessed through such a cache memory, a contradiction occurs between the tasks and other tasks. To do. For example, task A and task B are assigned "10" and "100" to the value "x" stored in the address X of the main memory (entry X of the cache memory), respectively.
In the case of adding, if the processes of task A and task B are performed without contradiction, the value of address X becomes “x + 110”. However, when the task executed in the processing unit is switched to the task B before the task A reads the value “x” of the address X and writes the value “x + 10” to the address X, the task B switches the address X to the address X. The value “x” is read, and the task B rewrites the address X to “x + 100”. Then, when task A is restarted, task A
Rewrites the address X into “x + 10”, and the final value of the address X becomes “x + 10”.

【0004】このような矛盾が発生しないように、各タ
スクは、共通データにアクセスする前に、共通データへ
のアクセス権の獲得を行なう。このアクセス権の獲得が
成功すると、タスクは、共通データへのアクセスを行な
い、共通データへのアクセス終了後に、このアクセス権
を解放する。従来技術では、このアクセス権は、共通デ
ータごとに設けられ、同時には1つのタスクにのみ、ア
クセス権が与えられるように制御される。
To avoid such a contradiction, each task acquires an access right to the common data before accessing the common data. When the acquisition of the access right is successful, the task accesses the common data, and releases the access right after the access to the common data is completed. In the prior art, this access right is provided for each common data, and is controlled so that only one task is given the access right at the same time.

【0005】このように、従来のマルチタスクでのデー
タの矛盾を保証する制御においては、各タスクは、共通
データにアクセスする前にアクセス権を獲得し、他のタ
スクからの共通データへのアクセスを抑止する制御や、
あるタスクが共通データにアクセスしている間には、処
理ユニットで実行中のタスクの切り替えを抑止する制御
などの排他制御が必要である。一般に、このような排他
制御では、対象となるデータを以下の3つの状態で管理
する。 (a)リードロック状態:1つ以上のタスクによって読
み出し中であり、他タスクからの書き換えアクセスを抑
止する必要がある。 (b)ライトロック状態:1つのタスクによって書き換
え中であり、他タスクからの読み出し、および、書き換
えアクセスを抑止する必要がある。 (c)アンロック状態 :何れのタスクからも全てのア
クセスが可能である。
As described above, in the conventional control for guaranteeing data inconsistency in multitasking, each task acquires an access right before accessing common data, and another task accesses the common data. Control to suppress
While a task is accessing the common data, exclusive control such as control for switching the task being executed in the processing unit is required. Generally, in such exclusive control, target data is managed in the following three states. (A) Read lock state: Reading is being performed by one or more tasks, and it is necessary to prevent rewrite access from other tasks. (B) Write lock state: Rewriting is being performed by one task, and reading and rewriting access from other tasks must be suppressed. (C) Unlocked state: All tasks can be accessed from any task.

【0006】しかし、このような排他制御技術では、各
タスクが同時並列にアクセスする共通データごとに、ア
クセス権の確保と解放の処理を行なう必要があるため、
このための処理量が増加する欠点があった。このような
問題を解決するための従来技術として、同時並列にアク
セスしないデータと共通データを厳密に分けずに、アク
セス権の確保と解放を、複数の共通データに対して一括
して行なうことにより、アクセス権の確保と解放の回数
を減らす技術がある。
However, in such an exclusive control technique, it is necessary to secure and release the access right for each common data that each task accesses in parallel at the same time.
There is a drawback that the processing amount for this purpose increases. As a conventional technique for solving such a problem, the access right is secured and released collectively for a plurality of common data without strictly separating the data that is not accessed in parallel and the common data from each other. , There is a technology to reduce the number of times of securing and releasing access rights.

【0007】しかし、このように、複数の共通データに
対して一括してアクセス権の確保と解放を行なうと、排
他制御の対象となる共通データの対象が増加し、無用な
排他制御が行なわれるため、複数のタスクで並列に行な
う処理の実行が阻害される確率が大きくなってしまう。
また、タスクの切り替えを抑止する排他制御では、共通
データへのアクセスを頻繁に行なうタスクの実行が優先
されることとなり、例えば、タスクによっては、開始か
ら終了まで切り替えが行なわれなくなり、タスクを相互
に切り替えて分割処理することによって実行の並列化を
図るマルチタスクの制御が複雑になってしまう。
However, when the access right is secured and released collectively for a plurality of common data in this way, the target of the common data subject to the exclusive control increases, and unnecessary exclusive control is performed. Therefore, there is a high probability that the execution of the processes performed in parallel by the plurality of tasks is disturbed.
In addition, in the exclusive control that suppresses switching of tasks, the execution of tasks that frequently access common data is given priority, and for example, switching of tasks is not performed from start to end, and tasks are mutually switched. By switching to and performing division processing, control of multitask for parallelizing execution becomes complicated.

【0008】[0008]

【発明が解決しようとする課題】解決しようとする問題
点は、複数の共通データに対して一括してアクセス権の
確保と解放を行なう従来の排他制御技術では、無用な排
他制御が行なわれ、マルチタスク処理が阻害される確率
が大きくなってしまい、また、タスクの切り替えを抑止
する従来の排他制御技術では、共通データへのアクセス
を頻繁に行なうタスクの実行が優先され、マルチタスク
の並列処理制御が複雑になってしまい、排他制御を効率
良く行なうことができない点である。本発明の目的は、
これら従来技術の課題を解決し、キャッシュメモリのエ
ントリへの各タスクのアクセスに対する排他制御を効率
良く行ない、マルチタスク処理を行なう処理ユニットの
実効的な性能を向上させることを可能とするキャッシュ
メモリを用いた排他制御システムを提供することであ
る。
The problem to be solved is that in the conventional exclusive control technique for collectively securing and releasing the access right to a plurality of common data, unnecessary exclusive control is performed. The probability that multitask processing will be hindered increases, and in the conventional exclusive control technology that suppresses task switching, priority is given to the execution of tasks that frequently access common data, and multitask parallel processing This is because the control becomes complicated and the exclusive control cannot be efficiently performed. The purpose of the present invention is to
A cache memory that solves these problems of the prior art and efficiently performs exclusive control for access of each task to an entry of the cache memory, and can improve the effective performance of a processing unit that performs multitask processing. The exclusive control system used is to be provided.

【0009】[0009]

【課題を解決するための手段】上記目的を達成するた
め、本発明のキャッシュメモリを用いた排他制御システ
ムは、(1)タスクを分割して並列に処理する処理ユニ
ットがアクセスするメインメモリに格納されているブロ
ック単位のデータを、各エントリに格納し、このエント
リを介して、処理ユニットからのアクセスに対するデー
タの転送制御を行なうと共に、処理ユニットで並列に処
理される複数のタスクからの同一のエントリへのアクセ
スを制御してデータの矛盾を回避する排他制御を行なう
キャッシュメモリにおいて、排他制御のために、エント
リに、処理ユニットで並列に処理される各タスクの識別
情報を登録するタスク識別情報登録部と、エントリに格
納されているブロックに対する排他制御情報を登録する
排他制御情報登録部を、エントリごとに設け、タスク単
位で、エントリに格納されているブロックの排他制御、
および、この排他制御の設定と解除を行なうことを特徴
とする。また、(2)上記(1)に記載のキャッシュメ
モリを用いた排他制御システムにおいて、キャッシュメ
モリは、処理ユニットのタスクからの排他制御の解除指
示に基づき、このタスクの識別情報を登録しているエン
トリに対するタスク識別情報の解除、および、このエン
トリに対する全てのタスク識別情報が解除された場合で
の排他制御情報の解除を行なうことを特徴とする。
In order to achieve the above object, an exclusive control system using a cache memory according to the present invention includes (1) storing in a main memory accessed by a processing unit that divides tasks and processes them in parallel. Stored block-unit data in each entry, the data transfer control for access from the processing unit is performed via this entry, and the same task from a plurality of tasks processed in parallel in the processing unit is controlled. In the cache memory that performs exclusive control to control access to the entry and avoid data inconsistency, task identification information that registers the identification information of each task processed in parallel in the processing unit in the entry for exclusive control. Registration unit and exclusive control information registration unit that registers exclusive control information for the block stored in the entry , Provided for each entry, in task units, exclusive control block stored in the entry,
The exclusive control is set and released. (2) In the exclusive control system using the cache memory described in (1) above, the cache memory registers the identification information of this task based on the instruction to release the exclusive control from the task of the processing unit. It is characterized in that task identification information for an entry is released and exclusive control information is released when all task identification information for this entry is released.

【0010】[0010]

【作用】本発明においては、マルチタスク処理を行なう
処理ユニットの各タスクの、キャッシュメモリの同一エ
ントリに対する排他制御を、各タスク単位で行なう。例
えば、キャッシュメモリの各エントリは、各エントリを
識別するアドレス情報や、他のタスクからの全てまたは
一部のアクセスを抑止する排他制御が設定された状態を
示すロック状態情報などと共に、排他制御の設定(ロッ
ク)を指示したタスクの識別情報を登録する。そして、
ロック状態としたエントリに対する抑止が必要なアクセ
スが発生した場合、このアクセスを行なったタスクを判
別する。もし、他のタスクからのアクセスであれば、こ
のタスク、もしくは、このエントリをロックしたタスク
のいずれかを中断、または、無力化(中止)することに
より、排他制御を行なう。このことにより、各タスクが
並列にアクセスする共通なエントリのアクセス権の確保
と解放の処理を行なうための処理量の増加を回避するこ
とができ、かつ、タスクの切り替えを抑止する制御も不
要となる。
In the present invention, exclusive control for the same entry in the cache memory of each task of a processing unit that performs multitask processing is performed for each task. For example, each entry in the cache memory has address information for identifying each entry, lock state information indicating a state in which exclusive control for suppressing all or part of access from other tasks is set, and the exclusive control Register the identification information of the task for which setting (lock) is instructed. And
When an access that needs to be suppressed occurs for an entry in the locked state, the task that performed this access is determined. If the access is from another task, exclusive control is performed by suspending or disabling (stopping) either this task or the task that locked this entry. As a result, it is possible to avoid an increase in the amount of processing for securing and releasing the access right of a common entry that each task accesses in parallel, and to eliminate the need for control to suppress task switching. Become.

【0011】[0011]

【実施例】以下、本発明の実施例を、図面により詳細に
説明する。図1は、本発明の排他制御システムに用いる
キャッシュメモリの本発明に係わる構成の一実施例を示
すブロック図であり、図2は、このキャッシュメモリを
用いた情報処理システムの構成の一具体例を示すブロッ
ク図である。図2において、1は、分割した複数のタス
クを並列に実行してマルチタスク処理を行なう処理ユニ
ット、2は、本発明に係わる排他制御動作を行なうキャ
ッシュメモリ、3は、処理ユニット1とキャッシュメモ
リ2間を接続するキャッシュバス、4は、処理ユニット
1からのアクセスの対象となる元のデータを格納するメ
インメモリ、5は、キャッシュメモリ2とメインメモリ
4間を接続するメモリバスである。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of the configuration according to the present invention of a cache memory used in the exclusive control system of the present invention, and FIG. 2 is a specific example of the configuration of an information processing system using this cache memory. It is a block diagram showing. In FIG. 2, reference numeral 1 is a processing unit that executes a plurality of divided tasks in parallel to perform multitask processing, 2 is a cache memory that performs an exclusive control operation according to the present invention, and 3 is a processing unit 1 and a cache memory. A cache bus 4 for connecting the two is a main memory for storing original data to be accessed from the processing unit 1, and a reference numeral 5 is a memory bus for connecting the cache memory 2 and the main memory 4.

【0012】キャッシュバス3は、処理ユニット1から
送出されるアドレスを伝達するためのアドレスバス31
と、処理ユニット1とキャッシュメモリ2の間で授受さ
れるデータを伝達するためのデータバス32と、処理ユ
ニット1から送出されるアクセスの内容(読み出し/書
き換え)を伝達するためのリード/ライトバス33と、
本発明に係わり、処理ユニット1で実行中の各タスクの
識別情報を伝達するためのタスク識別情報バス34と、
処理ユニット1から送出されるロック(排他制御設定)
指示情報を伝達するためのロック指示バス35と、キャ
ッシュメモリ2から送出される処理ユニット1からのア
クセスに対応する制御結果を伝達するための転送応答バ
ス36と、キャッシュメモリ2から送出される処理ユニ
ット1からのアクセスが矛盾した結果を伝達するための
矛盾応答バス37とからなる。
The cache bus 3 is an address bus 31 for transmitting an address sent from the processing unit 1.
And a data bus 32 for transmitting data transmitted and received between the processing unit 1 and the cache memory 2, and a read / write bus for transmitting contents of access (read / rewrite) transmitted from the processing unit 1. 33,
A task identification information bus 34 for transmitting identification information of each task being executed in the processing unit 1 according to the present invention,
Lock sent from processing unit 1 (exclusive control setting)
A lock instruction bus 35 for transmitting instruction information, a transfer response bus 36 for transmitting a control result corresponding to an access from the processing unit 1 transmitted from the cache memory 2, and a processing transmitted from the cache memory 2. The access from the unit 1 comprises a conflict response bus 37 for transmitting a conflicting result.

【0013】処理ユニット1は、アドレスaで指定され
るデータの読み出し、または、書き換えアクセスを行な
うとき、アドレスバス31にアドレスaを出力し、リー
ド/ライトバス33に、「読み出し」または「書き換
え」の種別を出力し、タスク識別情報バス34に、処理
ユニット1で実行中のタスクに予め割り当てられたタス
ク識別情報を出力し、ロック指示バス35に、「ロック
設定指示」または「ロック解除指示」を出力し、書き換
えの場合には、データバス32に、書き換えデータを出
力する。
When reading or rewriting data specified by the address a, the processing unit 1 outputs the address a to the address bus 31 and the read / write bus 33 to "read" or "rewrite". Of the task ID, the task identification information bus 34 outputs the task identification information assigned in advance to the task being executed in the processing unit 1, and the lock instruction bus 35 outputs the “lock setting instruction” or the “lock release instruction”. In the case of rewriting, the rewriting data is output to the data bus 32.

【0014】本実施例においては、タスク識別情報バス
34は、複数の信号線からなり、各信号線には、処理ユ
ニット1で並列して実行する各タスクが、重複しないよ
うに割り当てられている。そして、処理ユニット1で実
行中のタスクは、キャッシュメモリ2にアクセスする際
に、割り当てられている信号線のみに、値「1」を出力
し、他の信号線には、値「0」を出力する。また、ロッ
ク情報の解除を指示するためのバスは設けず、処理ユニ
ット1からのアクセス時に、ロック指示バス35にロッ
ク指示が出力されていない場合に、当該するエントリに
対するロック情報の解除を指示する。また、メインメモ
リ4は、同じ大きさのブロックに分割され、キャッシュ
メモリ2との間では、メモリバス5を介して、ブロック
単位にメモリ内容の転送を行なう。本発明に係わるキャ
ッシュメモリ2は、図1で示すように、メインメモリ4
の各ブロック単位のメモリ内容を格納する複数のエント
リからなる。
In the present embodiment, the task identification information bus 34 is composed of a plurality of signal lines, and the respective tasks to be executed in parallel in the processing unit 1 are assigned to the respective signal lines so as not to overlap. . When accessing the cache memory 2, the task being executed in the processing unit 1 outputs the value “1” only to the assigned signal line, and outputs the value “0” to the other signal lines. Output. Further, a bus for instructing the release of the lock information is not provided, and when the lock instruction bus 35 does not output the lock instruction at the time of access from the processing unit 1, the release of the lock information for the relevant entry is instructed. . The main memory 4 is divided into blocks of the same size, and the memory contents are transferred to the cache memory 2 in block units via the memory bus 5. The cache memory 2 according to the present invention, as shown in FIG.
It is composed of a plurality of entries for storing the memory contents of each block unit.

【0015】図1において、キャッシュメモリ2のe個
の各エントリ210〜2e0は、転送されたブロックの
アドレス情報を格納するアドレス情報部211〜2e1
と、ブロック単位のメモリ内容を格納するブロックデー
タ部212〜2e2と、図2のタスク識別情報バス34
の信号線と同一のビット数からなり、ロック指示を行な
ったタスクが値「1」を出力した信号線に対応するビッ
トに、値「1」を設定する本発明のタスク識別情報登録
部としてのタスク識別情報部213〜2e3と、ロック
(排他制御)状態を示す本発明の排他制御情報登録部と
してのロック状態情報部214〜2e4と、各エントリ
210〜2e0に格納されている内容が有効であるか無
効であるかを示すバリッド部215〜2e5と、ブロッ
クデータ部212〜2e2の内容のみを書き換えたこと
を示すモディファイ部216〜2e6と、アドレス情報
部211〜2e1と信号線21との内容とを比較する比
較器217〜2e7と、タスク識別情報部213〜2e
3と信号線22との内容とを比較する比較器218〜2
e8と、比較器217〜2e7から「一致」した旨の信
号が出力され、かつ、バリッド部215〜2e5の内容
が、「1(有効)」である場合に、信号線21B〜2e
Bに「オン」を出力するアンドゲート219〜2e9と
からなる。
In FIG. 1, each of the e entries 210 to 2e0 of the cache memory 2 has address information sections 211 to 2e1 for storing the address information of the transferred block.
2, block data sections 212 to 2e2 for storing memory contents in block units, and the task identification information bus 34 of FIG.
As the task identification information registration unit of the present invention, which has the same number of bits as the signal line of No. 1 and sets the value "1" to the bit corresponding to the signal line to which the task that issued the lock instruction outputs the value "1". The task identification information sections 213 to 2e3, the lock state information sections 214 to 2e4 as the exclusive control information registration section of the present invention showing the locked (exclusive control) state, and the contents stored in the respective entries 210 to 2e0 are valid. Contents of the valid parts 215 to 2e5 indicating whether the contents are valid or invalid, the modify parts 216 to 2e6 indicating that only the contents of the block data parts 212 to 2e2 are rewritten, and the address information parts 211 to 2e1 and the signal line 21. Comparators 217 to 2e7 and task identification information sections 213 to 2e
3 and the contents of the signal line 22 are comparators 218-2.
When the signal indicating “match” is output from e8 and the comparators 217 to 2e7 and the content of the valid units 215 to 2e5 is “1 (valid)”, the signal lines 21B to 2e.
And AND gates 219 to 2e9 which output "ON" to B.

【0016】以下、このような構成の本実施例のキャッ
シュメモリの本発明に係わる動作を、図2のメインメモ
リ4のアドレスaで指定されるデータを含むブロックを
Baとし、図2の処理ユニット1が、ブロックBaをア
クセスする場合を例として、図3〜図8を用いて説明す
る。
Hereinafter, the operation of the cache memory of this embodiment having such a structure according to the present invention will be described with the block including data designated by the address a of the main memory 4 of FIG. 2 as Ba, and the processing unit of FIG. A case where the No. 1 accesses the block Ba will be described with reference to FIGS. 3 to 8.

【0017】図3〜図8は、図2における情報処理シス
テムの本発明に係わる処理動作の第1の具体例を示すフ
ローチャートである。本例は、主に、図2の処理ユニッ
ト1からのアクセスに対する図1における本実施例のキ
ャッシュメモリ2の処理を示すものであり、論理回路を
用いることにより、この処理の各部分を並列に実行する
ことができる。まず、図3における処理動作の説明を行
なう。図2の処理ユニット1が、図2のキャッシュバス
3を介して図2のメインメモリ4のa番地のブロックB
aにアクセスすると(ステップ301)、図1における
キャッシュメモリ2は、図2のアドレスバス31に出力
されているアドレスaのアドレス情報を、図1の信号線
21に入力し、また、図2のタスク識別情報バス34に
出力されているタスク識別情報を、図1の信号線22に
入力する(ステップ302)。そして、それぞれ入力し
たアドレス情報とタスク識別情報とに対応して、以下の
ように処理を行なう。
3 to 8 are flowcharts showing a first specific example of the processing operation according to the present invention of the information processing system in FIG. This example mainly shows the processing of the cache memory 2 of the present embodiment in FIG. 1 with respect to the access from the processing unit 1 of FIG. 2, and by using a logic circuit, each part of this processing is performed in parallel. Can be executed. First, the processing operation in FIG. 3 will be described. The processing unit 1 of FIG. 2 uses the cache bus 3 of FIG. 2 to block a at the address a of the main memory 4 of FIG.
1 is accessed (step 301), the cache memory 2 in FIG. 1 inputs the address information of the address a output to the address bus 31 in FIG. 2 to the signal line 21 in FIG. The task identification information output to the task identification information bus 34 is input to the signal line 22 of FIG. 1 (step 302). Then, the following processing is performed corresponding to the input address information and task identification information.

【0018】図2の処理ユニット1から、図2のドレス
バス31を介して要求されたアドレスaのデータを含む
ブロックBaを格納する有効なエントリが、図1のキャ
ッシュメモリ2に存在しない、すなわち、図1の信号線
21B〜2eBの出力が「オン」であるエントリが存在
しない場合(ステップ303)、図1のキャッシュメモ
リ2は、図1のロック状態情報部214〜2e4が、
「0(アンロック状態)」であるエントリから、予め定
められた手続きによって、エントリを選択する(ステッ
プ304)。以下、この選択したエントリをエントリE
と記述し、このエントリEは、アドレス情報部2x1、
ブロックデータ部2x2、タスク識別情報部2x3、・
・・で構成されているものとする。
From the processing unit 1 of FIG. 2 there is no valid entry in the cache memory 2 of FIG. 1 for storing the block Ba containing the data of the requested address a via the dress bus 31 of FIG. If there is no entry in which the output of the signal lines 21B to 2eB of FIG. 1 is “ON” (step 303), the cache memory 2 of FIG. 1 has the lock state information sections 214 to 2e4 of FIG.
An entry is selected from the entries of "0 (unlocked state)" by a predetermined procedure (step 304). Hereafter, this selected entry is referred to as entry E.
And the entry E is the address information part 2x1,
Block data part 2x2, task identification information part 2x3, ...
..

【0019】エントリEのバリッド部2x5が「1(有
効)」、かつ、モディファイ部2x6が「1(ブロック
データ部のBaとメインメモリのBaが不一致)」であ
れば(ステップ305)、図1のキャッシュメモリ2
は、図2のメモリバス5を介して、エントリEのアドレ
ス情報部2x1で指定される図2メインメモリ4のブロ
ックを、ブロックデータ部2x2で書き換える(ステッ
プ306)。そして、図1のキャッシュメモリ2は、図
2のメモリバス5を介して、図2のメインメモリ4から
ブロックBaを読み出し、エントリEのブロックデータ
部2x2に格納し、アドレスaのアドレス情報を、アド
レス情報部2x1に格納し、バリッド部2x5を「1
(有効)」として(ステップ307)、次の図4に示す
処理を行なう。
If the valid part 2x5 of the entry E is "1 (valid)" and the modify part 2x6 is "1 (Ba in the block data part and Ba in the main memory do not match)" (step 305), FIG. Cache memory 2
Rewrites the block of the main memory 4 of FIG. 2 designated by the address information section 2x1 of the entry E by the block data section 2x2 via the memory bus 5 of FIG. 2 (step 306). Then, the cache memory 2 of FIG. 1 reads the block Ba from the main memory 4 of FIG. 2 via the memory bus 5 of FIG. 2, stores it in the block data section 2x2 of the entry E, and stores the address information of the address a, Stored in the address information section 2x1, and set the valid section 2x5 to "1.
(Valid) "(step 307), the processing shown in FIG. 4 is performed.

【0020】以下、図4における処理動作の説明を行な
う。図2の処理ユニット1が、図2のロック指示バス3
5に、ロック指示信号を出力していない場合には(ステ
ップ308)、タスク識別情報部2x3の全てのビット
に「0」を設定し(ステップ309)、ロック状態情報
部2x4に、「0(アンロック状態)」を設定する(ス
テップ310)。また、ステップ308において、図2
の処理ユニット1が、図2のロック指示バス35に、ロ
ック指示信号を出力している場合には、タスク識別情報
部2x3に、図2のタスク識別情報バス35に出力され
ている値を設定する(ステップ311)。そして、図2
のリード/ライトバス33に、アクセス種別として、
「書き換え」ではなく「読み出し」が出力されていれば
(ステップ312)、ロック状態情報部2x4に、「1
(リードロック状態)」を設定し(ステップ313)、
また、「書き換え」が出力されていれば、ロック状態情
報部2x4に、「2(ライトロック状態)」を設定して
(ステップ314)、次の図5に示す処理を行なう。
The processing operation in FIG. 4 will be described below. The processing unit 1 of FIG. 2 has the lock instruction bus 3 of FIG.
If the lock instruction signal is not output in step 5 (step 308), all bits of the task identification information part 2x3 are set to "0" (step 309), and the lock state information part 2x4 is set to "0 ( "Unlocked state)" is set (step 310). In addition, in step 308,
2 outputs the lock instruction signal to the lock instruction bus 35 of FIG. 2, the task identification information section 2x3 is set to the value output to the task identification information bus 35 of FIG. (Step 311). And FIG.
The read / write bus 33 of the
If "read" is output instead of "rewrite" (step 312), "1" is displayed in the lock state information section 2x4.
(Read lock state) "(step 313),
If "rewrite" is output, "2 (write lock state)" is set in the lock state information section 2x4 (step 314) and the process shown in FIG. 5 is performed.

【0021】以下、図5における処理動作の説明を行な
う。図2のリード/ライトバス33に、アクセス種別と
して「書き換え」ではなく「読み出し」が出力されてい
れば(ステップ315)、エントリEのモディファイ部
を「0(ブロックデータ部のBaとメインメモリのBa
が一致)」とすると共に、エントリEのブロックデータ
部に格納されているブロックBaのアドレスaで指定さ
れるデータを、図2のデータバス32に出力する(ステ
ップ316)。また、ステップ315において、図2の
リード/ライトバス33に、アクセス種別として「書き
換え」が出力されていれば、エントリEのモディファイ
部2x6を、「1(ブロックデータ部のBaとメインメ
モリのBaが不一致)」とすると共に、エントリEのブ
ロックデータ部に格納されているブロックBaのアドレ
スaで指定されるデータを、図2のデータバス32に出
力されている内容で書き換える(ステップ317)。以
上の処理が終了すると、図2のキャッシュメモリ2は、
図2の転送応答バス36を介して、図2の処理ユニット
1に、図2のデータバス32に読み出しデータを出力し
た旨、または、書き換えアクセスが完了した旨を通知す
る(ステップ318)。
The processing operation in FIG. 5 will be described below. If "read" is output as the access type instead of "rewrite" to the read / write bus 33 in FIG. 2 (step 315), the modification part of the entry E is set to "0 (Ba in the block data part and the main memory). Ba
And the data designated by the address a of the block Ba stored in the block data part of the entry E is output to the data bus 32 of FIG. 2 (step 316). Further, in step 315, if “rewrite” is output as the access type to the read / write bus 33 of FIG. 2, the modification section 2x6 of the entry E is set to “1 (Ba of the block data section and Ba of the main memory). 2) and the data designated by the address a of the block Ba stored in the block data section of the entry E is rewritten with the contents output to the data bus 32 of FIG. 2 (step 317). When the above process is completed, the cache memory 2 of FIG.
The processing unit 1 of FIG. 2 is notified via the transfer response bus 36 of FIG. 2 that the read data has been output to the data bus 32 of FIG. 2 or that the rewrite access has been completed (step 318).

【0022】また、図3のステップ303において、図
2の処理ユニット1から、図2のアドレスバス31を介
して要求されたアドレスaのデータを含むブロックBa
を格納する有効なエントリEが、図2のキャッシュメモ
リ2に存在する場合、すなわち、図1における信号線2
1B〜2eBの出力が「オン」であるエントリが存在す
る場合には、次の図6〜図8で示す処理動作を行なう。
In step 303 of FIG. 3, a block Ba containing the data of the address a requested from the processing unit 1 of FIG. 2 via the address bus 31 of FIG.
2 exists in the cache memory 2 of FIG. 2, that is, the signal line 2 in FIG.
When there is an entry in which the output of 1B to 2eB is "on", the processing operation shown in the following FIGS. 6 to 8 is performed.

【0023】まず、図6における処理動作の説明を行な
う。本図6は、エントリEのロック情報情報部2x4が
(ステップ319)、「0(アンロック状態)」の場合
の処理を示している。図2の処理ユニット1が、図2の
ロック指示バス35にロック指示信号を出力し(ステッ
プ320)、かつ、図2のリード/ライトバス33に、
アクセス種別として、「書き換え」を出力しているとき
(ステップ321)、エントリEのモディファイ部2x
6が、「1(ブロックデータ部のBaとメインメモリの
Baが不一致)」であれば、図2のキャッシュメモリ2
は、図2のメモリバス5を介して、図2のメインメモリ
4のブロックBaを、ブロックデータ部2x2の内容で
書き換えると共に、モディファイ部2x6を「0(ブロ
ックデータ部のBaとメインメモリのBaが一致)」と
する(ステップ322)。
First, the processing operation in FIG. 6 will be described. FIG. 6 shows the processing when the lock information information section 2x4 of the entry E (step 319) is “0 (unlocked state)”. The processing unit 1 of FIG. 2 outputs a lock instruction signal to the lock instruction bus 35 of FIG. 2 (step 320), and the read / write bus 33 of FIG.
When "rewrite" is output as the access type (step 321), the modification unit 2x of the entry E
If 6 is "1 (Ba in the block data part does not match Ba in the main memory)", the cache memory 2 in FIG.
2 rewrites the block Ba of the main memory 4 of FIG. 2 with the contents of the block data section 2x2 via the memory bus 5 of FIG. 2 and sets the modify section 2x6 to “0 (Ba of the block data section and Ba of the main memory). Match) ”(step 322).

【0024】そして、ロック状態情報部2x4に「2
(書き換え/ライトロック状態)」を設定し(ステップ
323)、タスク識別情報部2x3に、図2のタスク識
別情報バス34に出力されている値を設定する(ステッ
プ324)。また、ステップ321において、アクセス
種別として、「書き換え」ではなく「読み出し」を出力
しているときは、ロック状態情報部2x4に「1(読み
出しロック状態)」を設定し(ステップ325)、ステ
ップ324の処理を行なう。このステップ324の処理
のあとには、上述の図5に示す処理動作を行なう。
Then, "2" is displayed in the lock state information section 2x4.
(Rewrite / write lock state) "is set (step 323), and the value output to the task identification information bus 34 of FIG. 2 is set in the task identification information section 2x3 (step 324). Further, in step 321, when "read" is output instead of "rewrite" as the access type, "1 (read lock state)" is set in the lock state information section 2x4 (step 325), and step 324. Is processed. After the processing of step 324, the processing operation shown in FIG. 5 is performed.

【0025】次に、図7における処理動作の説明を行な
う。本図7は、図6のステップ319において、エント
リEのロック情報情報部2x4が「1(リードロック状
態)」の場合の処理を示している。図2の処理ユニット
1が、図2のロック指示バス35に、ロック指示信号を
出力し(ステップ326)、かつ、図2のリード/ライ
トバス33にアクセス種別として「書き換え」を出力し
ているとき(ステップ327)、図2のタスク識別情報
バス34の全ての信号線の値と、エントリEのタスク識
別情報部2x3の対応する挿げてのビット値とが一致し
なければ、すなわち、図1の信号線2xcの出力がオフ
であれば(ステップ328)、後述の図8におけるステ
ップ329の処理を行なう。すなわち、図2のキャッシ
ュメモリ2は、図2の矛盾応答バス38を介して、矛盾
したアクセス、すなわち、他のタスクがリードロック中
のブロックに対して、書き換えアクセスの要求を行なっ
た旨を通知し、当該アクセスを完了する。
Next, the processing operation in FIG. 7 will be described. FIG. 7 shows the processing when the lock information information section 2x4 of the entry E is “1 (read lock state)” in step 319 of FIG. The processing unit 1 of FIG. 2 outputs a lock instruction signal to the lock instruction bus 35 of FIG. 2 (step 326) and outputs “rewrite” as the access type to the read / write bus 33 of FIG. At this time (step 327), if the values of all the signal lines of the task identification information bus 34 of FIG. 2 and the corresponding inserted bit values of the task identification information section 2x3 of the entry E do not match, that is, If the output of the signal line 2xc of No. 1 is off (step 328), the process of step 329 in FIG. 8 described later is performed. That is, the cache memory 2 of FIG. 2 notifies via the inconsistency response bus 38 of FIG. 2 that there is an inconsistent access, that is, a rewrite access request is made to a block under read lock by another task. Then, the access is completed.

【0026】また、ステップ328において、図2のタ
スク識別情報バス34の全ての信号線の値と、エントリ
Eのタスク識別情報部2x3の対応する挿げてのビット
値とが一致、すなわち、図1の信号線2xcの出力がオ
ンであり、かつ、エントリEのモディファイ部2x6が
「1(ブロックデータ部のBaとメインメモリのBaが
不一致)」であれば、図2のキャッシュメモリ2は、図
2のメモリバス5を介して、図2のメインメモリ4のブ
ロックBaを、ブロックデータ部2x2の内容で書き換
え、モディファイ部2x6を「0(ブロックデータ部の
BaとメインメモリのBaが一致)」に設定する(ステ
ップ330)。そして、ロック状態情報部2x4に「2
(書き換えロック状態)」を設定する(ステップ33
1)。この場合、図2のタスク識別情報バス34の出力
とエントリEのタスク識別情報部2x3の値とが等し
く、ブロックBeをリードロック状態としたのは、処理
ユニットで実行中のタスクのみである。
Further, in step 328, the values of all the signal lines of the task identification information bus 34 of FIG. 2 and the corresponding inserted bit values of the task identification information section 2x3 of the entry E match, that is, the figure If the output of the signal line 2xc of No. 1 is ON and the modification unit 2x6 of the entry E is "1 (Ba of the block data part and Ba of the main memory do not match)", the cache memory 2 of FIG. The block Ba of the main memory 4 of FIG. 2 is rewritten with the contents of the block data section 2x2 via the memory bus 5 of FIG. 2, and the modification section 2x6 is set to “0 (Ba of the block data section and Ba of the main memory match). (Step 330). Then, the lock status information section 2x4 displays "2
(Rewrite lock state) "(step 33)
1). In this case, the output of the task identification information bus 34 of FIG. 2 and the value of the task identification information section 2x3 of the entry E are equal, and the block Be is in the read lock state only for the task being executed in the processing unit.

【0027】また、ステップ327において、図2のリ
ード/ライトバス33に、アクセス種別として「読み出
し」を出力していれば、タスク識別情報部2x3に、タ
スク識別情報部2x3の値とタスク識別情報バス34に
出力されている値との論理和を設定する(ステップ33
2)。例えば、タスク識別情報部2x3に、値「011
01010」が設定されており、タスク識別情報バス3
4に、値「00000100」が出力されている場合、
タスク識別情報部2x3には、値「01101110」
が設定される。
Further, in step 327, if "read" is output as the access type to the read / write bus 33 of FIG. 2, the value of the task identification information section 2x3 and the task identification information are output to the task identification information section 2x3. The logical sum with the value output to the bus 34 is set (step 33).
2). For example, in the task identification information section 2x3, the value "011
"01010" is set, and the task identification information bus 3
When the value "00000100" is output to 4,
The value “01101110” is stored in the task identification information section 2x3.
Is set.

【0028】また、ステップ326において、図2のロ
ック指示バス35にロック指示信号を出力していない場
合、タスク識別情報部2x3に、タスク識別情報部2x
3の値と、タスク識別情報バス34に出力されている
「0」と「1」を反転した値との論理積を設定する(ス
テップ333)。例えば、タスク識別情報部2x3に値
「01101110」が設定されており、タスク識別情
報バス34に値「00000100」が出力されている
場合、タスク識別情報部2x3には、「値「01101
010」が設定される。そして、タスク識別情報部2x
3の全てのビットが「0」(例えば、「0000000
0」)となったときには(ステップ334)、ロック状
態情報部2x4に、値「0(アンロック状態)」を設定
する(ステップ335)。このような処理のあとには、
上述の図5に示す処理動作を行なう。
If no lock instruction signal is output to the lock instruction bus 35 of FIG. 2 in step 326, the task identification information section 2x3 is added to the task identification information section 2x3.
The logical product of the value of 3 and the value obtained by inverting "0" and "1" output to the task identification information bus 34 is set (step 333). For example, when the value “01101110” is set in the task identification information section 2x3 and the value “00000100” is output to the task identification information bus 34, the task identification information section 2x3 displays “value“ 01101110 ”.
010 ”is set. Then, the task identification information section 2x
All bits of 3 are "0" (for example, "0000000").
0 ") (step 334), the value" 0 (unlocked state) "is set in the lock state information section 2x4 (step 335). After such processing,
The processing operation shown in FIG. 5 is performed.

【0029】次に、図8における処理動作の説明を行な
う。本図8は、図6のステップ319において、エント
リEのロック情報情報部2x4が「2(ライトロック状
態)」の場合の処理を示している。図2の処理ユニット
1が、図2のタスク識別情報バス34に出力している内
容と、エントリEのタスク識別情報部2x3の値とが等
しくなければ、すなわち、図1における信号線2xcの
出力がオフであれば(ステップ336)、図2のキャッ
シュメモリ2は、図2の矛盾応答バス38を介して、矛
盾したアクセス、すなわち、他のタスクがリードロック
中のブロックに対して、書き換えアクセスの要求を行な
った旨を通知し(ステップ329)、当該アクセスを完
了する。また、ステップ336において、図2のタスク
識別情報バス34の出力と、エントリEのタスク識別情
報部2x3の値とが等しく、かつ、図2の処理ユニット
1が、図2のロック指示バス35にロック指示信号を出
力していない場合(ステップ337)には、タスク識別
情報部2x3の全てのビットに「0」を設定し、ロック
状態情報部2x4に「0(アンロック状態)」を設定す
る(ステップ338)。そして、以下、上述の図5に示
す処理動作を行なう。
Next, the processing operation in FIG. 8 will be described. FIG. 8 shows a process when the lock information information section 2x4 of the entry E is “2 (write lock state)” in step 319 of FIG. 2 is not equal to the value of the task identification information part 2x3 of the entry E, that is, the output of the signal line 2xc in FIG. 2 is off (step 336), the cache memory 2 of FIG. 2 accesses the inconsistent access, that is, the rewrite access to the block under the read lock by another task, via the inconsistency response bus 38 of FIG. Is notified (step 329) and the access is completed. Further, in step 336, the output of the task identification information bus 34 of FIG. 2 and the value of the task identification information section 2x3 of the entry E are equal, and the processing unit 1 of FIG. 2 transfers the lock instruction bus 35 of FIG. When the lock instruction signal is not output (step 337), "0" is set in all the bits of the task identification information section 2x3, and "0 (unlocked state)" is set in the lock state information section 2x4. (Step 338). Then, the processing operation shown in FIG.

【0030】尚、ステップ329における矛盾したアク
セスを行なった旨の通知を受けると、図2の処理ユニッ
ト1は、実行中のタスクを中断して、予め定められた時
間が経過したあとに、タスクを再開するか、もしくは、
実行中のタスクが書き換えたデータの内容を、タスクが
実行を開始する時点の状態に戻す処理を行なって、実行
中の処理を無効化(中止)し、予め定められた時間が経
過したあとに処理を最初から実行する。このような、実
行中のタスクの処理の無効化(中止)は、無効化する図
1におけるタスク識別情報部213〜2e3の値が等し
く、かつ、図1のモディファイ部216〜2e6に、値
「1(ブロックデータ部のBaとメインメモリのBaが
不一致)」が設定されている全てのエントリのバリッド
部215〜2e5に、値「0(無効)」を設定すること
によって行なうことができる。
When receiving the notification that the inconsistent access is performed in step 329, the processing unit 1 in FIG. 2 interrupts the task being executed, and after a predetermined time has passed, the task Restart, or
Performs processing to restore the contents of the data rewritten by the task being executed to the state at the time the task started executing, invalidating (stopping) the processing being executed, and after a predetermined time has elapsed Perform the process from the beginning. In such invalidation (abort) of the processing of the task being executed, the values of the task identification information portions 213 to 2e3 in FIG. 1 to be invalidated are the same, and the modification portions 216 to 2e6 in FIG. This can be done by setting the value "0 (invalid)" in the valid parts 215 to 2e5 of all entries for which "1 (Ba in the block data part does not match Ba in the main memory)" is set.

【0031】無効化するタスク識別情報と、図1のタス
ク識別情報部213〜2e3の値が等しく、かつ、図1
のモディファイ部216〜2e6に、値「1(ブロック
データ部のBaとメインメモリのBaが不一致)」が設
定されているエントリに格納されているブロックの内容
は、無効化するタスクによって書き換えられる前に、図
2のメインメモリ4に書き込まれているので、上述の処
理を終了したあと、他のタスクは、書き換えられる前の
ブロックにアクセス可能となる。
The task identification information to be invalidated and the values of the task identification information sections 213 to 2e3 of FIG. 1 are equal, and
The contents of the block stored in the entry in which the value "1 (Ba in the block data part and Ba in the main memory do not match)" are set in the modification units 216 to 2e6 of 2 is written in the main memory 4 of FIG. 2, other tasks can access the block before being rewritten after the above processing is completed.

【0032】また、必ずしも、図2の矛盾応答バス37
を介して矛盾が発生した旨の通知を受信したときに実行
中のタスクを中断、または、無効化せず、図2の処理ユ
ニット1が、原因となった当該ブロックを格納している
エントリのタスク識別情報部の内容を読みだす処理部を
設け、当該ブロックをロックしているタスクを無効化す
るものでも良い。これにより、共通データに並列にアク
セスするタスクの中で、重要度が高く、他のタスクに比
べて優先して実行させたい優先度の高いタスクと、優先
度の低いタスクとの間で、共通データに対して競合が発
生した場合、予め、タスクごとに割り当てられた優先度
によって、優先度の低い処理を中止させ、優先度の高い
処理を優先して実行させることが可能となる。
The contradiction response bus 37 shown in FIG.
When a notification indicating that an inconsistency has occurred is received via the, the processing unit 1 in FIG. 2 does not interrupt or invalidate the task, and the processing unit 1 in FIG. A processing unit for reading out the contents of the task identification information unit may be provided to invalidate the task that locks the block. As a result, among tasks that access common data in parallel, tasks that have a high priority and that you want to execute with priority over other tasks, and tasks that have a low priority, can be shared. When contention occurs with respect to data, it is possible to stop low priority processing and prioritize high priority processing according to the priority assigned to each task in advance.

【0033】以上のように、図1に示す実施例のキャッ
シュメモリでは、処理ユニットで実行するタスクを相互
に切り替えて実行するマルチタスク処理において、複数
のタスクが並列にアクセスする共通データのアクセス権
の確保と開放(ロックとアンロック)の処理を、各タス
クが共通データにアクセスする処理と同時に行なうこと
ができる。このことにより、共通データのアクセス権の
確保と開放のためのタスクの処理量の増加が生じず、ま
た、タスクの切り替えを抑止することもなく、排他制御
のための実効的な処理性能の低下をなくすことが可能と
なる。
As described above, in the cache memory of the embodiment shown in FIG. 1, in the multitask processing in which the tasks to be executed in the processing units are mutually switched and executed, the access right of the common data that a plurality of tasks access in parallel Can be performed at the same time as the processing for each task to access common data. As a result, the processing amount of tasks for securing and releasing access rights for common data does not increase, and task switching is not suppressed, and effective processing performance for exclusive control decreases. Can be eliminated.

【0034】上述の実施例において、図2の処理ユニッ
ト1で実行中のタスクからの共通データへのアクセスが
不要となったとき、図2の処理ユニット1は、図2のキ
ャッシュメモリ2に対して、当該タスクのタスク識別情
報とロック状態の解除を指示する。このような指示が入
力されると、図1のキャッシュメモリ2は、次の図9で
示すロック解除の処理を行なう。
In the above-described embodiment, when it becomes unnecessary to access the common data from the task being executed in the processing unit 1 of FIG. 2, the processing unit 1 of FIG. Then, the task identification information of the task and the release of the locked state are instructed. When such an instruction is input, the cache memory 2 of FIG. 1 performs the unlock processing shown in FIG.

【0035】図9は、図2における情報処理システムの
本発明に係わる処理動作の第2の具体例を示すフローチ
ャートである。本例は、図2の処理ユニット1からのロ
ック解除指示に対する図1のキャッシュメモリ2のロッ
ク解除の処理動作を示すものであり、このキャッシュメ
モリ2内には、エントリを順次指定可能なカウンタを設
けている。そして、論理回路を用いることにより、この
処理の各部分を並列に実行することができる。図1のキ
ャッシュメモリ2は、図2のキャッシュバス3を介し
て、ロック解除の指示(予め定められたアドレスへのア
クセス)と共に、タスク識別情報バス34を介して、タ
スク識別情報(このタスク識別情報と共に出力されたロ
ック指示によって設定された全てのエントリがロック解
除処理の対象となる)を受信すると、エントリを順次指
定可能なカウンタに初期値(ここでは「1」)を設定す
る(ステップ401)。このカウンタ値が図1のキャッ
シュメモリ2内のエントリ総数eになるまで、カウンタ
の値が+1されるごとに、以下の処理を行なう。尚、こ
こで、カウンタの値「c」で指定されるエントリをエン
トリEcとし、このエントリEcは、アドレス情報部2
c1、ブロックデータ部2c2、タスク識別情報部2c
3、・・・で構成されているものとする。
FIG. 9 is a flow chart showing a second specific example of the processing operation according to the present invention of the information processing system in FIG. This example shows a processing operation of unlocking the cache memory 2 of FIG. 1 in response to an unlocking instruction from the processing unit 1 of FIG. 2. In the cache memory 2, a counter capable of sequentially designating entries is provided. It is provided. Then, by using the logic circuit, each part of this processing can be executed in parallel. The cache memory 2 shown in FIG. 1 receives the lock release instruction (access to a predetermined address) via the cache bus 3 shown in FIG. 2 and the task identification information (this task identification) via the task identification information bus 34. When all the entries set by the lock instruction output together with the information are subject to the lock release processing), an initial value (here, “1”) is set to a counter capable of sequentially designating the entries (step 401). ). The following processing is performed each time the counter value is incremented by 1 until the counter value reaches the total number e of entries in the cache memory 2 of FIG. Here, the entry designated by the counter value “c” is referred to as an entry Ec, and this entry Ec is the address information section 2
c1, block data section 2c2, task identification information section 2c
3 and so on.

【0036】エントリEcのバリッド部2c5の値が
「0(無効)」(ステップ402)、または、ロック状
態情報部2c4の値が「0(アンロック状態)」の場合
(ステップ403、404)、カウンタの値を+1する
(ステップ410)。ステップ402において、エント
リEcのバリッド部2c5の値が「1(有効)」で、か
つ、ステップ403、404において、ロック状態情報
部2c4の値が「1(リードロック状態)」の場合に
は、タスク識別情報部2x3に、タスク識別情報部2x
3の値と、タスク識別情報バス34に出力されている
「0」と「1」を反転した値との論理積を設定する(ス
テップ405)。例えば、タスク識別情報部2x3に値
「01101110」が設定されており、タスク識別情
報34に値「00000100」が出力されている場
合、タスク識別情報部2x3には、値「0110101
0」が設定される。タスク識別情報部2x3の全てのビ
ットが「0」(例えば、「00000000」)となっ
たときには(ステップ406)、ロック状態情報部2x
4に値「0(アンロック状態)」を設定し(ステップ4
07)、カウンタの値を+1する(ステップ410)。
When the value of the valid part 2c5 of the entry Ec is "0 (invalid)" (step 402) or the value of the lock state information part 2c4 is "0 (unlocked state)" (steps 403, 404), The value of the counter is incremented by 1 (step 410). If the value of the valid portion 2c5 of the entry Ec is “1 (valid)” in step 402 and the value of the lock state information portion 2c4 is “1 (read lock state)” in steps 403 and 404, The task identification information section 2x3 is added to the task identification information section 2x.
The logical product of the value of 3 and the value obtained by inverting "0" and "1" output to the task identification information bus 34 is set (step 405). For example, when the value “01101110” is set in the task identification information section 2x3 and the value “00000100” is output in the task identification information 34, the value “0110101” is set in the task identification information section 2x3.
0 ”is set. When all the bits of the task identification information section 2x3 become "0" (for example, "00000000") (step 406), the lock state information section 2x
Set the value "0 (unlocked state)" to 4 (step 4
07), the counter value is incremented by 1 (step 410).

【0037】また、ステップ402において、エントリ
Ecのバリッド部2c5の値が「1(有効)」で、ステ
ップ403において、ロック状態情報部2c4の値が
「2(ライトロック状態)」の場合で、かつ、エントリ
Ecのタスク識別情報部2c3とタスク識別情報バス3
4の値が等しい場合、すなわち、信号線2cCの値がオ
ンの場合(ステップ408)、バリッド部2c5に値
「0(無効)」をセットし(ステップ409)、リード
/ライトバス33の値を+1する(ステップ4109。
ステップ408において、エントリEcのタスク識別情
報部2c3とタスク識別情報バス34の値が等しくない
場合、すなわち、信号線2cCの値がオフの場合、その
まま、カウンタの値を+1する(ステップ410)。
If the value of the valid portion 2c5 of the entry Ec is "1 (valid)" in step 402 and the value of the lock state information portion 2c4 is "2 (write lock state)" in step 403, In addition, the task identification information section 2c3 of the entry Ec and the task identification information bus 3
When the values of 4 are equal, that is, when the value of the signal line 2cC is on (step 408), the value “0 (invalid)” is set in the valid part 2c5 (step 409), and the value of the read / write bus 33 is set. +1 (step 4109).
In step 408, when the values of the task identification information section 2c3 of the entry Ec and the task identification information bus 34 are not equal, that is, when the value of the signal line 2cC is off, the counter value is incremented by 1 (step 410).

【0038】このようにして、図2の処理ユニット1で
実行するタスクにおいて、リードロック状態、または、
ライトロック状態となっている共通データへのアクセス
が不要となった場合、タスクが設定した排他制御情報を
解除するためのアクセス(すなわち、ロック指示を行な
わずに、当該ブロックへのアクセスを行なう)を、1回
で行なうことができ、従来技術のように、共通データを
格納しているブロックごとに行なうことが不要となり、
ロック解除のための処理ユニットからのアクセス回数を
削減することができる。特に、矛盾発生の通知を受信し
た場合の無効化のために、全てのロック状態を解除する
場合に有効である。また、ロック状態の解除の指示と共
に通知するタスク識別情報で、全てのタスクを指定する
(例えば、「11111111」を出力)ことによっ
て、図1におけるキャッシュメモリ2の全てのロック情
報を解除することも可能となる。
In this way, in the task executed by the processing unit 1 shown in FIG.
When access to the common data in the write lock state becomes unnecessary, access to release the exclusive control information set by the task (that is, access to the block without issuing a lock instruction) Can be performed once, and it is not necessary to perform it for each block storing common data as in the conventional technique.
The number of accesses from the processing unit for unlocking can be reduced. In particular, it is effective when all lock states are released for invalidation when a notification of occurrence of inconsistency is received. Further, all the lock information of the cache memory 2 in FIG. 1 can be released by designating all the tasks (for example, outputting “11111111”) by the task identification information notified together with the instruction to release the lock state. It will be possible.

【0039】以上、図1〜図9を用いて説明したよう
に、本実施例のキャッシュメモリでは、タスクが並列に
アクセスする共通データへのアクセスを行なう際に、ア
クセス権の確保と開放の処理を、各処理ユニットで実行
するアクセスと同時に実行することができる。このこと
により、タスク間でアクセスするデータの無矛盾性を、
効率良く保証することが可能である。また、タスクの並
列処理を阻害する無用な排他制御、および、タスクの切
り替えを抑止する制御などが不要となり、アクセス権の
確保と開放のための処理ユニットのオーバヘッドも生じ
ず、処理ユニットでの実効的な性能を向上させることが
可能となる。尚、本発明は、図1〜図9を用いて説明し
た実施例に限定されるものではなく、その要旨を逸脱し
ない範囲において種々変更可能である。
As described above with reference to FIGS. 1 to 9, in the cache memory of this embodiment, when a task accesses common data to be accessed in parallel, processing for securing and releasing an access right is performed. Can be executed simultaneously with the access executed by each processing unit. By this, consistency of data accessed between tasks
It is possible to guarantee efficiently. In addition, unnecessary exclusive control that hinders parallel processing of tasks and control that suppresses switching of tasks are not required, and the overhead of the processing unit for securing and releasing access rights does not occur. Performance can be improved. The present invention is not limited to the embodiment described with reference to FIGS. 1 to 9, and various modifications can be made without departing from the scope of the invention.

【0040】[0040]

【発明の効果】本発明によれば、キャッシュメモリのエ
ントリに格納されているブロックへの各タスクのアクセ
スに対する排他制御を効率良く行なうことができ、タス
ク間でアクセスするデータの無矛盾性の保証処理の高効
率化と、マルチタスク処理を行なう処理ユニットの実効
的な性能の向上が可能である。
According to the present invention, exclusive control for access of each task to a block stored in an entry of a cache memory can be efficiently performed, and a process of guaranteeing consistency of data to be accessed between tasks is guaranteed. It is possible to improve the efficiency of and the effective performance of the processing unit that performs multitask processing.

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

【図1】本発明の排他制御システムに用いるキャッシュ
メモリの本発明に係わる構成の一実施例を示すブロック
図である。
FIG. 1 is a block diagram showing an embodiment of a configuration according to the present invention of a cache memory used in an exclusive control system of the present invention.

【図2】図1におけるキャッシュメモリを用いた情報処
理システムの構成の一具体例を示すブロック図である。
FIG. 2 is a block diagram showing a specific example of the configuration of an information processing system using the cache memory in FIG.

【図3】図2における情報処理システムの本発明に係わ
る処理動作の第1の具体例を示すフローチャートの第1
の部分である。
3 is a first flowchart of a first specific example of the processing operation according to the present invention of the information processing system in FIG.
Part of.

【図4】図2における情報処理システムの本発明に係わ
る処理動作の第1の具体例を示すフローチャートの第2
の部分である。
FIG. 4 is a second flowchart of the first specific example of the processing operation according to the present invention of the information processing system in FIG.
Part of.

【図5】図2における情報処理システムの本発明に係わ
る処理動作の第1の具体例を示すフローチャートの第3
の部分である。
5 is a third flowchart of the first specific example of the processing operation according to the present invention of the information processing system in FIG.
Part of.

【図6】図2における情報処理システムの本発明に係わ
る処理動作の第1の具体例を示すフローチャートの第4
の部分である。
6 is a fourth flowchart of the first specific example of the processing operation according to the present invention of the information processing system in FIG. 2;
Part of.

【図7】図2における情報処理システムの本発明に係わ
る処理動作の第1の具体例を示すフローチャートの第5
の部分である。
FIG. 7 is a fifth flowchart of the first specific example of the processing operation according to the present invention of the information processing system in FIG. 2;
Part of.

【図8】図2における情報処理システムの本発明に係わ
る処理動作の第1の具体例を示すフローチャートの第6
の部分である。
8 is a sixth flowchart of the first specific example of the processing operation according to the present invention of the information processing system in FIG.
Part of.

【図9】図2における情報処理システムの本発明に係わ
る処理動作の第2の具体例を示すフローチャートであ
る。
9 is a flowchart showing a second specific example of the processing operation according to the present invention of the information processing system in FIG.

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

1 処理ユニット 2 キャッシュメモリ 3 キャッシュバス 4 メインメモリ 5 メモリバス 21、22 信号線 31 アドレスバス 32 データバス 33 リード/ライトバス 34 タスク識別情報バス 35 ロック指示バス 36 転送応答バス 37 矛盾応答バス 210〜2e0 エントリ 211〜2e1 アドレス情報部 212〜2e2 ブロックデータ部 213〜2e3 タスク識別情報部 214〜2e4 ロック状態情報部 215〜2e5 バリッド部 216〜2e6 モディファイ部 217〜2e7 比較器 218〜2e8 比較器 219〜2e9 アンドゲート 21B〜2eB 信号線 1 processing unit 2 cache memory 3 cash bus 4 main memory 5 memory bus 21,22 signal line 31 address bus 32 data buses 33 read / write bus 34 Task identification information bus 35 Lock instruction bus 36 Transfer response bus 37 Contradiction Response Bus 210-2e0 entries 211-2e1 address information section 212 to 2e2 block data part 213 to 2e3 task identification information section 214-2e4 Lock status information section 215-2e5 Valid part 216-2e6 Modifying section 217-2e7 comparator 218 to 2e8 comparator 219-2e9 AND Gate 21B-2eB signal line

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/08 G06F 12/00 G06F 9/46 G06F 15/16 - 15/177 ─────────────────────────────────────────────────── ─── Continuation of the front page (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 12/08 G06F 12/00 G06F 9/46 G06F 15/16-15/177

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 タスクを分割して並列に処理する処理ユ
ニットがアクセスするメインメモリに格納されているブ
ロック単位のデータを、各エントリに格納し、該エント
リを介して、上記処理ユニットからのアクセスに対する
データの転送制御を行なうと共に、上記処理ユニットで
並列に処理される複数のタスクからの同一のエントリへ
のアクセスを制御してデータの矛盾を回避する排他制御
を行なうキャッシュメモリにおいて、上記排他制御のた
めに、上記エントリに、上記処理ユニットで並列に処理
される各タスクの識別情報を登録するタスク識別情報登
録手段と、上記エントリに格納されているブロックに対
する排他制御情報を登録する排他制御情報登録手段を、
上記エントリごとに設け、タスク単位で、上記エントリ
に格納されているブロックの排他制御、および、該排他
制御の設定と解除を行なうことを特徴とするキャッシュ
メモリを用いた排他制御システム。
1. A block-unit data stored in a main memory, which is accessed by a processing unit that divides a task into parallel processing, is stored in each entry, and the access from the processing unit is performed via the entry. In the cache memory, which performs the transfer control of the data to and the access to the same entry from a plurality of tasks processed in parallel in the processing unit to avoid the data inconsistency, For this purpose, in the entry, task identification information registration means for registering the identification information of each task processed in parallel in the processing unit, and exclusive control information for registering the exclusive control information for the block stored in the entry Registration method,
An exclusive control system using a cache memory, which is provided for each entry and performs exclusive control of the block stored in the entry and setting and cancellation of the exclusive control for each task.
【請求項2】 請求項1に記載のキャッシュメモリを用
いた排他制御システムにおいて、上記キャッシュメモリ
は、上記処理ユニットのタスクからの上記排他制御の解
除指示に基づき、該タスクの識別情報を登録しているエ
ントリに対する上記タスク識別情報の解除、および、該
エントリに対する全てのタスク識別情報が解除された場
合での上記排他制御情報の解除を行なうことを特徴とす
るキャッシュメモリを用いた排他制御システム。
2. The exclusive control system using the cache memory according to claim 1, wherein the cache memory registers identification information of the task based on an instruction to release the exclusive control from a task of the processing unit. An exclusive control system using a cache memory, which releases the above task identification information for an entry and the above exclusive control information when all the task identification information for that entry is released.
JP05527793A 1993-03-16 1993-03-16 Exclusive control system using cache memory Expired - Fee Related JP3381079B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP05527793A JP3381079B2 (en) 1993-03-16 1993-03-16 Exclusive control system using cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP05527793A JP3381079B2 (en) 1993-03-16 1993-03-16 Exclusive control system using cache memory

Publications (2)

Publication Number Publication Date
JPH06266620A JPH06266620A (en) 1994-09-22
JP3381079B2 true JP3381079B2 (en) 2003-02-24

Family

ID=12994105

Family Applications (1)

Application Number Title Priority Date Filing Date
JP05527793A Expired - Fee Related JP3381079B2 (en) 1993-03-16 1993-03-16 Exclusive control system using cache memory

Country Status (1)

Country Link
JP (1) JP3381079B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4226816B2 (en) 2001-09-28 2009-02-18 株式会社東芝 Microprocessor
US7502887B2 (en) 2003-11-12 2009-03-10 Panasonic Corporation N-way set associative cache memory and control method thereof
JP4643702B2 (en) * 2008-10-27 2011-03-02 株式会社東芝 Microprocessor
WO2011158441A1 (en) * 2010-06-17 2011-12-22 日本電気株式会社 Data processing device and method, and processor unit of same
JP6281282B2 (en) * 2013-12-27 2018-02-21 富士通株式会社 Access control program, control device, and access control method

Also Published As

Publication number Publication date
JPH06266620A (en) 1994-09-22

Similar Documents

Publication Publication Date Title
US5761734A (en) Token-based serialisation of instructions in a multiprocessor system
US6708256B2 (en) Memory-to-memory copy and compare/exchange instructions to support non-blocking synchronization schemes
US4665484A (en) Shared memory multiprocessing system & method
JPH04306748A (en) Information processor
JP3381079B2 (en) Exclusive control system using cache memory
JP3965784B2 (en) Shared memory exclusive access control method
JPH04155465A (en) Method for using file in common
JP3381086B2 (en) Exclusive controllable multiprocessor system
JP3093609B2 (en) Apparatus and method for controlling storage consistency of cache memory
JP3381080B2 (en) Exclusive control method that can interrupt processing
JPS6153747B2 (en)
JPH06139206A (en) Exclusive control system of multiprocessor system
JPS6285372A (en) Comparing and swapping system in multi-processor system
JPH03164964A (en) Exclusive control processor for information processor
JP2636760B2 (en) Multiprocessor system
JP2587468B2 (en) Lock data setting device
JPH0635866A (en) Multiprocessor system
JP2588547B2 (en) Multi CPU system
JP3219810B2 (en) Data processing device
JP2710475B2 (en) Memory control circuit
JPH06266621A (en) Data access method
US8301845B2 (en) Access control method and computer system
JPH04139545A (en) Data base updating processing system
JPH03271859A (en) Information processor
JPH01280858A (en) Lock control system for main storage device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees