Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3790653B2 - Shared memory access management device - Google Patents
[go: Go Back, main page]

JP3790653B2 - Shared memory access management device - Google Patents

Shared memory access management device Download PDF

Info

Publication number
JP3790653B2
JP3790653B2 JP2000003464A JP2000003464A JP3790653B2 JP 3790653 B2 JP3790653 B2 JP 3790653B2 JP 2000003464 A JP2000003464 A JP 2000003464A JP 2000003464 A JP2000003464 A JP 2000003464A JP 3790653 B2 JP3790653 B2 JP 3790653B2
Authority
JP
Japan
Prior art keywords
data
value
shared memory
control
flag
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
JP2000003464A
Other languages
Japanese (ja)
Other versions
JP2001005720A (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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2000003464A priority Critical patent/JP3790653B2/en
Publication of JP2001005720A publication Critical patent/JP2001005720A/en
Application granted granted Critical
Publication of JP3790653B2 publication Critical patent/JP3790653B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Multi Processors (AREA)
  • Memory System (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、複数のプロセスで共有される共有メモリに対するアクセスを制御する共有メモリアクセス管理装置に関する。
【0002】
【従来の技術】
従来、コンピュータで並行して実行中の複数のプロセスが協同して何らかの処理を行う場合、この処理実行に必要な情報を、共有メモリを介してやりとりする。
例えば、プロセスAがプロセスBにデータを渡す場合であれば、プロセスAが共有メモリにデータを書き込み、その後、プロセスBがこのデータを読み出す、という手順となる。ただし、この手順を正しく進行させるには、互いのプロセスが自身の処理の進行状況を応じて相手側の動作を制御する必要がある。プロセスAはデータ書き込みの完了をプロセスBに通知することが必要であるし、プロセスBの側も、データの読み出し完了をプロセスAに通知しないと、その後のプロセスAによる共有メモリへの新たなデータ書き込みができない。
【0003】
そして、こうした制御を行うためにはフラグが用いられる。上記の例では、フラグがOFFの状態からプロセスAがデータの書き込みを開始し、書き込みを完了した段階でフラグをONに設定する。プロセスBはフラグがOFFの間は共有メモリにはアクセスせず、フラグがONになると共有メモリからのデータ読み出しを開始し、読み出しを完了するとフラグをOFFに設定する。すると、プロセスAは、次のデータ書き込みが可能になったことを認識できる。
【0004】
こうしたフラグは上の例の通り複数プロセスによって設定/参照されるので、やはり共有メモリの中に設けられることになる。つまり、複数プロセスが共有メモリを用いてデータのやり取りをしながら処理を行う場合、共有メモリには、データの書き込み/読み出しのためのエリア(以下「データエリア」)と、処理の進行を制御するためのフラグが設けられたエリア(以下「制御用フラグエリア」)とが混在する。
【0005】
プロセスA、Bは定期的に制御フラグエリアを参照(以下「ポーリング」という)しながら、その値に従って動作する。
ただし、共有メモリが、プロセスからのアクセスを受け付けるポートを複数有するデュアルポート型のものである場合、共有メモリを用いた処理についてプロセスの正しい動作を保証するためには、複数プロセスからのアクセス(write:データの書き込み、および制御フラグの更新、read:データの読み出し、および制御フラグの参照)が衝突するのを防止しなければならない。衝突とは、メモリ内の同じアドレスのエリアに複数のプロセスが同時にアクセスすることであり、デュアルポート型のメモリでなければ発生しない。
【0006】
共有メモリへのプロセスのアクセスが競合した場合に発生するのは以下のパターンである。
・パターン1:writeとwriteと(データ書き込み同士、又はフラグ更新同士)が衝突する。複数のプロセスがメモリの同一箇所に同時に書き込み又は更新を行おうとする状態。メモリセルが破壊されるおそれがある。
・パターン2:writeとread(データの書き込みと読み出し、又はフラグの更新と参照)とが衝突する。Read側のプロセスが読み出した内容が不定となってしまい、読み出した内容をもとに行われる動作の結果が不正となるおそれがある。
【0007】
上記の例の場合、プロセスA、Bの動作手順の内容から、データエリアについても制御フラグエリアについてもパターン1は発生しない。パターン2についても、データエリアに関して言えば、制御フラグの読み出し結果に間違いがない限り発生しない。しかし、制御フラグエリアに関しては、パターン2の発生を防止できない。フラグの更新と参照とが衝突してフラグの内容が不定となると、読み出されたフラグは「0」、「1」のいずれにも認識されうる。
【0008】
そして、パターン2発生の結果、読み出された制御フラグの値が不定となった場合、プロセスが誤動作するおそれがある。以下に誤動作の一例を挙げる。
プロセスAがプロセスBに対して、データエリアを介してデータを渡した上でデータの加工を行わせる。加工のパターンは2通りあって、プロセスAはそのいずれかをフラグによって指示する、という処理を考えてみる。制御フラグエリアには、上述のデータ書き込み完了を示すフラグに加えて、加工パターンを示すフラグが設けられる。
【0009】
制御フラグエリアの値と、それに応じた両プロセスの動作とを以下に示す。上位1ビットは加工パターン(0:第1の加工パターン、1:第2の加工パターン)を、下位1ビットはデータ書き込み完了を、それぞれ示すフラグである。
(1)00:プロセスAがデータエリアにデータ書き込み中。
(2)01:プロセスAがデータ書き込みを完了。プロセスBはデータを読み出し、第1の加工パターンで加工する。
(3)11:プロセスAがデータ書き込みを完了。プロセスBはデータを読み出し、第2の加工パターンで加工する。
【0010】
ここで、プロセスAは、データエリアへのデータ書き込みを完了した時点で、プロセスBに対し第2加工パターンでのデータ加工を指示するために、制御用ビットエリアの値を2ビットとも書きかえて「00」から「11」に変更する。その変更の瞬間にプロセスBによる制御用ビットエリアの参照が行われると、更新されていた2ビットのフラグは両方とも不定となってしまう。そのため、プロセスBはビット列の値を、「00」、「01」、「10」、「11」のいずれにも認識しうる。
【0011】
正しく「11」と読み取った場合はもちろん問題なく、「00」と読み取った場合もプロセスBはポーリングを繰り返し、次回の参照の際は値を正しく「11」と認識するので、やはり問題ない。しかし、「01」と判断した場合、プロセスBは、第1加工プロセスでデータ加工するという誤動作を行うことになる。更に、「10」というありえないパターンとして認識すると、最悪の場合、異常事態の発生と判断して処理を停止してしまうおそれもある。
【0012】
また、上記の例には該当しないが、制御用フラグの値が読み違えられることでデータエリアへの書き込みアクセスが衝突する事態が発生すると、データエリア内のデータの破壊などの深刻な結果につながることも考えられる。
こうした誤動作を確実に防止するには、誤動作の原因となりうるアクセスの衝突を防止すればよく、そのための手段が共有メモリに対する排他制御である。
【0013】
排他制御の手法として代表的なものが、信号を用いて一つのプロセスにだけアクセスを許すセマフォ管理方法である。その具体的な方法としては、ハードウェアによるものがあり、ハードウェアによる排他制御の一般的な例として、共有メモリのハードウェアとしての実体であるメモリデバイスが排他制御用信号を発生させるものがある。メモリデバイスは、あるプロセスがメモリにアクセスしている間、ビジー信号を発生させ、他のプロセスによるメモリへのアクセスを制限する。ビジー信号は、プロセス実行の主体であるデバイス(CPUなど)のWAIT信号線を介してプロセスに伝えられ、プロセスはWAIT信号線からビジー信号が入力される間は共有メモリへのアクセスを行わない。よって誤動作の原因となるアクセスの衝突は発生しない。
【0014】
なお、共有メモリの排他制御に制御用フラグを用いる手法もあるが、制御用フラグ自体が共有メモリに設けられるもので、フラグについてはアクセスの衝突を確実には排除できない。確実な排他制御の手段としてはハードウェアを用いざるを得ない。
【0015】
【発明が解決しようとする課題】
しかしながら、ハードウェアによる排他制御については、専用のハードウェアとしてビジー信号を発生させるメモリデバイスが必要となり、また、プロセスの実行主体であるデバイスがこのようなビジー信号による排他制御に対応する機能を備えていない場合、当該デバイス外部に排他制御用の回路を別途設けないと排他制御が実現できないなど、コストの上昇を招く傾向がある。また、組み合わされるデバイスの排他制御に関する仕様によっては、異常事態も発生しうる。例えば、プロセスの実行デバイスが、アクセス実行中のプロセスを停止させる場合、メモリに排他制御の解除(ビジー信号の停止)を指示しないで停止してしまう仕様となっており、メモリデバイスの側もこうした状況に対応する機能を備えていない場合、ビジー信号によって待機させられている他のプロセスは、待機を続けた末にタイムアウトで停止してしまう。
【0016】
本発明は上記課題に鑑み、制御用フラグが設けられる共有メモリに対してハードウェアによる排他制御を行わず、その結果プロセスが読み出した制御用フラグの値が不定となっても、プロセスを正しく動作させることのできる共有メモリアクセス管理装置を提供することを目的とする。
【0017】
【課題を解決するための手段】
本発明の共有メモリアクセス管理装置は、上記の目的を達成するために、デュアルポート型メモリを共有する複数のプロセスが前記メモリを用いながら協同して処理を行う環境において、各プロセスが、自プロセスの前記メモリへのアクセスを管理するために備える共有メモリアクセス管理装置であって、前記メモリには、複数ビットから成って、前記複数のプロセスが協同して行う処理の進行に従って値が更新される制御情報が含まれており、共有メモリアクセス管理装置は、前記制御情報の値を検出する検出手段と、前記制御情報の値を更新する更新手段と、前記検出手段が検出する制御情報の値が他プロセスによって更新されて所定の値に変化するまで前記検出手段に前記制御情報の値を検出する動作を繰り返させ、前記検出手段が検出した値が前記所定の値に変化すると、自プロセスに指示して前記処理に関わる動作を行わせ、前記自プロセスによる動作が完了すると前記更新手段に指示して前記制御情報のうち前記動作に関わる1のビットを更新させる指示手段、とから成ることを特徴とする。
【0018】
これにより、制御用情報を更新する際には一度に1ビットしか更新せず、制御情報の読み出しを行う際には、制御用情報の値が所定値になる(更新される)までは制御用情報の読み出しだけを行うので、アクセスの衝突によって読み出された制御用情報の値が不定となる場合でも、制御用情報の値は、正しい更新後の値または更新前の値のいずれかに認識される。正しく更新後の値として検出した場合はもちろん問題はなく、更新前の値として検出した場合でも、制御情報の参照をもう一度実行し、この参照では正しく更新後の値として認識するので、やはり問題は発生しない。よって、共有メモリの制御用情報に対してはハードウェアによる排他制御を行わなくとも、アクセスの衝突が原因でプロセスが誤動作することを防止できる。
【0019】
【発明の実施の形態】
次に、本発明の共有メモリアクセス管理装置に関する実施の形態について図面を参照しながら説明する。本実施の形態における共有メモリは、データエリアと制御用フラグエリアとに分かれ、2つのプロセスの間のデータ受け渡しおよび制御情報の設定/参照のために用いられる。
【0020】
図1は、本実施の形態において、2つのプロセスが共有メモリを用いて行う処理の内容を示す模式図である。プロセスAは、転送対象のデータを生成してプロセスBに渡し、プロセスBはこのデータを加工した上でデータ転送先に出力するというデータ転送処理である。ただし、プロセスBがデータを転送先に出力するタイミングは、プロセスAが、上位プロセス(図外)の指示を受けて決定し、プロセスBに指示する。
【0021】
そして、転送データおよび出力タイミング指示は、両プロセス間で共有メモリ10を介してやりとりされる。転送データは共有メモリ内のデータエリア12に、出力タイミング指示は制御用フラグエリア12に、それぞれ書き込まれる。制御用フラグエリア11には、両プロセスがそれぞれの処理の進行状況を相手側に伝えるためのフラグが設けられており、前記出力タイミングもこうしたフラグで指示される。
【0022】
プロセスA、Bとも、その動作の内容から管理部とデータ処理部とに分けられる。
プロセスA側のデータ処理部A1は、転送すべきデータの生成・書き込み、出力タイミング決定、そして、転送終了後の共有メモリ12の初期化を行う。
プロセスB側のデータ処理部B1は、転送データの読み出し、データの加工、データの転送を行う。
【0023】
プロセスA側の管理部A2およびプロセスB側の管理部B2は、それぞれが処理の進行に応じて制御用フラグエリア11内のフラグの更新/参照を行う。
このデータ転送処理は、以下の4段階に分けることができる。
・第1段階:プロセスAによる共有メモリ12へのデータ書き込みが終るまで。
・第2段階:プロセスAによるデータ書き込みが終ってからプロセスAがデータ転送開始をプロセスBに指示するまで。
・第3段階:プロセスBがデータ転送を終えるまで。
・第4段階:プロセスAが後処理を終える(共有メモリ12を初期状態に戻す)まで。
【0024】
図2は、共有メモリ10の構成を示す模式図である。
共有メモリ10は、制御用フラグエリア11とデータエリア12とから成り、そのハードウェアとしての実体は、デュアルポート型のメモリデバイスである。
データエリア12には、転送対象データが書き込まれる。書き込みを行うのは書き込み側プロセスAであり、読み出し側プロセスBが読み出す。
【0025】
制御用フラグエリア11は、各プロセスの動作の内容やタイミングを制御するためのフラグが設けられるエリアであり、ここでは2種類のフラグから成る。
これら2種類のフラグは、1つが「有効フラグ111」であり、もう1つが「変化フラグ112」である。
有効フラグ111は、プロセスAがプロセスBに対して、データエリア12内のデータの読み出しおよび転送先への転送のタイミングを指示するためのものである。設定はON設定、OFF設定ともプロセスAが行う。プロセスAは、上位プロセスからの指示をもとにプロセスBにデータ転送を開始させるタイミングを決め、有効フラグ111をONに設定する。そして、書き込んだ転送データについてプロセスBが読み出し・転送が完了したのを検知すると、有効フラグ111をOFFに設定する。(読み出し完了の検知は変化フラグ112による。変化フラグ112の詳細は以下に述べる。)
変化フラグ112は、データエリア12における転送対象データの有無を示す。データ書き込み側のプロセスAが情報部へのデータ書き込みを完了した時点でプロセスAによってONに設定され、プロセスBが書き込まれた転送データを転送完了した時点で、プロセスBによってOFFに設定される。つまり、変化フラグ112は、データエリア12についてプロセスAによるデータ書き込みとプロセスBによるデータ読み出しとが衝突しないようにするための、データエリア12用の「排他制御」フラグである。
【0026】
プロセスAとプロセスBとは、いずれも、定期的に制御用フラグエリア11にアクセスして値を参照(ポーリング)する。そして、制御用フラグエリア11の値に応じて動作する。
上記2種類のフラグの組合わせによって、制御用フラグエリア11の値は以下の4パターンとなる。これらパターンは、上述した転送処理の4つの段階に対応して以下のように遷移する。
【0027】
00→ 01→ 11→ 10→ 00
遷移のいずれの段階においても、制御用フラグエリア11にある2ビットのフラグのうち、値が変わるのは1つのフラグのみである(一度に2つのフラグ両方の値が変わることがない)。こうした遷移の形を、「符号間距離が1」で遷移すると言う。これは、フラグの更新と参照とが衝突して制御用フラグエリア11の値が不定となる場合でも、不定となるのは1つのフラグ(ビット)のみであることを示す。
(転送処理シーケンス)
以下、データ転送処理の進行および処理の進行に応じてプロセスAとプロセスBが行う動作、そして処理の進行にともなう制御用フラグエリア11の状態遷移を、シーケンス図を参照しながら説明する。
【0028】
図3は、本実施の形態におけるデータ転送処理の進行と、それにともなう共有メモリ10の内容の変化とを示すシーケンス図である。
プロセスAとプロセスBとは、いずれも、定期的に共有メモリ10の制御用フラグエリア11をポーリングして制御用フラグエリア11の値を読み出し、読み出したフラグの値に応じて動作する。
【0029】
先ず、制御用フラグエリア11の値が「00」の状態であるが、これはプロセスAによるデータエリア12への転送データの書き込みが完了していない状態(書き込み開始前あるいは書き込み途中の状態)である。この状態においては、プロセスAは転送データのデータエリア12への書き込みを行い、プロセスBは制御用フラグエリア11へのポーリングのみ行っている。
【0030】
この状態で、プロセスAの側に転送データが発生する。すると、プロセスAは、ポーリングの結果、制御用フラグエリア11の値を「00」と検出したタイミング(図中▲1▼)で、データエリア12にアクセスして転送データ120の書き込みを開始する(図中▲2▼)。なお、制御用フラグエリア11の値が「00」以外の場合、プロセスAはデータエリア12へのアクセスは行わず、制御用フラグエリア11の値を「00」と検出するまでポーリングを繰り返す。
【0031】
そして、プロセスAは、データエリア12への転送データ120の書き込みを続け、書き込みが終了すると、変化フラグ112をON設定する(制御用フラグエリア11の値を「01」に変える(図中▲3▼))。
次いで、制御用フラグエリア11の値が「01」の状態であるが、これは、プロセスAによるデータエリア12への転送データの書き込みが完了しているが、プロセスBによる転送データの読み出し・転送開始のタイミングに達していない状態である。この状態においては、プロセスAはプロセスBによる転送データの読み出し・転送を認めるタイミングを測っており、プロセスBは制御用フラグエリア11へのポーリングのみ行っている。
【0032】
その後、プロセスAは、上位プロセスからの指示によってデータ転送開始のタイミングを測り、転送開始のタイミングに達したと判断すると、プロセスBに転送データ読み出し・転送を指示するために有効フラグ111をON設定する(制御用フラグエリア11の値を「11」に変える。図中▲4▼)。
そして、制御用フラグエリア11の値は「11」となるが、これは、プロセスBによる転送データの読み出し・転送が認められた状態である。この状態になるまで(上記の▲1▼〜▲4▼の間)、プロセスBは制御用フラグエリア11へのポーリングのみ行っているが、ポーリングの結果、制御用フラグエリア11の値が「11」になっているのを検出すると(図中▲5▼)、プロセスBはデータエリア12にアクセスして転送データ120を読み出し、加工した上で転送先プロセス(図1参照)に転送する(図中▲6▼)。一方、プロセスAは、制御用フラグエリア11へのポーリングのみ行っている。
【0033】
プロセスBは、転送データ120の読み出し・転送を完了すると、変化フラグ112をOFF設定する(制御用フラグエリア11の値を「10」に変える。図中▲7▼)。
そして、制御用フラグエリア11の値は「10」となるが、これは、プロセスBによるデータエリア12からの転送データの読み出し・転送が終了した状態である。
【0034】
これに対し、プロセスAは、ポーリングで制御用フラグエリア11の値を「10」と検出すると(図中▲8▼)、プロセスBによるデータ転送が完了したことを認識して、データエリア12を初期化したうえで、制御用フラグエリア11の値を初期値である「00」に戻す(有効フラグ111をOFF設定する(図中▲9▼))。これによって、一連のデータ転送処理は完了する。なお、この状態においては、プロセスBは制御用フラグエリア11へのポーリングのみ行っている。
【0035】
このように、制御用フラグエリア11の状態に応じて上記の順序で両プロセスが動作し、データ転送処理が行われる。
(プロセスの動作)
次に、本実施の形態のデータ転送処理におけるプロセスA、B各々の動作について、管理部A2、B2を中心に図面を参照しながら説明する。
【0036】
図4は、プロセスAの動作を示すフローチャートである。
先ず、プロセスAの起動に合わせて、管理部A2は制御用フラグエリア11へのポーリングを開始し、制御用フラグエリア11の値を「00」と検出するまでポーリングを繰り返す(S401:Yes)。そして、データ処理部A1に指示して転送用データの生成とデータエリア12への書き込みを行わせ(S402)、データ処理部A1からの書き込み完了の通知を待って(S403:Yes)、変化フラグ112をON設定(「00」→「01」)する(S404)。
【0037】
次いで、管理部A2は、データ処理部A1からの出力タイミング決定の通知を待って(S405:Yes)、有効フラグ111をON設定(「01」→「11」)する(S406)。
その後、管理部A2は制御用フラグエリア11のポーリングを再開し、その値を「10」と検出すまで繰り返す(S407)。そして。「10」と検出すると、データ処理部A1に指示してデータエリア12の初期化を行わせ(S408)、データ処理部A1からの初期化完了の通知を待って(S409:Yes)、有効フラグ111をOFF設定(「10」→「00」)する(S410)。
【0038】
図5は、プロセスBの動作を示すフローチャートである。
先ず、プロセスBの起動に合わせて、管理部B2は制御用フラグエリア11へのポーリングを開始し、制御用フラグエリア11の値を「11」と検出するまでポーリングを繰り返す(S501:Yes)。そして、データ処理部B1に指示して、転送用データのデータエリア12からの読み出し、加工、転送先への転送という一連の処理を行わせ(S502)、データ処理部B1から転送まで完了の通知を待って(S503:Yes)、変化フラグ112をOFF設定(「11」→「10」)する(S504)。
【0039】
プロセスA、Bは上記の動作を行うことでデータ転送処理を実現するが、ここでは、両プロセスの共有メモリ10へのアクセスについて、ハードウェアのビジー信号などによる排他制御は行っていない。そのため、制御用フラグエリア11の更新と参照(ポーリング)とが衝突して、参照された値が不定となる事態が生じる。上記データ転送処理が正しく行われるには、制御用ビット部12の更新と参照とが衝突して参照された制御用ビットの値が不定となっても、それが原因でデータ転送処理の手順が狂ってしまう(例えば、プロセスAによるデータの書き込みが終っていない時点でプロセスBによるデータ読み出しが始まってしまう)などの誤動作が発生しないことが前提条件となる。
(動作の検証)
本実施例においては、処理の進行状況に沿って制御用フラグエリア11の値が「符号間距離=1」で遷移するように、処理の進行状況と制御用フラグエリア11の値とを対応づけることで、参照された制御用ビットの値が不定となっても誤動作が発生しないようにしている。
【0040】
以下、制御用フラグエリア11の値が更新されるタイミングごとに、フラグ更新とフラグ参照とが衝突した場合の両プロセスの動作を検証し、参照された制御用フラグエリア11の値が不定となっても誤動作が発生しないことを確認する。制御用フラグエリア11の値の更新は4ヵ所で行われるので、順次検証していく。
(1)「00」→「01」のタイミング
図6は、プロセスAが、データエリア12への転送データ書き込み開始時点で変化フラグ112をON設定する際に(図3の▲2▼)、プロセスBのポーリングによる制御用フラグエリア11の参照が衝突した場合を示す。
【0041】
この場合、制御用フラグエリア11のうち更新対象の変化フラグ112の値のみが不定になるので、プロセスBは、制御用フラグエリア11の値を「00」または「01」と認識する。
プロセスBは、有効フラグ111がONとなっている場合に限ってデータエリア12へのアクセスが可能なので、上記いずれのパターンに読み取っても、プロセスBは制御用フラグエリア11へのポーリングを繰り返すのみである。よって、誤動作は発生しない。
【0042】
(2)「01」→「11」のタイミング
図7は、プロセスAが、データエリア12への転送データ書き込みを完了した時点で有効フラグ111をON設定する際に、プロセスBによる制御用フラグエリア11の参照が衝突した場合を示す。
【0043】
この場合、制御用フラグエリア11のうち更新対象の有効フラグ111の値のみが不定になるので、プロセスBは、制御用フラグエリア11の値を「01」または「11」と認識する。
「11」と認識した場合、有効フラグ111がONなので、プロセスBは手順通りにデータエリア12にアクセスしてデータの読み出し・転送を開始する。この時点では、実際に転送データのデータエリア12への書き込みは完了しているので、転送データを正しく読み出すことができ、誤動作は発生しない。
【0044】
逆に「01」と認識した場合、プロセスBはアクセス衝突の前の状態に戻るが、有効フラグ111がOFFなので、その後も一定の時間間隔で制御用フラグエリア11の参照を繰り返す。次回のポーリングでは、制御用フラグエリア11の値はもはや不定ではなく、プロセスBは、制御用フラグエリア11の値を正しく「11」と読み出して、手順通りに転送データの読み出し・転送を開始することになり、誤動作は発生しない。
【0045】
(3)「11」→「10」のタイミング
図8は、プロセスBが、データエリア12からの転送データ読み出しを完了した時点で変化フラグ112をOFF設定する際に、プロセスAのポーリングによる制御用フラグエリア11の参照処理が衝突した場合を示す。
【0046】
この場合、制御用フラグエリア11のうち更新対象の変化フラグ112の値のみが不定になるので、プロセスAは、制御用フラグエリア11の値を「11」または「10」と認識する。
「10」と認識した場合、変化フラグ112がOFFなので、プロセスAは、プロセスBによる転送データ読み出し・転送が完了したと判断して、共有メモリ10を初期化(データエリア11のクリアおよび有効フラグ111のOFF設定)を行い、データ転送処理を終了させる。この時点では、転送データの読み出し・転送は実際に完了しているので、共有メモリ10を初期化して処理を終了させても問題は発生しない。
【0047】
逆に「11」と認識した場合、プロセスAは、アクセス衝突の前の状態に戻り、プロセスBによる転送データ読み出し・転送が未だに完了していないものと判断して、その後もポーリングによる制御用フラグエリア11の参照を繰り返し、制御用フラグエリア11の値が「10」となるのを待ち続ける。次回のポーリングでは、制御用フラグエリア11の値はもはや不定ではなく、プロセスAは、制御用フラグエリア11の値を正しく「10」と認識して、手順通りに共有メモリ10の初期化を行うことになるので、誤動作は発生しない。
【0048】
(4)「10」→「00」のタイミング
図9は、プロセスBによるデータ読み出し・転送が終了したと判定したプロセスAが、有効フラグ111をOFF設定する際に、プロセスBによる制御用フラグエリア11の参照が衝突した場合を示す。
【0049】
この場合は、制御用フラグエリア11のうち更新対象の有効フラグ111の値のみが不定になり、プロセスBは、制御用フラグエリア11の値を「10」または「00」と認識する。
いずれの場合においても、プロセスBは、図3を参照しながらすでに説明した通り、制御用フラグエリア11へのポーリングのみ行うので、誤動作が発生することはない。
(まとめ)
このように、本実施の形態においては、アクセスの衝突によって参照された制御用フラグエリア11の値が不定となっても、それが誤動作につながることがないよう、両プロセス、特にその中の管理部A2、B2の動作が規定されているので、ハードウェアによる排他制御がなくてもデータ転送処理は正しく行われる。その規定の内容とその意味とについて、以下、図面を参照しながら説明する。
【0050】
図10は、本実施の形態における両プロセスの共有メモリ10へのアクセスの内容を、制御用フラグエリア11の遷移にそって表形式で示した図である。
図11は、本変形例における制御用フラグエリア11の状態遷移を示す図である。
これまでの説明と図10、11から分かるように、本実施の形態では、2つのプロセスが、共同してデータ転送処理を行う。両プロセスは、転送処理の4段階の進行状況に沿って制御用フラグエリア11の値も「符号間距離=1」で遷移させている。そのために、転送処理の進行から考えると必ずしも設ける必要のない「01」(データ書き込みのみ完了、読み出し・加工は許可せず)という状態を設けている。これによって、制御用フラグエリア11の値が「00」→「11」と更新されて2ビットの値が不定となることを防止しているのである。
【0051】
「符号間距離=1」で制御用フラグエリア11の値を遷移させる、という規則を設定したことで、一方のプロセスによる制御用フラグエリア11更新動作にもう一方のプロセスによる制御用フラグエリア11の参照が衝突した場合、1ビットの値しか不定にならない。そのため、参照側プロセスは制御用フラグエリア11の値を必ず2つのパターンのいずれかに認識することになる。1つは正しい値(フラグ更新側のプロセスが意図した通りの更新後の値)であり、もう1つはフラグ更新側のプロセスが更新を行う前の値である。
【0052】
しかるに、図10に示すように、各段階において制御用フラグエリア11の参照を行う側のプロセスは、制御用フラグエリア11の値を所定の値と検出するまで制御用フラグエリア11の参照(ポーリング)のみを行って、転送処理の進行に関わる動作は行わず、一方、制御用フラグエリア11の更新を行う側のプロセスは、転送処理の進行に関わる動作を完了した上で、制御用フラグエリア11の値を1ビットだけ更新するようになっている。
【0053】
その結果、正しい値に認識した場合は当然、参照側プロセスは手順通りにその後の動作を行う。一方、更新前の値に認識した場合、読み出し側プロセスは衝突が発生したフラグ参照動作を行う前の状態に戻ることになり、制御用フラグエリア11の参照を再び行う。そして次回の参照では、制御用フラグエリア11の値を正しく更新後の値に認識して手順通りに次の動作を行うことになる。
【0054】
誤動作とは、参照側のプロセスが制御用フラグの値を誤って認識した結果、フラグを更新した側のプロセスの意図と異なる動作を行ったり、手順と異なる動作を行ったりすることである。しかし、本実施の形態の場合、上記の通り、参照側プロセスがフラグを誤って更新前の値に認識しても、フラグ参照動作(ポーリング)を1回多く行うだけで、最終的にはフラグ更新側プロセスの意図を正しく認識して手順通りの動作を行うので、誤動作は発生しないのである。
【0055】
なお、本実施の形態においては、更に、共有メモリ10の中には、制御情報以外の情報を設定するためのエリア(データエリア12)も存在するが、このエリアについては一部の制御用フラグ(変化フラグ112)によって誤動作の原因となるアクセスの衝突を防止している。つまり、共有メモリ10のうちデータエリア12については制御用フラグエリア11に設定した情報でアクセスの衝突を防止し、制御用フラグエリア11の値については、上記の通り、アクセスが衝突して読み出した値が不定となっても誤動作が発生しないようにしてある。
【0056】
これは、本実施の形態によれば、共有メモリ内に制御用フラグエリアしか存在しない場合はもちろん、制御用フラグ以外の情報が設定されるエリアと混在する場合にも、共有メモリへのハードウェアによる排他制御なしで、誤動作なく処理を実行することができる、ということを示している。
また、本実施の形態では、制御情報に含まれる個々のビットをフラグとして使用することとなっているが、制御情報をフラグの集まりとしてでなく、複数ビットのビットパターンとして参照する場合でも、処理の進行に伴うビットパターンの遷移が、「符号間距離=1」という規則に従ってさえいれば、本実施の形態と同様の効果を得ることが可能である。
【0057】
また、上記実施の形態における制御用フラグエリアは2ビットであったが、本発明は3ビット以上の制御用フラグエリアを用いる場合にも適用できる。例えば、上記実施の形態において「データ転送」実施タイミングの指示である有効フラグ111を、「加工パターンAまたは加工パターンBで加工の上転送させる」指示である転送指示ビット列(2ビット、01:パターンAで加工・転送、10:パターンBで加工・転送)に置き換えた場合を考えてみる。
【0058】
本変形例におけるデータ転送処理の流れを制御用フラグエリアの値の変化とともに説明する。実施の形態と同じ部分については説明を省略する。
▲1▼ 000: プロセスAによるデータエリア12への転送データの書き込みが完了していない状態であることを示す。実施の形態における「00」(図3参照)と同じ。
▲2▼ 001: プロセスAによるデータエリア12への転送データの書き込みが完了しているが、プロセスBによる転送データの読み出し・転送は認められない状態であることを示す。実施の形態における「01」(図3参照)と同じ。
▲3▼ 011または101: プロセスBによる転送データの読み出し・転送が認められた状態。実施の形態における「11」(図3参照)に対応する。プロセスBは、転送データを読み出して、「011」の場合はパターンAで、「101」の場合はパターンBで加工して転送先へ転送する。
▲4▼ 010または100: プロセスBによるデータエリア12からの転送データの読み出し・転送が終了した状態。実施の形態における「10」(図3参照)に対応する。ここからプロセスAが共有メモリを初期化して、▲1▼に戻る。
【0059】
図12は、本変形例における制御用フラグエリアの状態遷移を示す図である。
同図に示すように、本変形例においても制御用フラグエリアの値は、▲1▼「000」→▲2▼「001」→▲3▼「101」→▲4▼「100」→▲1▼「000」または、▲1▼「000」→▲2▼「001」→▲3▼「011」→▲4▼「010」→▲1▼「000」と、符号間距離「1」で遷移する。また、制御用フラグエリア11の参照を行う側のプロセスは、制御用フラグエリアの値を所定の値と検出するまで制御用フラグエリアの参照のみを行って、作業の進行に関わる動作は行わない点は上記実施の形態と同じである。よって、実施の形態で述べた通り、共有メモリへの排他制御を行わなくとも誤動作は発生しない。
【0060】
なお、上記の実施の形態および変形例においては、複数プロセスが行う処理としてデータ転送処理を取り上げて説明したが、これは一例として挙げたもので、本発明の範囲をデータ転送処理に限定するものではない。例えば、あるプロセスが他のプロセスに対してデータを渡し、そのデータに何らかの加工をさせた上で返させる、といった処理も考えられる。この場合、制御用情報は加工前後のデータ受け渡しのタイミングや、加工の種類などを指示するのに使われる。しかし、処理内容がどのようなものであっても、その進行を「符号間距離=1」で遷移する制御用情報と対応づけて管理することのできる内容であれば適用可能である。
【0061】
【発明の効果】
以上説明したように、本発明の共有メモリアクセス管理装置は、デュアルポート型メモリを共有する複数のプロセスが前記メモリを用いながら協同して処理を行う環境において、各プロセスが、自プロセスの前記メモリへのアクセスを管理するために備える共有メモリアクセス管理装置であって、前記メモリには、複数ビットから成って、前記複数のプロセスが協同して行う処理の進行に従って値が更新される制御情報が含まれており、共有メモリアクセス管理装置は、前記制御情報の値を検出する検出手段と、前記制御情報の値を更新する更新手段と、前記検出手段が検出する制御情報の値が他プロセスによって更新されて所定の値に変化するまで前記検出手段に前記制御情報の値を検出する動作を繰り返させ、前記検出手段が検出した値が前記所定の値に変化すると、自プロセスに指示して前記処理に関わる動作を行わせ、前記自プロセスによる動作が完了すると前記更新手段に指示して前記制御情報のうち前記動作に関わる1のビットを更新させる指示手段とから成る、という特徴を有するので、共有メモリ内の複数ビットから成る制御用情報については、ハードウェアによる排他制御を行わなくとも、制御用情報を用いて前記複数のプロセスが実行する処理に誤動作が発生することはない。
【0062】
さらに、前記共有メモリは、前記複数のプロセスが前記制御情報以外のデータを受け渡しするために用いるデータ部を含み、前記制御情報は、前記データ部に対する排他制御のための排他制御用フラグを1以上含み、前記複数のプロセスが協同して行う処理は、前記データ部を介して行われるデータの受け渡しであり、前記指示手段は、前記検知手段が検知した前記排他制御用フラグの値に基づいて、前記データの受け渡しに関する動作を前記プロセスに行わせ、前記動作が完了すると、前記更新手段に指示して前記排他制御用フラグ1ビットを更新させる、とすることもできる。これにより、共有メモリに制御用情報とそれ以外のデータを格納するエリアとが混在する場合は、制御用情報以外のデータを格納するエリアについては制御用情報の一部として設定される排他制御用情報によって排他制御を実現し、制御用情報を設定するエリアについては、排他制御なしでも誤動作が発生することはないので、共有メモリ全体についてもハードウェアによる排他制御を行う必要はなく、それによって前記複数のプロセスが実行する処理に誤動作が発生することもない。
【0063】
なお、上記の効果を確実に得るために、前記指示手段が前記自プロセスに行わせた動作が完了した後に前記制御情報の複数ビットを反転させる場合、前記複数のビットの各々について、順次前記更新手段に指示して反転させること、としてもよい。
そして、デュアルポート型メモリを共有する複数のプロセスが前記メモリを用いてデータ通信を行うデータ通信方法であって、前記メモリには、データ通信の進行に従って前記複数のプロセスによって値が更新される複数ビットから成るフラグが含まれ、前記データ通信方法は、一のプロセスが前記メモリにデータを書き込む書き込みステップと、前記書き込みステップを終えた前記一のプロセスが、前記フラグに含まれる一のビットを反転させる第1の反転ステップと、前記第1の反転ステップを終えた前記一のプロセスが、前記フラグに含まれる他の一のビットを反転させる第2の反転ステップと、他の一のプロセスが、前記一のビットおよび前記他の一のビットの反転を検知する検知ステップと、前記検知ステップを終えた前記他の一のプロセスが、前記メモリに書き込まれたデータを読み出す読み出しステップとを含むことを特徴とするデータ通信方法とすれば、ハードウェアによる共有メモリへの排他制御を行わなくとも、誤動作なくデータ通信を実行できる
【図面の簡単な説明】
【図1】本発明に関わる共有メモリアクセス管理装置の実施の形態において、複数プロセスが共有メモリを用いて行う転送処理の概要を示す模式図である。
【図2】同実施の形態における共有メモリの構成を示す図である。
【図3】同実施の形態における転送処理の進行とそれに伴なう共有メモリの内容の遷移とを示す模式図である。
【図4】同実施の形態におけるプロセスAの動作を示すフローチャートである。
【図5】同実施の形態におけるプロセスBの動作を示すフローチャートである。
【図6】同実施の形態における制御用フラグエリアへのアクセスの衝突の結果を示す模式図である。
【図7】同実施の形態における制御用フラグエリアへのアクセスの衝突の結果を示す模式図である。
【図8】同実施の形態における制御用フラグエリアへのアクセスの衝突の結果を示す模式図である。
【図9】同実施の形態における制御用フラグエリアへのアクセスの衝突の結果を示す模式図である。
【図10】同実施の形態における制御用フラグエリアの値と複数プロセスによる共有メモリアクセスの内容との関係を表形式で示す図である。
【図11】同実施の形態における制御用フラグエリアの値の遷移を示す状態遷移図である。
【図12】同実施の形態の変形例における制御用フラグエリアの値の遷移を示す状態遷移図である。
【符号の説明】
1 共有メモリ
11 制御用フラグエリア
111 有効フラグ
112 変化フラグ
12 データエリア
120 データ
A、B プロセス
A1、B1 データ処理部
A2、B2 管理部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a shared memory access management apparatus that controls access to a shared memory shared by a plurality of processes.
[0002]
[Prior art]
Conventionally, when a plurality of processes being executed in parallel on a computer cooperate to perform some processing, information necessary for executing the processing is exchanged via a shared memory.
For example, when the process A passes data to the process B, the process A writes the data in the shared memory, and then the process B reads the data. However, in order for this procedure to proceed correctly, it is necessary for each process to control the other party's operation according to the progress of its own processing. The process A needs to notify the process B of the completion of the data writing, and if the process B side does not notify the process A of the completion of the data reading, new data to the shared memory by the process A thereafter Cannot write.
[0003]
A flag is used to perform such control. In the above example, the process A starts writing data from a state where the flag is OFF, and sets the flag to ON when the writing is completed. The process B does not access the shared memory while the flag is OFF, starts reading data from the shared memory when the flag is ON, and sets the flag to OFF when the reading is completed. Then, the process A can recognize that the next data can be written.
[0004]
Since such a flag is set / referenced by a plurality of processes as in the above example, it is also provided in the shared memory. That is, when a plurality of processes perform processing while exchanging data using a shared memory, the shared memory controls an area for writing / reading data (hereinafter referred to as “data area”) and the progress of the process. Area for which a flag is provided (hereinafter referred to as “control flag area”).
[0005]
Processes A and B operate according to their values while periodically referring to the control flag area (hereinafter referred to as “polling”).
However, if the shared memory is a dual port type having a plurality of ports that accept access from the process, in order to guarantee the correct operation of the process for processing using the shared memory, access from multiple processes (write : Data write and control flag update, read: data read and control flag reference) must be prevented from colliding. The collision means that a plurality of processes simultaneously access an area of the same address in the memory, and it does not occur unless it is a dual port type memory.
[0006]
The following pattern occurs when process access to shared memory conflicts:
Pattern 1: write and write (data write or flag update) collide. A state in which multiple processes attempt to write or update at the same location in the memory at the same time. The memory cell may be destroyed.
Pattern 2: write and read (data writing and reading or flag update and reference) collide. The content read by the process on the Read side may become indefinite, and the result of the operation performed based on the read content may be invalid.
[0007]
In the case of the above example, the pattern 1 does not occur in the data area and the control flag area from the contents of the operation procedures of the processes A and B. Pattern 2 does not occur as far as the data area is concerned, unless there is an error in the result of reading the control flag. However, the occurrence of pattern 2 cannot be prevented for the control flag area. If the update of the flag and the reference collide and the content of the flag becomes indefinite, the read flag can be recognized as either “0” or “1”.
[0008]
If the value of the read control flag becomes undefined as a result of the occurrence of pattern 2, the process may malfunction. An example of malfunction is given below.
The process A causes the process B to process the data after passing the data through the data area. Consider a process in which there are two processing patterns, and process A indicates one of them by a flag. In the control flag area, a flag indicating a machining pattern is provided in addition to the above-described flag indicating completion of data writing.
[0009]
The value of the control flag area and the operation of both processes according to the value are shown below. The upper 1 bit is a flag indicating a processing pattern (0: first processing pattern, 1: second processing pattern), and the lower 1 bit is a flag indicating completion of data writing.
(1) 00: Process A is writing data to the data area.
(2) 01: Process A completes data writing. Process B reads the data and processes it with the first processing pattern.
(3) 11: Process A completes data writing. Process B reads the data and processes it with the second processing pattern.
[0010]
Here, when the process A completes the data writing to the data area, the process A rewrites the value of the control bit area with 2 bits in order to instruct the process B to process the data with the second processing pattern. Change from “00” to “11”. When the control bit area is referred to by the process B at the moment of the change, both of the updated 2-bit flags are undefined. Therefore, the process B can recognize the value of the bit string as any of “00”, “01”, “10”, and “11”.
[0011]
Of course, there is no problem when correctly reading “11”, and when reading “00”, the process B repeats polling, and the value is correctly recognized as “11” at the next reference, so there is no problem. However, if it is determined as “01”, the process B performs a malfunction of data processing in the first processing process. Furthermore, if the pattern is recognized as “10”, it may be determined that an abnormal situation has occurred and the process may be stopped.
[0012]
Although not applicable to the above example, if a situation occurs in which write access to the data area collides due to misreading of the value of the control flag, serious consequences such as destruction of data in the data area will occur. It is also possible.
In order to surely prevent such a malfunction, it is only necessary to prevent an access conflict that may cause a malfunction, and the means for that is exclusive control over the shared memory.
[0013]
A typical exclusive control method is a semaphore management method that allows access to only one process using a signal. As a specific method thereof, there is a method using hardware, and as a general example of exclusive control by hardware, there is a method in which a memory device as an entity of shared memory generates an exclusive control signal. . A memory device generates a busy signal while one process is accessing the memory, limiting access to the memory by other processes. The busy signal is transmitted to the process via a WAIT signal line of a device (CPU or the like) that is the subject of the process execution, and the process does not access the shared memory while the busy signal is input from the WAIT signal line. Therefore, access conflicts that cause malfunctions do not occur.
[0014]
Although there is a method of using a control flag for exclusive control of the shared memory, the control flag itself is provided in the shared memory, and access conflict cannot be reliably eliminated for the flag. Hardware must be used as a means for reliable exclusive control.
[0015]
[Problems to be solved by the invention]
However, for exclusive control by hardware, a memory device that generates a busy signal is required as dedicated hardware, and the device that performs the process is equipped with a function that supports exclusive control by such a busy signal. If not, exclusive control cannot be realized unless a circuit for exclusive control is separately provided outside the device. An abnormal situation may also occur depending on the specifications related to exclusive control of devices to be combined. For example, when a process execution device stops a process that is executing access, it is a specification that stops without instructing the memory to release exclusive control (stop the busy signal). If the function corresponding to the situation is not provided, other processes that are kept waiting by the busy signal will stop due to timeout after continuing the waiting.
[0016]
In view of the above problems, the present invention does not perform exclusive control by hardware for the shared memory provided with the control flag, and as a result, even if the value of the control flag read by the process becomes indefinite, the process operates correctly. An object of the present invention is to provide a shared memory access management device that can be made to operate.
[0017]
[Means for Solving the Problems]
In order to achieve the above object, the shared memory access management device of the present invention is configured such that each process is a self-process in an environment in which a plurality of processes sharing a dual-port memory perform processing in cooperation using the memory. A shared memory access management device provided for managing access to the memory, wherein the memory is composed of a plurality of bits, and a value is updated in accordance with a progress of processing performed in cooperation with the plurality of processes. Control information is included, and the shared memory access management device includes: a detection unit that detects a value of the control information; an update unit that updates the value of the control information; and a value of the control information detected by the detection unit. The detection means repeats the operation of detecting the value of the control information until it is updated by another process and changes to a predetermined value. When the processed value changes to the predetermined value, the process is instructed to perform an operation related to the process, and when the operation by the process is completed, the update unit is instructed to relate to the operation of the control information. And instructing means for updating one bit.
[0018]
As a result, when updating the control information, only one bit is updated at a time, and when the control information is read, the control information is used until the value of the control information reaches a predetermined value (updated). Since only the information is read out, the control information value is recognized as either the correct updated value or the pre-update value even if the control information value read due to an access conflict becomes indefinite. Is done. Of course, there is no problem if it is correctly detected as a value after update. Even if it is detected as a value before update, the control information reference is executed again, and this reference is recognized as the value after update correctly. Does not occur. Therefore, it is possible to prevent the process from malfunctioning due to an access conflict without performing hardware exclusive control on the shared memory control information.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
Next, an embodiment of the shared memory access management apparatus of the present invention will be described with reference to the drawings. The shared memory in the present embodiment is divided into a data area and a control flag area, and is used for data transfer between two processes and setting / referencing of control information.
[0020]
FIG. 1 is a schematic diagram showing the contents of processing performed by two processes using a shared memory in the present embodiment. The process A is a data transfer process in which data to be transferred is generated and passed to the process B, and the process B processes this data and outputs it to the data transfer destination. However, the timing at which the process B outputs the data to the transfer destination is determined by the process A in response to an instruction from a higher-level process (not shown), and the process B is instructed.
[0021]
The transfer data and the output timing instruction are exchanged between the two processes via the shared memory 10. The transfer data is written in the data area 12 in the shared memory, and the output timing instruction is written in the control flag area 12. The control flag area 11 is provided with a flag for both processes to inform the other party of the progress of each process, and the output timing is also indicated by such a flag.
[0022]
Both processes A and B are divided into a management unit and a data processing unit based on the contents of the operation.
The data processing unit A1 on the process A side generates and writes data to be transferred, determines an output timing, and initializes the shared memory 12 after the transfer is completed.
The data processing unit B1 on the process B side reads transfer data, processes data, and transfers data.
[0023]
Each of the management unit A2 on the process A side and the management unit B2 on the process B side updates / references the flag in the control flag area 11 as the processing proceeds.
This data transfer process can be divided into the following four stages.
First stage: Until data writing to the shared memory 12 by the process A is completed.
Second stage: From the end of data writing by the process A until the process A instructs the process B to start data transfer.
Third stage: Until process B finishes data transfer.
Fourth stage: Until the process A finishes the post-processing (returns the shared memory 12 to the initial state).
[0024]
FIG. 2 is a schematic diagram showing the configuration of the shared memory 10.
The shared memory 10 includes a control flag area 11 and a data area 12, and the actual hardware is a dual port type memory device.
Data to be transferred is written in the data area 12. Writing is performed by the writing process A, and reading by the reading process B.
[0025]
The control flag area 11 is an area in which flags for controlling the content and timing of the operation of each process are provided, and here, it is composed of two types of flags.
Of these two types of flags, one is the “valid flag 111” and the other is the “change flag 112”.
The valid flag 111 is used by the process A to instruct the process B to read data in the data area 12 and transfer it to the transfer destination. Setting is performed by the process A for both ON setting and OFF setting. The process A determines the timing at which the process B starts data transfer based on an instruction from the host process, and sets the valid flag 111 to ON. When the process B detects that the written transfer data has been read / transferred, the valid flag 111 is set to OFF. (Detection of completion of reading is performed by the change flag 112. Details of the change flag 112 will be described below.)
The change flag 112 indicates the presence / absence of transfer target data in the data area 12. It is set ON by the process A when the process A on the data writing side completes the data writing to the information part, and is set OFF by the process B when the transfer data written by the process B is completed. In other words, the change flag 112 is an “exclusive control” flag for the data area 12 so that the data writing by the process A and the data reading by the process B do not collide with each other in the data area 12.
[0026]
Both the process A and the process B periodically access the control flag area 11 and refer to the value (polling). Then, it operates according to the value of the control flag area 11.
By the combination of the above two types of flags, the value of the control flag area 11 becomes the following four patterns. These patterns change as follows corresponding to the four stages of the transfer process described above.
[0027]
00 → 01 → 11 → 10 → 00
At any stage of the transition, of the 2-bit flags in the control flag area 11, only one flag changes (the values of both of the two flags do not change at the same time). Such a transition is said to transition when the intersymbol distance is 1. This indicates that only one flag (bit) is indeterminate even when the flag update and reference collide and the value of the control flag area 11 becomes indefinite.
(Transfer processing sequence)
Hereinafter, the progress of the data transfer process, the operation performed by the process A and the process B according to the progress of the process, and the state transition of the control flag area 11 accompanying the progress of the process will be described with reference to the sequence diagram.
[0028]
FIG. 3 is a sequence diagram showing the progress of the data transfer process and the change in the contents of the shared memory 10 accompanying this.
Both process A and process B periodically poll the control flag area 11 of the shared memory 10 to read the value of the control flag area 11 and operate according to the read flag value.
[0029]
First, although the value of the control flag area 11 is “00”, this is a state in which writing of transfer data to the data area 12 by the process A has not been completed (before starting writing or in the middle of writing). is there. In this state, the process A writes the transfer data to the data area 12 and the process B only polls the control flag area 11.
[0030]
In this state, transfer data is generated on the process A side. Then, as a result of polling, the process A accesses the data area 12 and starts writing the transfer data 120 at the timing when the value of the control flag area 11 is detected as “00” ((1) in the figure) ( (2) in the figure). If the value of the control flag area 11 is other than “00”, the process A does not access the data area 12 and repeats polling until the value of the control flag area 11 is detected as “00”.
[0031]
Then, the process A continues to write the transfer data 120 to the data area 12, and when the writing is completed, the change flag 112 is set to ON (the value of the control flag area 11 is changed to “01” ((3) in the figure)). ▼)).
Next, the value of the control flag area 11 is “01”. This is because the transfer data is written to the data area 12 by the process A, but the transfer data is read / transferred by the process B. The start timing has not been reached. In this state, the process A measures the timing for allowing the process B to read and transfer the transfer data, and the process B only polls the control flag area 11.
[0032]
Thereafter, the process A measures the data transfer start timing in accordance with an instruction from the upper process, and if it determines that the transfer start timing has been reached, the process A sets the valid flag 111 ON to instruct the process B to read / transfer the transfer data. (The value in the control flag area 11 is changed to “11” (4) in the figure).
Then, the value of the control flag area 11 is “11”, which is a state in which reading / transfer of transfer data by the process B is permitted. Until this state is reached (between (1) to (4) above), the process B is only polling the control flag area 11, but as a result of polling, the value of the control flag area 11 is "11". Is detected (<5> in the figure), the process B accesses the data area 12, reads the transfer data 120, processes it, and transfers it to the transfer destination process (see FIG. 1) (see FIG. 1). Middle (6)). On the other hand, the process A performs only polling to the control flag area 11.
[0033]
When the process B completes reading / transfer of the transfer data 120, the change flag 112 is set to OFF (the value of the control flag area 11 is changed to “10” (7) in the figure).
Then, the value of the control flag area 11 is “10”, which is a state in which reading / transfer of the transfer data from the data area 12 by the process B is completed.
[0034]
On the other hand, when the value of the control flag area 11 is detected as “10” by polling ((8) in the figure), the process A recognizes that the data transfer by the process B is completed, and sets the data area 12 After initialization, the value of the control flag area 11 is returned to the initial value “00” (the valid flag 111 is set to OFF ((9) in the figure)). Thereby, a series of data transfer processing is completed. In this state, the process B is only polling the control flag area 11.
[0035]
In this way, both processes operate in the above order according to the state of the control flag area 11, and data transfer processing is performed.
(Process behavior)
Next, the operation of each of the processes A and B in the data transfer processing according to the present embodiment will be described with reference to the drawings centering on the management units A2 and B2.
[0036]
FIG. 4 is a flowchart showing the operation of the process A.
First, in accordance with the activation of the process A, the management unit A2 starts polling to the control flag area 11, and repeats the polling until the value of the control flag area 11 is detected as “00” (S401: Yes). Then, the data processing unit A1 is instructed to generate transfer data and write it to the data area 12 (S402), wait for the writing completion notification from the data processing unit A1 (S403: Yes), and change flag 112 is set to ON (“00” → “01”) (S404).
[0037]
Next, the management unit A2 waits for an output timing determination notification from the data processing unit A1 (S405: Yes), and sets the valid flag 111 to ON ("01" → "11") (S406).
Thereafter, the management unit A2 restarts polling of the control flag area 11 and repeats until it detects “10” (S407). And then. When “10” is detected, the data processing unit A1 is instructed to initialize the data area 12 (S408), and a notification of completion of initialization from the data processing unit A1 is waited (S409: Yes). 111 is set to OFF (“10” → “00”) (S410).
[0038]
FIG. 5 is a flowchart showing the operation of the process B.
First, in accordance with the activation of the process B, the management unit B2 starts polling the control flag area 11, and repeats the polling until the value of the control flag area 11 is detected as “11” (S501: Yes). Then, the data processing unit B1 is instructed to perform a series of processes of reading transfer data from the data area 12, processing, and transfer to the transfer destination (S502), and notification of completion from the data processing unit B1 to the transfer is performed. (S503: Yes), the change flag 112 is set to OFF ("11" → "10") (S504).
[0039]
The processes A and B realize the data transfer process by performing the above operation, but here, the exclusive control by the hardware busy signal or the like is not performed for the access to the shared memory 10 of both processes. For this reason, the update of the control flag area 11 and the reference (polling) collide, resulting in a situation where the referenced value becomes indefinite. In order for the data transfer processing to be performed correctly, even if the control bit section 12 is updated and the reference conflicts and the value of the control bit referred to is indefinite, the data transfer processing procedure is caused by this. It is a precondition that there is no malfunction such as going wrong (for example, data reading by process B starts when data writing by process A is not finished).
(Verification of operation)
In the present embodiment, the process progress status and the value of the control flag area 11 are associated with each other so that the value of the control flag area 11 transitions at “inter-code distance = 1” according to the process progress status. Thus, even if the value of the referenced control bit becomes indefinite, no malfunction occurs.
[0040]
Hereinafter, at each timing when the value of the control flag area 11 is updated, the operations of both processes when the flag update and the flag reference collide are verified, and the value of the referenced control flag area 11 becomes indefinite. Confirm that no malfunction occurs. Since the value of the control flag area 11 is updated at four locations, the verification is sequentially performed.
(1) Timing from “00” to “01”
FIG. 6 shows that when the process A sets the change flag 112 to ON at the start of writing the transfer data to the data area 12 ((2) in FIG. 3), the control flag area 11 is referred to by polling of the process B. Indicates the case of a collision.
[0041]
In this case, since only the value of the change flag 112 to be updated in the control flag area 11 becomes indefinite, the process B recognizes the value of the control flag area 11 as “00” or “01”.
Since the process B can access the data area 12 only when the valid flag 111 is ON, the process B only repeats polling to the control flag area 11 regardless of which pattern is read. It is. Therefore, no malfunction occurs.
[0042]
(2) Timing from “01” to “11”
FIG. 7 shows a case where the reference of the control flag area 11 by the process B collides when the process A sets the valid flag 111 ON when the transfer data writing to the data area 12 is completed.
[0043]
In this case, since only the value of the valid flag 111 to be updated in the control flag area 11 is indefinite, the process B recognizes the value of the control flag area 11 as “01” or “11”.
When it is recognized as “11”, since the valid flag 111 is ON, the process B accesses the data area 12 according to the procedure and starts reading / transferring data. At this point, since the transfer data is actually written to the data area 12, the transfer data can be read correctly, and no malfunction occurs.
[0044]
On the contrary, when “01” is recognized, the process B returns to the state before the access collision, but since the valid flag 111 is OFF, the reference of the control flag area 11 is repeated after a certain time interval. At the next polling, the value of the control flag area 11 is no longer indefinite, and the process B correctly reads “11” as the value of the control flag area 11 and starts reading / transferring the transfer data according to the procedure. As a result, no malfunction occurs.
[0045]
(3) Timing from “11” to “10”
FIG. 8 shows a case where the reference process of the control flag area 11 by polling of the process A collides when the process B completes the reading of the transfer data from the data area 12 and sets the change flag 112 to OFF. .
[0046]
In this case, since only the value of the change flag 112 to be updated in the control flag area 11 is indefinite, the process A recognizes the value of the control flag area 11 as “11” or “10”.
If it is recognized as “10”, since the change flag 112 is OFF, the process A determines that the transfer data read / transfer by the process B is completed, and initializes the shared memory 10 (clear and valid flag of the data area 11). 111 is set to OFF), and the data transfer process is terminated. At this point, since the read / transfer of the transfer data has actually been completed, there is no problem even if the shared memory 10 is initialized and the process is terminated.
[0047]
Conversely, if it is recognized as “11”, the process A returns to the state before the access collision, determines that the transfer data read / transfer by the process B has not yet been completed, and thereafter the control flag by polling The reference of the area 11 is repeated, and the process waits until the value of the control flag area 11 becomes “10”. At the next polling, the value of the control flag area 11 is no longer indefinite, and the process A correctly recognizes the value of the control flag area 11 as “10” and initializes the shared memory 10 according to the procedure. Therefore, no malfunction occurs.
[0048]
(4) Timing from “10” to “00”
FIG. 9 illustrates a case where the process A, which has determined that the data read / transfer by the process B has been completed, collides with the reference to the control flag area 11 by the process B when the valid flag 111 is set to OFF.
[0049]
In this case, only the value of the valid flag 111 to be updated in the control flag area 11 becomes indefinite, and the process B recognizes the value of the control flag area 11 as “10” or “00”.
In any case, since the process B only polls the control flag area 11 as already described with reference to FIG. 3, no malfunction occurs.
(Summary)
As described above, in this embodiment, even if the value of the control flag area 11 referred to by the access conflict becomes indefinite, both processes, particularly the management in the processes, are prevented so as not to cause a malfunction. Since the operations of the units A2 and B2 are defined, the data transfer process is performed correctly even without exclusive control by hardware. The contents and meanings of the rules will be described below with reference to the drawings.
[0050]
FIG. 10 is a diagram showing the contents of access to the shared memory 10 of both processes in the present embodiment in a table format along the transition of the control flag area 11.
FIG. 11 is a diagram showing state transition of the control flag area 11 in the present modification.
As can be seen from the above description and FIGS. 10 and 11, in this embodiment, two processes jointly perform data transfer processing. In both processes, the value of the control flag area 11 is also changed at “inter-code distance = 1” in accordance with the progress of the transfer process in four stages. Therefore, a state of “01” (only data writing is completed, reading / processing is not permitted) which is not necessarily provided in view of the progress of the transfer process is provided. As a result, the value of the control flag area 11 is updated from “00” to “11” to prevent the 2-bit value from becoming indefinite.
[0051]
By setting the rule that the value of the control flag area 11 is changed when “inter-code distance = 1”, the control flag area 11 update operation by one process is changed to the control flag area 11 update operation by the other process. If the references collide, only the 1-bit value is undefined. For this reason, the reference process always recognizes the value of the control flag area 11 in one of two patterns. One is a correct value (value after update as intended by the flag update process), and the other is a value before the flag update process is updated.
[0052]
However, as shown in FIG. 10, the process on the side that refers to the control flag area 11 at each stage refers to the control flag area 11 (polling) until it detects the value of the control flag area 11 as a predetermined value. ) Only, and the operation related to the progress of the transfer process is not performed. On the other hand, the process on the side of updating the control flag area 11 completes the operation related to the progress of the transfer process, and then the control flag area The value of 11 is updated by 1 bit.
[0053]
As a result, when the correct value is recognized, the referencing process naturally performs the subsequent operations according to the procedure. On the other hand, when the value before the update is recognized, the reading side process returns to the state before the flag reference operation in which the collision has occurred, and the control flag area 11 is referred again. In the next reference, the value in the control flag area 11 is correctly recognized as the updated value, and the next operation is performed according to the procedure.
[0054]
The malfunction is that the process on the reference side erroneously recognizes the value of the control flag, and as a result, performs an operation different from the intention of the process that updated the flag, or performs an operation different from the procedure. However, in the case of the present embodiment, as described above, even if the referencing process mistakenly recognizes the flag as the pre-update value, the flag reference operation (polling) is performed only once. Since the intention of the updating process is correctly recognized and the operation is performed according to the procedure, no malfunction occurs.
[0055]
In the present embodiment, the shared memory 10 further includes an area (data area 12) for setting information other than the control information. However, some control flags are included in this area. (Change flag 112) prevents access conflicts that cause malfunctions. That is, for the data area 12 of the shared memory 10, the access conflict is prevented by the information set in the control flag area 11, and the value of the control flag area 11 is read as a result of the access conflict as described above. Even if the value becomes indefinite, no malfunction occurs.
[0056]
According to the present embodiment, the hardware to the shared memory can be used not only when there is only a control flag area in the shared memory but also when an area other than the control flag is set. This shows that the process can be executed without malfunction without the exclusive control.
In this embodiment, each bit included in the control information is used as a flag. However, even when the control information is referred to as a bit pattern of multiple bits instead of as a collection of flags, the processing is performed. As long as the transition of the bit pattern with the progress of the code follows the rule “distance between codes = 1”, it is possible to obtain the same effect as in the present embodiment.
[0057]
Further, although the control flag area in the above embodiment is 2 bits, the present invention can also be applied to the case where a control flag area of 3 bits or more is used. For example, in the above embodiment, the effective flag 111 that is an instruction of the “data transfer” execution timing is a transfer instruction bit string (2 bits, 01: pattern) that is an instruction to “transfer after processing with the processing pattern A or processing pattern B”. Consider the case where A is changed to processing / transfer and 10: processing / transfer is performed with pattern B).
[0058]
The flow of the data transfer process in this modification will be described together with the change in the value of the control flag area. Description of the same parts as those in the embodiment is omitted.
(1) 000: Indicates that writing of transfer data to the data area 12 by the process A is not completed. Same as “00” in the embodiment (see FIG. 3).
{Circle around (2)} 001: Indicates that the process A has completed writing the transfer data to the data area 12, but the process B cannot read or transfer the transfer data. Same as “01” (see FIG. 3) in the embodiment.
{Circle around (3)} 011 or 101: State in which transfer / reading of transfer data by process B is permitted. This corresponds to “11” in the embodiment (see FIG. 3). Process B reads the transfer data, processes it with pattern A if it is “011”, and processes it with pattern B if it is “101”, and transfers it to the transfer destination.
{Circle around (4)} 010 or 100: State in which reading / transfer of transfer data from the data area 12 by the process B is completed. This corresponds to “10” (see FIG. 3) in the embodiment. From here, the process A initializes the shared memory and returns to (1).
[0059]
FIG. 12 is a diagram showing state transition of the control flag area in the present modification.
As shown in the figure, also in this modification, the value of the control flag area is as follows: (1) “000” → (2) “001” → (3) “101” → (4) “100” → (1) ▼ “000” or ▲ 1 ▼ “000” → ▲ 2 ▼ “001” → ▲ 3 ▼ “011” → ▲ 4 ▼ “010” → ▲ 1 ▼ “000” To do. Further, the process on the reference side of the control flag area 11 only refers to the control flag area until it detects the value of the control flag area as a predetermined value, and does not perform an operation related to the progress of the work. The point is the same as the above embodiment. Therefore, as described in the embodiment, no malfunction occurs without performing exclusive control on the shared memory.
[0060]
In the above-described embodiment and modification, the data transfer process has been described as a process performed by a plurality of processes. However, this is given as an example, and the scope of the present invention is limited to the data transfer process. is not. For example, a process in which a certain process passes data to another process, performs some processing on the data, and returns the data is also conceivable. In this case, the control information is used to instruct the timing of data transfer before and after processing, the type of processing, and the like. However, any processing content is applicable as long as the content can be managed in association with the control information that transitions with “distance between codes = 1”.
[0061]
【The invention's effect】
As described above, in the shared memory access management device of the present invention, in an environment where a plurality of processes sharing a dual port type memory perform processing in cooperation using the memory, each process has the memory of its own process. A shared memory access management device provided for managing access to the memory, wherein the memory includes control information that is composed of a plurality of bits and whose values are updated according to the progress of processing performed in cooperation with the plurality of processes. The shared memory access management device includes: a detecting unit that detects the value of the control information; an updating unit that updates the value of the control information; and a value of the control information detected by the detecting unit is determined by another process. A value detected by the detection unit by causing the detection unit to repeat the operation of detecting the value of the control information until it is updated and changes to a predetermined value. When the value changes to the predetermined value, the process is instructed to perform an operation related to the process, and when the operation by the process is completed, the update unit is instructed to transmit one bit related to the operation in the control information. Therefore, the control information consisting of a plurality of bits in the shared memory can be processed by the plurality of processes using the control information without performing exclusive control by hardware. No malfunction occurs in the process to be executed.
[0062]
Further, the shared memory includes a data part used by the plurality of processes to exchange data other than the control information, and the control information includes one or more exclusive control flags for exclusive control with respect to the data part. Including the process performed by the plurality of processes in cooperation with each other is a data transfer performed through the data unit, and the instruction unit is based on the value of the exclusive control flag detected by the detection unit, It is also possible to cause the process to perform an operation related to the data transfer, and to instruct the updating means to update the 1 bit of the exclusive control flag when the operation is completed. As a result, if there is a mixture of control information and other data in the shared memory, the area for storing data other than the control information is for exclusive control that is set as part of the control information. For areas where exclusive control is realized by information and control information is set, malfunction does not occur even without exclusive control, so there is no need to perform exclusive control by hardware for the entire shared memory. No malfunction occurs in processing executed by a plurality of processes.
[0063]
In order to reliably obtain the above-described effect, when the plurality of bits of the control information are inverted after the operation performed by the instruction unit in the process is completed, the update is sequentially performed for each of the plurality of bits. It is also possible to instruct and reverse the means.
A data communication method in which a plurality of processes sharing a dual port type memory perform data communication using the memory, and the memory includes a plurality of values whose values are updated by the plurality of processes as data communication progresses. A flag comprising bits, and the data communication method includes a writing step in which one process writes data to the memory, and the one process having completed the writing step inverts one bit included in the flag. A first inversion step, a second inversion step in which the one process that has completed the first inversion step inverts another one bit included in the flag, and another one process, A detecting step for detecting inversion of the one bit and the other one bit, and the other one having finished the detecting step. Process, if the data communication method characterized by comprising the steps of: reading the data written in the memory, without performing exclusive control of the shared memory by the hardware, can perform data communication without erroneous operation
[Brief description of the drawings]
FIG. 1 is a schematic diagram showing an outline of a transfer process performed by a plurality of processes using a shared memory in an embodiment of a shared memory access management apparatus according to the present invention.
FIG. 2 is a diagram showing a configuration of a shared memory in the same embodiment.
FIG. 3 is a schematic diagram showing the progress of transfer processing and the accompanying transition of the contents of the shared memory in the embodiment;
FIG. 4 is a flowchart showing an operation of a process A in the same embodiment.
FIG. 5 is a flowchart showing an operation of a process B in the same embodiment.
FIG. 6 is a schematic diagram showing a result of access collision to a control flag area in the same embodiment;
FIG. 7 is a schematic diagram showing a result of collision of access to a control flag area in the same embodiment;
FIG. 8 is a schematic diagram showing a result of collision of access to a control flag area in the same embodiment;
FIG. 9 is a schematic diagram showing a result of collision of access to a control flag area in the same embodiment;
FIG. 10 is a diagram showing, in a tabular form, the relationship between the value of a control flag area and the contents of shared memory access by a plurality of processes in the embodiment.
FIG. 11 is a state transition diagram showing a transition of a value of a control flag area in the same embodiment.
FIG. 12 is a state transition diagram showing a transition of a value of a control flag area in a modification of the embodiment.
[Explanation of symbols]
1 Shared memory
11 Flag area for control
111 Valid flag
112 Change flag
12 Data area
120 data
A, B process
A1, B1 Data processing part
A2, B2 Management Department

Claims (3)

デュアルポート型メモリを共有する複数のプロセスが前記メモリを用いながら協同して処理を行う環境において、各プロセスが、自プロセスの前記メモリへのアクセスを管理するために備える共有メモリアクセス管理装置であって、
前記メモリには、複数ビットから成って、前記複数のプロセスが協同して行う処理の進行に従って値が更新される制御情報が含まれており、
前記共有メモリアクセス管理装置は、
前記制御情報の値を検出する検出手段と、
前記制御情報の値を更新する更新手段と、
前記検出手段が検出する制御情報の値が他プロセスによって更新されて所定の値に変化するまで前記検出手段に前記制御情報の値を検出する動作を繰り返させ、前記検出手段が検出した値が前記所定の値に変化すると、自プロセスに指示して前記処理に関わる動作を行わせ、前記自プロセスによる動作が完了した後に前記制御情報の複数ビットを反転させる場合、前記複数のビットの各々について、順次前記更新手段に指示して反転させて前記他プロセスに前記処理の進行を伝達する指示手段、
とから成ることを特徴とする共有メモリアクセス管理装置。
In an environment in which a plurality of processes sharing a dual port type memory cooperate to perform processing using the memory, each process is a shared memory access management device provided for managing access to the memory of its own process. And
The memory includes control information that consists of a plurality of bits and whose value is updated according to the progress of processing performed in cooperation with the plurality of processes.
The shared memory access management device includes:
Detecting means for detecting a value of the control information;
Updating means for updating the value of the control information;
Until the value of the control information detected by the detection means is updated by another process and changes to a predetermined value, the detection means repeats the operation of detecting the value of the control information, and the value detected by the detection means When changing to a predetermined value, instructing the own process to perform an operation related to the processing, and when inverting a plurality of bits of the control information after the operation by the own process is completed, for each of the plurality of bits, Instructing means for sequentially instructing and inverting the updating means and transmitting the progress of the processing to the other process
A shared memory access management device comprising:
前記共有メモリは、前記複数のプロセスが前記制御情報以外のデータを受け渡しするために用いるデータ部を含み、
前記制御情報は、前記データ部に対する排他制御のための排他制御用フラグを1以上含み、
前記複数のプロセスが協同して行う処理は、前記データ部を介して行われるデータの受け渡しであり、
前記指示手段は、前記検知手段が検知した前記排他制御用フラグの値に基づいて、前記データの受け渡しに関する動作を前記自プロセスに行わせ、前記動作が完了した後に、前記排他制御用フラグの複数ビットを反転させる場合、前記複数のビットの各々について、順次前記更新手段に指示して反転させること
を特徴とする請求項1に記載の共有メモリアクセス管理装置。
The shared memory includes a data part used by the plurality of processes to pass data other than the control information,
The control information includes one or more exclusive control flags for exclusive control with respect to the data part,
The processing performed by the plurality of processes in cooperation is data delivery performed through the data portion,
The instructing unit causes the self process to perform an operation related to the data transfer based on the value of the exclusive control flag detected by the detecting unit , and after the operation is completed , a plurality of the exclusive control flags The shared memory access management device according to claim 1 , wherein when the bit is inverted, each of the plurality of bits is sequentially instructed to the update unit and inverted .
デュアルポート型メモリを共有する複数のプロセスが前記メモリを用いてデータ通信を行うデータ通信方法であって、
前記メモリには、データ通信の進行に従って前記複数のプロセスによって値が更新される複数ビットから成るフラグが含まれ、前記データ通信方法は、
一のプロセスが前記メモリにデータを書き込む書き込みステップと、
前記書き込みステップを終えた前記一のプロセスが、前記フラグに含まれる一のビットを反転させる第1の反転ステップと、
前記第1の反転ステップを終えた前記一のプロセスが、前記フラグに含まれる他の一のビットを反転させる第2の反転ステップと、
他の一のプロセスが、前記一のビットおよび前記他の一のビットの反転を検知する検知ステップと、
前記検知ステップを終えた前記他の一のプロセスが、前記メモリに書き込まれたデータを読み出す読み出しステップと
を含むことを特徴とするデータ通信方法。
A data communication method in which a plurality of processes sharing a dual port memory perform data communication using the memory,
The memory includes a flag composed of a plurality of bits whose values are updated by the plurality of processes according to the progress of data communication, and the data communication method includes:
A writing step in which one process writes data to the memory;
A first inversion step in which the one process that has finished the writing step inverts one bit included in the flag;
A second inversion step in which the one process that has finished the first inversion step inverts another one bit included in the flag;
A sensing step in which another process detects the inversion of the one bit and the other one bit;
The data communication method characterized in that the other process that has finished the detecting step includes a reading step of reading data written in the memory.
JP2000003464A 1999-04-19 2000-01-12 Shared memory access management device Expired - Fee Related JP3790653B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000003464A JP3790653B2 (en) 1999-04-19 2000-01-12 Shared memory access management device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP11072399 1999-04-19
JP11-110723 1999-04-19
JP2000003464A JP3790653B2 (en) 1999-04-19 2000-01-12 Shared memory access management device

Publications (2)

Publication Number Publication Date
JP2001005720A JP2001005720A (en) 2001-01-12
JP3790653B2 true JP3790653B2 (en) 2006-06-28

Family

ID=26450279

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000003464A Expired - Fee Related JP3790653B2 (en) 1999-04-19 2000-01-12 Shared memory access management device

Country Status (1)

Country Link
JP (1) JP3790653B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003140972A (en) 2001-11-08 2003-05-16 Nec Corp Program execute device, program executing method, portable terminal using it and information providing system
US9189230B2 (en) 2004-03-31 2015-11-17 Intel Corporation Method and system to provide concurrent user-level, non-privileged shared resource thread creation and execution
US8447933B2 (en) 2007-03-06 2013-05-21 Nec Corporation Memory access control system, memory access control method, and program thereof
JP4833911B2 (en) * 2007-04-25 2011-12-07 株式会社ソニー・コンピュータエンタテインメント Processor unit and information processing method
WO2009040932A1 (en) * 2007-09-28 2009-04-02 Fujitsu Limited Control device, control method, electronic equipment, and transmission device
DE102017200669A1 (en) 2017-01-17 2018-07-19 Robert Bosch Gmbh Method and device for operating a control device, computer program and method for generating the computer program
US11392427B2 (en) * 2020-01-06 2022-07-19 Microsoft Technology Licensing, Llc Lock-free reading of unitary value sets
JP7639567B2 (en) * 2021-06-16 2025-03-05 株式会社明電舎 Processing system using shared memory, and processing method using shared memory

Also Published As

Publication number Publication date
JP2001005720A (en) 2001-01-12

Similar Documents

Publication Publication Date Title
FI92262B (en) Flexible joint system
USRE44270E1 (en) System for providing access of multiple data buffers to a data retaining and processing device
US11614986B2 (en) Non-volatile memory switch with host isolation
JP4410190B2 (en) PCI-Express communication system
EP0534662A2 (en) Bus-to-bus interface for preventing data incoherence in a multiple processor computer system
CN110580235B (en) SAS expander communication method and device
US11847079B2 (en) Dynamic addressing system and method in a digital communication interface
JP3790653B2 (en) Shared memory access management device
CN101669098A (en) Originating device notification method and apparatus
JP4640126B2 (en) Sideband bus setting circuit
JPS62206658A (en) storage management device
CN107301138A (en) A kind of universal serial bus bridging method and serial bus system
WO2012046634A1 (en) Electronic device and serial data communication method
JP4451837B2 (en) Data transfer apparatus and data transfer method
KR100815004B1 (en) Control method and electronic device
JP2002215557A (en) Facilitation system for fault analysis of pci bus
US6907503B2 (en) Dual port RAM communication protocol
JP4918284B2 (en) PCI-Express communication system
JPH0238969B2 (en)
CN114691386B (en) Event triggering main control terminal, control chip and control method
JP7476733B2 (en) COMMUNICATION CONTROL DEVICE AND METHOD FOR CONTROLLING COMMUNICATION CONTROL DEVICE
JP3695334B2 (en) Internal communication method of communication terminal
US20040148418A1 (en) Industrial or domestic local network
JPS63228856A (en) Communication controller
JP6885801B2 (en) Bank dual port memory

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20051213

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060124

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060307

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060322

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060403

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 3790653

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100407

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110407

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120407

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130407

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130407

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140407

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees