JP2011034510A - Memory allocation device and memory allocation method - Google Patents
Memory allocation device and memory allocation method Download PDFInfo
- Publication number
- JP2011034510A JP2011034510A JP2009182698A JP2009182698A JP2011034510A JP 2011034510 A JP2011034510 A JP 2011034510A JP 2009182698 A JP2009182698 A JP 2009182698A JP 2009182698 A JP2009182698 A JP 2009182698A JP 2011034510 A JP2011034510 A JP 2011034510A
- Authority
- JP
- Japan
- Prior art keywords
- buffer
- memory
- area
- allocation information
- size
- 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.)
- Granted
Links
Images
Abstract
Description
この発明は、データストリームの記録再生処理等において処理が利用するバッファをメモリ上に連続領域として確保するメモリ割り当て方法、および、この方法を用いるメモリ割り当て装置に関する。 The present invention relates to a memory allocation method for securing a buffer used by a process in a data stream recording / playback process or the like as a continuous area on a memory, and a memory allocation apparatus using this method.
近年は大容量のハードディスクドライブ(HDD)が安価に供給されるようになってきており、数百ギガバイトないしテラバイトクラスのHDDがパーソナルコンピュータ(PC)、デジタルTV、デジタルビデオレコーダなどに装備されている。このような大容量HDDは、動画情報を含むデータストリームの記録再生に多用される。 In recent years, large-capacity hard disk drives (HDDs) have been supplied at low cost, and hundreds of gigabytes or terabytes of HDDs are equipped in personal computers (PCs), digital TVs, digital video recorders, and the like. . Such a large-capacity HDD is frequently used for recording and reproducing data streams including moving image information.
HDDに代表される大容量記憶メディアでは、高精細デジタルTV放送など情報量の多いデータストリームの記録再生処理をスムースに行うために、比較的大容量の高速メモリ(バッファ)が用いられる。この種のメモリ(バッファ)の制御には、種々な提案がなされている。例えば、PC(AVパソコン)やデジタルビデオレコーダ(HDDレコーダ)においてデジタルTV放送ストリームの記録再生処理を実行する場合、その処理の実行にあたりメモリが必要になると、動的にメモリ領域を確保し利用する仕組みが提案されている(特許文献1参照)。 In a large-capacity storage medium represented by an HDD, a relatively large-capacity high-speed memory (buffer) is used to smoothly perform recording and reproduction processing of a data stream having a large amount of information such as high-definition digital TV broadcasting. Various proposals have been made for controlling this type of memory (buffer). For example, when recording / playback processing of a digital TV broadcast stream is executed in a PC (AV personal computer) or a digital video recorder (HDD recorder), if a memory is required to execute the processing, a memory area is dynamically secured and used. A mechanism has been proposed (see Patent Document 1).
特許文献1のデータ格納システムおよびそれを用いたデータ放送受信装置では、RAM142のデータ領域は、割当要求に従ってバッファ領域が割り当てられるパーティション領域と、割当要求に従ってセグメント領域が割り当てられるリージョン領域を含んでいる。バッファ領域は所定の固定長データに対応し、セグメント領域は格納されるべきデータ長に対応する。演算処理部144は、デジタルデータのデータ長に応じて、パーティション領域とリージョン領域のいずれにデータを格納するかを決定し、割当要求を生成している。
In the data storage system of
特許文献1の動的バッファ確保方法は、実行される処理およびその処理が必要とするバッファサイズが静的に決定できない場合に有効である。しかし、デジタルTV放送など情報量の多いデータストリームの記録再生処理をスムースに行うためには、十分なサイズのメモリ領域を用意しておく必要がある上、連続した領域を当該処理のバッファ用にいつでも確保できるという保証はない。
The dynamic buffer securing method of
メモリ上で連続した領域を処理のバッファ用に確保できなかったときは、その処理のバッファとして利用する領域がメモリ上で分散され断片化する。バッファとして利用する領域が断片化すると、処理の実行にオーバーヘッドが発生する。また、メモリ上で連続した領域を処理のバッファ用に確保できなかったときは、バッファとして利用されているメモリ領域間に中途半端な利用されない空きメモリ領域ができることがある。そのような空きメモリ領域は無駄になる。 When a continuous area on the memory cannot be secured for the processing buffer, the area used as the processing buffer is distributed and fragmented on the memory. If an area used as a buffer is fragmented, an overhead occurs in the execution of processing. In addition, when a continuous area on the memory cannot be secured for the processing buffer, there may be a halfway unused memory area between the memory areas used as buffers. Such an empty memory area is wasted.
この発明の課題の1つは、処理が利用するバッファをメモリ上に連続領域として確保できるようにすることである。 One of the problems of the present invention is to make it possible to secure a buffer used by processing as a continuous area on a memory.
この発明の一実施の形態に係るメモリ割り当て装置は、バッファ割り当て情報出力モジュール(511)と、バッファメモリ範囲決定モジュール(522)と、処理モジュール(524)を具備している。いま、バッファとして用いる連続領域をメモリ(530)上に確保する必要のある1以上の処理を「処理名の集合」で表し、それらの処理が利用するバッファのサイズを「バッファサイズ情報」で表し、それら処理間で並列実行されない処理の組合せを「排他関係」で表し、処理がバッファとして利用可能な1つ以上のメモリ範囲候補を「バッファ割り当て情報」で表す。その場合、バッファ割り当て情報出力モジュール(511)は、処理名の集合、バッファサイズ情報、および排他関係に基づいて、バッファ割り当て情報(BAI)を処理毎に出力する。また、バッファメモリ範囲決定モジュール(522)は、処理名の集合に含まれる特定の処理を開始する際には、バッファ割り当て情報(BAI)に記述されているメモリ範囲候補のうち、その特定の処理を開始する時点で他の処理に利用されているメモリ範囲と重複しないメモリ範囲(メモリ上で連続した領域)を、1箇所選択する。そして、処理モジュール(524)は、選択されたメモリ範囲をバッファとしてメモリ(530)に確保し、確保されたバッファを用いて特定の処理を実行する。 The memory allocation device according to an embodiment of the present invention includes a buffer allocation information output module (511), a buffer memory range determination module (522), and a processing module (524). Now, one or more processes that need to secure a continuous area to be used as a buffer on the memory (530) are represented by "a set of process names", and the size of the buffer used by these processes is represented by "buffer size information". A combination of processes that are not executed in parallel between these processes is represented by “exclusive relationship”, and one or more memory range candidates that can be used as buffers by the process are represented by “buffer allocation information”. In this case, the buffer allocation information output module (511) outputs buffer allocation information (BAI) for each process based on the set of process names, the buffer size information, and the exclusive relationship. Further, when starting a specific process included in the set of process names, the buffer memory range determination module (522) selects the specific process from among the memory range candidates described in the buffer allocation information (BAI). A memory range (continuous area on the memory) that does not overlap with the memory range used for other processing at the time of starting is selected. The processing module (524) secures the selected memory range as a buffer in the memory (530), and executes a specific process using the secured buffer.
この発明によれば、処理が利用するバッファをメモリ上に連続領域として確保できる。 According to the present invention, the buffer used by the process can be secured as a continuous area on the memory.
以下、図面を参照してこの発明の種々な実施の形態を説明する。図1は、この発明の一実施の形態に係るメモリ割り当て装置の構成を説明する図である。このメモリ割り当て装置500は、メモリ530に対してバッファ用連続領域をどのように割り当てるかを決定するもので、バッファ割り当て情報出力装置(バッファ割り当て情報出力モジュール)511、データ格納部(格納モジュール)520、バッファメモリ範囲決定部(バッファメモリ範囲決定モジュール)522、および、処理実行部(処理モジュール)524を具備している。
Hereinafter, various embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a diagram for explaining the configuration of a memory allocation device according to an embodiment of the present invention. The
図2は、この発明の他の実施の形態に係るメモリ割り当て装置の構成を説明する図である。図2の構成は、バッファ割り当て情報出力装置511内に部分問題作成部(部分問題作成モジュール)505が追加された点を除き、図1の構成と同じである。部分問題作成部505の処理機能については、図13等を参照して後述する。以下では、まず図1と図2で共通する構成について、説明する。
FIG. 2 is a diagram for explaining the configuration of a memory allocation device according to another embodiment of the present invention. The configuration of FIG. 2 is the same as the configuration of FIG. 1 except that a partial problem creation unit (partial problem creation module) 505 is added to the buffer allocation information output device 511. The processing function of the partial
図1の構成において、メモリ530は、例えば複数の高精細映像信号ストリームの処理で利用可能なリードライトメモリであり、その処理に必要な容量と速度を持ったSRAMあるいはDRAMで構成される。このメモリ530には、ストリーム処理等のためにバッファとして利用可能なメモリ領域(バッファ領域)532を適宜確保できるようになっている。
In the configuration of FIG. 1, the
図3は、バッファとして利用可能なメモリ領域532の構成を説明する図である。メモリ領域(バッファ領域)532は、図3に例示されるように、静的バッファ領域534と動的バッファ領域536に分割(または分離)され、それぞれ個別に管理される。ここで、静的バッファ領域534は、利用するバッファサイズが既知である処理に対して割り当てられるバッファ領域である。この静的バッファ領域534以外の領域532が動的バッファ領域536となる。
FIG. 3 is a diagram illustrating the configuration of the memory area 532 that can be used as a buffer. As illustrated in FIG. 3, the memory area (buffer area) 532 is divided (or separated) into a
この発明の実施の形態は、静的バッファ領域534の使い方に特徴がある。動的バッファ領域536は、静的バッファ領域534を用いない処理あるいは静的バッファ領域534で賄い切れない処理で利用される。動的バッファ領域536の利用方法は周知の方法でよい。具体的には、動的バッファ領域536は、例えば前掲の特許文献1(特開2001−325145号公報)におけるセグメント領域と同様に利用できる。
The embodiment of the present invention is characterized by the usage of the
なお、動的バッファ領域536に対する「動的メモリ割り当て」には、別の既存方法を用いることもできる。この「動的メモリ割り当て」に関する既存の方法は、C言語におけるmalloc関数で利用されている。これについては下記文献参照:
B.W.カーニハン、D.M.リッチー、“プログラミング言語C”、共立出版、1989
図1の構成において、処理実行部524は、例えば機器組込用のコンピュータ(所定のファームウエアを実行するCPUまたはMPU)で構成される。処理実行部524は、例えばあるストリーム処理Aを実行しようとする場合、バッファメモリ範囲決定部522が選択するメモリ範囲を処理Aの利用するバッファとしてメモリ530上に確保して、処理Aを実行する。
It should be noted that another existing method can be used for “dynamic memory allocation” for the
B. W. Carnihan, D.C. M.M. Richie, “Programming Language C”, Kyoritsu Shuppan, 1989
In the configuration of FIG. 1, the
バッファメモリ範囲決定部522は、処理実行部524がある処理Aを開始する場合、データ格納部520に格納されているバッファ割り当て情報BAIから、1つのメモリ範囲を選択する。その1つとは、処理Aがバッファとして利用可能なメモリ範囲の候補のうち他のストリーム処理が現在利用しているメモリ範囲と重複しないものをいう。その選択されたメモリ範囲の1つが、処理Aのバッファとして利用されることになる。
When the
ここで、実行しようとする処理が2以上ある場合、バッファメモリ範囲決定部522は、排他関係にない処理の組合せであれば、どのような順序でそれらの処理が発生しても、利用可能なバッファ範囲を必ず確保できるように構成されている(この点については後に詳述する)。
Here, when there are two or more processes to be executed, the buffer memory
データ格納部520に格納されるバッファ割り当て情報BAIには、実行される可能性のある1以上のストリーム処理毎に、バッファメモリとして利用可能なメモリ範囲の候補が1つ以上含まれる。(バッファ割り当て情報BAIについては、図4等を参照して後述する。)
図1の構成において、バッファ割り当て情報出力装置511は、処理情報入力部(処理情報入力モジュール)501と、処理間排他関係入力部(処理間排他関係入力モジュール)502と、入力情報格納部503と、目標メモリサイズ決定部(目標メモリサイズ決定モジュール)504と、バッファ割り当て決定部509と、バッファ割り当て情報出力部510を含んでいる。ここで、バッファ割り当て決定部509は、実行可能/不可能判定部(実行可能/不可能判定モジュール)506、バッファ割り当て探索部(バッファ割り当て探索モジュール)507、および、探索範囲絞り込み部(探索範囲絞り込みモジュール)508により構成される。
The buffer allocation information BAI stored in the
In the configuration of FIG. 1, the buffer allocation information output device 511 includes a processing information input unit (processing information input module) 501, an inter-process exclusive relationship input unit (inter-process exclusive relationship input module) 502, and an input
処理情報入力部501からは、実行される可能性のある全ての処理について、処理名とその処理が利用するバッファサイズが入力される。
From the process
処理間排他関係入力部502からは、並列実行されない処理の組合せが入力される。(逆に、並列実行されるストリーム処理の組合せを処理間排他関係入力部502から入力する方法もある。並列実行される処理の組合せが分かれば、それ以外に存在する処理の組合せを、並列実行されない処理の組合せとして扱うことができる。)
入力情報格納部503には、処理情報入力部501および処理間排他関係入力部502から入力された情報が格納される。
A combination of processes that are not executed in parallel is input from the inter-process exclusion
The input
バッファ割り当て情報出力装置511の目標メモリサイズ決定部504は、最初、静的バッファ領域534(図3参照)として利用するメモリのサイズ(目標値)を十分に小さい値と仮定し、利用可能なバッファ割り当て情報を探索する(その探索方法については後述する)。目標メモリサイズで実行可能なバッファメモリ割り当てが見つからない場合(換言すると、その目標メモリサイズでは「排他関係にない処理の組合せであれば、どのような順序で処理が発生しても、利用可能なバッファ範囲を必ず確保できる」とはいえない場合)、目標メモリサイズが更新(増加)され、実行可能なバッファ割り当て情報を探索する処理が繰り返される。このメモリサイズの目標値を設定し適宜更新するのが、目標メモリサイズ決定部504である。
The target memory
ここで、静的バッファ領域534を用いて処理が実行可能な最小メモリサイズと最初に設定される目標メモリサイズとの差が大きいと、バッファメモリ割り当ての算出に多くの計算時間を要する。そのため、なるべく差が小さい目標メモリサイズを最初に設定するようにする。
Here, if the difference between the minimum memory size that can be processed using the
実行可能/不可能判定部506は、現在のバッファ割り当て情報BAIで排他関係にない全ての処理組合せが実行可能かどうかを判定する(排他関係については後述)。
The executable /
バッファ割り当て探索部507は、目標メモリサイズ決定部504で設定された目標メモリサイズ内で、処理が実行可能なメモリ割り当てを探索する。
The buffer
探索範囲絞り込み部508は、バッファ割り当て探索部507が探索する範囲を絞り込む。探索範囲絞り込み部508は、入力部501および502からの入力情報等を利用して、効率よく実行可能なバッファ割り当て情報BAIを算出するために利用される。
The search
バッファ割り当て情報出力部510は、処理が実行可能で、かつ、バッファ(静的バッファ領域534)として利用するメモリのサイズが最小となるバッファ割り当て情報BAIを出力する(その具体的方法は後述する)。
The buffer allocation
図4は、バッファ割り当て情報出力部510から出力されデータ格納部520に格納されるバッファ割り当て情報BAIが、どのような内容であるのかを説明する図である。図1または図2のデータ格納部520に格納されるバッファ割り当て情報BAI(バッファメモリ割り当てのための情報)は、イメージ的には図4に例示されるようになる。図4には、7つの処理A〜Gに対して、バッファメモリ(静的バッファ領域534)として利用可能な範囲の候補が例示されている。ただし、A〜Gの各処理を実行するにあたり必要なバッファメモリサイズ(その単位は任意)は、処理Aが2単位、処理Bが5単位、処理Cが3単位、処理Dが7単位、処理Eが4単位、処理Fが7単位、処理Gが15単位、と仮定している。ここで、例えば1単位が1MB(メガバイト)であれば、n単位はnMBになる。
FIG. 4 is a diagram for explaining the contents of the buffer allocation information BAI output from the buffer allocation
図4の例示では、
処理Aが利用できるバッファメモリ範囲はメモリ530の29番地〜30番地のみ;
処理Bが利用できるバッファメモリ範囲はメモリ530の29番地〜33番地のみ;
処理Cが利用できるバッファメモリ範囲はメモリ530の0番地〜2番地または15番地〜17番地;
処理Dが利用できるバッファメモリ範囲はメモリ530の0番地〜6番地または15番地〜21番地;
処理Eが利用できるバッファメモリ範囲はメモリ530の22番地〜25番地のみ;
処理Fが利用できるバッファメモリ範囲はメモリ530の22番地〜28番地のみ;
処理Gが利用できるバッファメモリ範囲はメモリ530の0番地14番地または7番地〜21番地
ということが示されている。このようなバッファメモリ割り当ての場合、処理実行に必要なバッファメモリサイズ(静的バッファ領域534のサイズ)は、0番地〜33番地の34単位分(例えば34MB)になる。このような情報が、処理A〜Gに対するバッファ割り当て情報BAIとして作成され、データ格納部520に格納される。
In the illustration of FIG.
The buffer memory range that can be used by process A is only addresses 29 to 30 in the
The buffer memory range that can be used by the process B is only the addresses 29 to 33 of the
The buffer memory range that can be used by process C is 0 to 2 or 15 to 17 in the
The buffer memory range that can be used by the process D is 0 to 6 addresses or 15 to 21 addresses in the
The buffer memory range that can be used by the process E is only 22 to 25 in the
The buffer memory range that can be used by the process F is only 22 to 28 in the
The buffer memory range that can be used by the process G is shown as 0
図5は、バッファとして利用可能なメモリ領域に利用できない無駄な領域が生じた場合を説明する図である。もし、図1または図2のメモリ割り当て装置500が用いられないと、図5に例示されるように、メモリ領域(バッファ領域)532内に、バッファとして利用できない無駄な領域が生じる恐れがある。図1または図2の装置500では、以下に述べるような動作によって、このような無駄な領域の発生を防止している。
FIG. 5 is a diagram for explaining a case where a useless area that cannot be used occurs in a memory area that can be used as a buffer. If the
いま、メモリ割り当て装置500に相当する構成を持つPCまたはHDDレコーダ等の機器において、実行すべき処理名の集合を{A, B, C, D,… }とする。これらの処理名は、頻繁に実行されることが分かっていて、かつ、実行に際して必要なバッファサイズが既知で、かつ、バッファとして連続したメモリ領域を確保したい処理を示す。ここで、各処理が実行に際して必要なバッファサイズはs(N)で与えられているものとする(Nは処理名)。
Assume that a set of process names to be executed in a device such as a PC or HDD recorder having a configuration corresponding to the
例えば、3つの処理A(s(A)=3)、B(s(B)=5)、C(s(C)=1)が「A開始→B開始→A終了(バッファを開放)→C開始→ …」の順に実行される場合を考えてみる。その場合、単純にバッファの開いている場所に必要な連続領域を詰めて確保する方法を利用すると、図5のように利用できない無駄なメモリ領域が必要となる。バッファ領域を詰め直すことも考えられるが、そうすると、余計な処理時間を要することになる。そこで、この例の場合、処理Aはメモリの0番地〜2番地、処理Bはメモリの3番地〜7番地、処理Cはメモリの8番地を常に利用するようにしておけば、無駄なメモリ領域が発生することはない。
For example, three processes A (s (A) = 3), B (s (B) = 5), and C (s (C) = 1) are “A start → B start → A end (buffer release) → Consider the case where the processes are executed in the order of “C start →. In that case, if a method of simply allocating and securing necessary continuous areas at the location where the buffer is open is used, a useless memory area that cannot be used as shown in FIG. 5 is required. Although it is conceivable to refill the buffer area, this requires extra processing time. Therefore, in this example, if the process A always uses the addresses 0 to 2 of the memory, the process B uses the
しかし、図1または図2の装置500では、単に無駄なメモリ領域の発生を防止するに止まらず、必要なメモリ量をさらに減らせるようにしている。すなわち、例えば「処理Aと処理Bは同時に実行されない」ということが予め分かっている場合、処理Aがバッファとして利用するメモリ領域と処理Bがバッファとして利用するメモリ領域を共有して、必要なメモリを減らすようにしている。そのために、図1または図2のメモリ割り当て装置500は、「どのように処理がバッファとして利用するメモリ領域を共有化すれば必要なメモリを最小限に減らすことができるか」という情報(バッファ割り当て情報BAI)を出力するように構成されている。
However, in the
いま、実行されることが分かっていて、かつ、実行に際して必要なバッファサイズが既知で、かつ、バッファとして連続したメモリ領域を確保したい処理名の集合を{A, B, C, D, E, F, G}とし、処理が必要とするバッファサイズをs(A)=2, s(B)=5, s(C)=3, s(D)=3, s(E)=4, s(F)=7, s(G)=15とする。さらに、4つの処理が同時に実行されることはなく、処理AとB、処理EとF、処理CとDとG、処理EとGとC、処理EとGとDの各組合せは同時に実行されないことが予め分かっている場合を考える。これらの既知情報のうち、処理名の集合の情報、および、処理が必要とするバッファサイズの情報は、処理情報入力部501から入力される。また、既知情報のうち、同時に実行されない処理の組合せの情報は、処理間排他関係入力部502から入力される。
A set of process names that are known to be executed and whose buffer size necessary for execution is known and for which a continuous memory area is to be secured as a buffer are represented by {A, B, C, D, E, F, G} and the buffer size required for processing is s (A) = 2, s (B) = 5, s (C) = 3, s (D) = 3, s (E) = 4, s (F) = 7 and s (G) = 15. Furthermore, the four processes are not executed simultaneously, and the combinations of processes A and B, processes E and F, processes C and D and G, processes E and G and C, and processes E and G and D are executed simultaneously. Consider the case where it is known in advance that this will not be done. Among these pieces of known information, information on a set of processing names and information on a buffer size required for processing are input from the processing
上記の既知情報が処理情報入力部501と処理間排他関係入力部502に入力されると、バッファ割り当て情報出力部510から図4に例示されるような内容のバッファ割り当て情報BAIが出力される。このバッファ割り当て情報BAIから、メモリ割り当て装置500は、0〜33番地までのメモリ領域を、処理A〜Gを実行するのに必要なバッファ用の静的メモリ領域534(処理A〜G専用のメモリ領域)として利用する。処理A〜G以外の処理については、動的メモリ領域536(図3参照)を利用し、既存の方法(前述した「C言語におけるmalloc関数で利用されている方法」など)でバッファを確保する。
When the above-described known information is input to the processing
図6は、メモリ割り当て装置500がメモリ530内の静的メモリ領域534にバッファを割り当てる処理の一例を説明するフローチャートである。メモリ割り当て装置500は、処理間排他関係入力部502から入力される排他関係から、実行される可能性のある並列処理の組み合わせを算出し、算出された並列処理の組合せを入力情報格納部503に格納する(ST1)。ここで、処理間排他関係入力部502から入力される排他関係とは、複数存在する処理のうち、並列実行されない処理の関係をいう。
FIG. 6 is a flowchart for explaining an example of processing in which the
入力情報格納部503に格納された並列処理の組合せのうち、各処理が必要とするバッファサイズの和が最大となる組合せが、目標メモリサイズ決定部504により検出される(ST2)。検出された必要バッファサイズの和(最大値)は、静的バッファ領域534に対する、目標メモリサイズの初期値となる。
Among the combinations of parallel processes stored in the input
なお、図6の処理において「…→ST8→ST2」の順でST2に到達した場合では、ST2の処理において、目標メモリサイズを、現状(始めは初期値)から最小単位分増加させた値に更新する。静的バッファ領域534をMB(メガバイト)単位の粒度で増減させる場合、ここでの最小単位は1MBとなる。
In the case of reaching ST2 in the order of “... → ST8 → ST2” in the process of FIG. 6, the target memory size is increased by the minimum unit from the current state (initial value at first) in the process of ST2. Update. When the
続いて、バッファ割り当て決定部509内のバッファ割り当て探索部507が、バッファ割り当て情報BAIを初期化する(ST3)。この初期化において、各処理がバッファとして確保する可能性のあるメモリ範囲の候補が、全て列挙される。例えば、目標メモリサイズが11単位(1単位を1MBとすれば11MB)で、入力として排他関係のない処理A(必要バッファサイズ7単位)と処理B(必要バッファサイズ4単位)を仮定すると、初期化時のバッファ割り当て情報BAIの内容(各処理がバッファとして確保する可能性のあるメモリ範囲の候補)は、図7のようになる(図7の図解は、横軸方向に沿って、バッファサイズの1単位毎に縦割りされている)。
Subsequently, the buffer
バッファ割り当て情報BAIが初期化されると、バッファ割り当て決定部509内の探索範囲絞り込み部508が、バッファ割り当て情報BAIの枝刈りを行う(ST4)。ここで、枝刈りとは、複数存在するメモリ範囲の候補のうち、並行処理が不可能となるようなメモリ範囲の候補を削除することをいう。
When the buffer allocation information BAI is initialized, the search
例えば、図7の初期状態で処理Aと処理Bが並行動作する場合を考える。処理Aがメモリ範囲候補A2を利用してしまうと処理Bはどのメモリ範囲候補(B1〜B8)も利用できず並列動作できなくなることから、メモリ範囲候補A2は候補から削除(枝刈り)する。同様に候補を削除していくと、図8のように枝刈りされたバッファ割り当て情報BAIが得られる(図8では枝刈りにより削除されたメモリ範囲候補が×で示されている)。この例では、2並列動作を考慮した枝刈りが行われたことになる。この枝刈りの結果、処理Aに対してはメモリ範囲候補A1とA5が残り、処理Bに対してはメモリ範囲候補B1とB8が残る。 For example, consider a case where process A and process B operate in parallel in the initial state of FIG. If the process A uses the memory range candidate A2, the process B cannot use any of the memory range candidates (B1 to B8) and cannot operate in parallel, so the memory range candidate A2 is deleted (pruned) from the candidates. Similarly, when candidates are deleted, buffer allocation information BAI pruned as shown in FIG. 8 is obtained (in FIG. 8, memory range candidates deleted by pruning are indicated by x). In this example, pruning is performed in consideration of two parallel operations. As a result of this pruning, memory range candidates A1 and A5 remain for process A, and memory range candidates B1 and B8 remain for process B.
さらに複雑な例として、3並列動作を考慮した枝刈りを説明する。図9のようなバッファ割り当て情報(初期状態)があり、処理Aと処理Bと処理Cが並行動作する場合を考える。処理Aがメモリ範囲候補A2を利用してしまうと、処理Bおよび処理Cがどのようにメモリ範囲候補を選択しても並行動作できなくなることから、メモリ範囲候補A2は候補から削除(枝刈り)する。同様に、候補を削除していくと、図10のように枝刈りされたバッファ割り当て情報BAIが得られる。4並列動作、5並列動作、…などの多並列動作を考慮した枝刈りも同様に行うことができる。 As a more complicated example, pruning considering three parallel operations will be described. Consider a case where there is buffer allocation information (initial state) as shown in FIG. 9, and processing A, processing B, and processing C operate in parallel. If the process A uses the memory range candidate A2, no parallel operation can be performed regardless of how the process B and the process C select the memory range candidate. Therefore, the memory range candidate A2 is deleted from the candidate (pruning). To do. Similarly, when candidates are deleted, buffer allocation information BAI pruned as shown in FIG. 10 is obtained. Pruning considering multi-parallel operations such as 4-parallel operation, 5-parallel operation,.
図6の処理の説明に戻る。バッファ割り当て情報の枝刈りが済むと、バッファ割り当て探索部507は、各処理について、バッファとして利用するメモリ範囲候補を仮定設定する(ST5)。この設定において、バッファ割り当て探索部507は、利用するメモリ範囲候補を仮定する処理の順番を決定しておく(ここで仮定するメモリ範囲候補の個数は1つ以上ある)。
Returning to the description of the processing in FIG. When the pruning of the buffer allocation information is completed, the buffer
続いて、バッファ割り当て探索部507は、全ての処理についてメモリ範囲候補の仮定を行ったかどうかを判定する(ST6)。全ての処理についてメモリ範囲候補の仮定が行われていなければ(ST6ノー)、バッファ割り当て情報の枝刈り(ST4)とバッファとして利用するメモリ範囲候補の仮定設定(ST5)を再度行う。
Subsequently, the buffer
全ての処理についてメモリ範囲候補の仮定が終了したならば(ST6イエス)、バッファ割り当て決定部509内の実行可能/不可能判定部506は、「仮定のおかれたメモリ範囲候補をバッファ割り当て情報として選択した場合に、排他関係にない処理組合せであれば、どのような順序で処理が開始されても、処理がバッファとして利用するメモリ範囲を必ず選択できる」かどうかを判定する。例えば、処理Aと処理Bと処理Cが並行動作する場合ならば、実行開始順が「A→B→C」、「A→C→B」、「B→A→C」、「B→C→A」、「C→A→B」、「C→B→A」の6パターンのどの場合についても、処理がバッファとして利用するメモリ範囲を必ず選択できるかどうかを判定する(ST7)。処理がバッファとして利用するメモリ範囲を必ず選択できるならば、その処理は実行可能となる。そうでないなら、その処理は実行不可能とする。
When the assumption of the memory range candidate is completed for all the processes (YES in ST6), the executable /
実行不可能と判定された場合は(ST7ノー)、全ての処理の全てのパターンについてバッファ割り当て探索部507が仮定設定をし終えたかを調べる(ST8)。全ての処理の全てのパターンについて仮定設定が終わっていないならば(ST8ノー)、ST4〜ST7の処理が再度実行される。
If it is determined that execution is not possible (NO in ST7), it is checked whether the buffer
全ての処理の全てのパターンについて仮定設定が終わっている場合は(ST8イエス)、現在の目標メモリサイズでは、実行可能なバッファ割り当て情報が存在しないことになる。その場合は、ST2に戻り、目標メモリサイズを更新したのち、実行可能なバッファ割り当て情報の探索(ST3〜ST7の処理)をやり直す。 When the assumption setting has been completed for all patterns of all processes (YES in ST8), there is no executable buffer allocation information with the current target memory size. In this case, the process returns to ST2, and after updating the target memory size, the search for executable buffer allocation information (the processes of ST3 to ST7) is performed again.
ST7で実行可能と判定された場合は(ST7イエス)、現在仮定のおかれたメモリ範囲の候補(例えば図8または図10において、×以外のメモリ範囲が候補になる)をバッファ割り当て情報としたものが、最終的なバッファ割り当て情報BAIとしてバッファ割り当て情報出力部510から出力される(ST9)。出力されたバッファ割り当て情報BAIは、データ格納部520に格納される(ST10)。
If it is determined in ST7 that execution is possible (YES in ST7), the currently assumed memory range candidate (for example, a memory range other than x in FIG. 8 or 10 becomes a candidate) is used as buffer allocation information. Is output from the buffer allocation
ST9で出力されるバッファ割り当て情報BAIは、処理を実行するのに必要なバッファをバッファメモリ範囲決定部522が必ず選択可能(ST7で判定済み)な内容となっている。さらに、目標メモリサイズ決定部504は、目標メモリサイズを、最小限の最適メモリサイズ以下の値から、最小の単位(例えば1MB)で徐々に大きくしていく仕組みを持っている(ST2での更新)。そのため、ST9で出力されるバッファ割り当て情報BAIは、静的バッファ領域534のサイズを処理の実行が可能な範囲で最小にする内容となる。
The buffer allocation information BAI output in ST9 has such a content that the buffer memory
こうしてST9で出力されるバッファ割り当て情報BAIから、静的バッファ領域534として利用するメモリ範囲を決定できる。メモリ割り当て装置500は、処理情報入力部501から入力されなかった処理を実行する際には、静的バッファ領域534として利用されない領域(動的バッファ領域536)を利用する。一方、処理情報入力部501から入力された処理に関しては、バッファ割り当て情報BAIを利用し、既に実行中の処理が利用していないメモリ範囲をバッファとして確保(必ず確保できることが保証されている)して、処理を実行する。
Thus, the memory range to be used as the
すなわち、データ格納部520に格納されたバッファ割り当て情報BAIから処理間で重複しないメモリ範囲が選択される(ST11)(図8の2並列動作の場合を例にとれば、A1とA5とB1とB8が、処理Aと処理Bの間で重複しないメモリ範囲として選択される)。バッファメモリ範囲決定部522は選択されたメモリ範囲をバッファ用としてメモリ530上に確保する(ST12)。処理実行部524は、こうして確保されたバッファメモリ範囲を用いて、1以上の処理を実行する(ST13)。
That is, a memory range that does not overlap between processes is selected from the buffer allocation information BAI stored in the data storage unit 520 (ST11) (A1, A5, and B1 in the case of two parallel operations in FIG. 8 as an example) B8 is selected as a non-overlapping memory range between process A and process B). The buffer memory
なお、バッファ割り当て探索部507が仮定するメモリ範囲候補の個数が1つ以上ある場合において、「…→ST8→ST2→ST3→ST4→ST5」の順でST5に到達する場合を除き、ST5では同じ処理について一度仮定したメモリ範囲候補の組み合わせをもう一度仮定することはない。しかし、「…→ST8→ST2→ST3→ST4→ST5」の順でST5に到達する場合は、今まで仮定をおいた処理や仮定をおいたメモリ範囲候補の組み合わせに関する情報をクリアし、最初の処理の処理から仮定をおく(ST5の仮定設定を行う)。
In the case where there is one or more memory range candidates assumed by the buffer
「ST1→ST2→ST3→ST4→ST5」または「…→ST6→ST4→ST5」の順でST5に到達する場合は、ST5ではまだ仮定をおいていない次の処理について、利用するメモリ範囲候補の仮定を行う。また、「…→ST8→ST4→ST5」の順でST5に到達する場合は、最後に仮定を行った処理について次の仮定を行う。ただし、最後に仮定を行った処理が既に全てのパターンについて仮定をし終わっていた場合、さらにその前の処理に戻り次の仮定をする。その前の処理についても、既に全てのパターンについて仮定をし終わっていた場合、さらに前といった具合に戻していく(全ての処理について、全ての仮定設定が終了している場合は、「…→ST8→ST4→ST5」の順でST5に到達することはない)。このようにしてST5に至る動作は、いわゆる「深さ優先探索」に対応する。 When reaching ST5 in the order of "ST1-> ST2-> ST3-> ST4-> ST5" or "...-> ST6-> ST4-> ST5", the memory range candidate to be used is determined for the next process that has not yet been assumed in ST5. Make assumptions. Further, when the process reaches ST5 in the order of “... → ST8 → ST4 → ST5”, the following assumption is made for the last assumed process. However, if the last assumption process has already been made for all patterns, the process returns to the previous process and makes the following assumption. In the previous process, if all the patterns have already been assumed, the previous state is further restored (if all assumptions have been set for all processes, “... → ST8 ST5 is not reached in the order of “ST4 → ST5”). The operation leading to ST5 in this way corresponds to a so-called “depth-first search”.
図11は、バッファ割り当て処理における「深さ優先探索」の一例をグラフィカルイメージで説明する図である。例えば、3つの処理(処理A、B、C)に対して図10に例示したようなメモリ範囲の候補を想定し得る場合において、処理Bに関してメモリ範囲候補の仮定をおいてみる(図6ではST5)。複数ある処理Bのメモリ範囲候補を横方向(幅方向)に探索する場合は、いわゆる「幅優先探索」となる。一方、「深さ優先探索」では、複数ある処理Bのメモリ範囲候補のうちの1つに対して、処理Aに関するメモリ範囲の候補に仮定をおく(ST5)。その際、処理Bと同時実行が不可能な処理Aのメモリ範囲候補に関しては、以後の深さ優先探索が打ち切られる(これにより処理時間の短縮を図れる)。処理Bと同時実行が可能な処理Aのメモリ範囲候補が1つ以上みつかったときは、そのうちの1つに対して、処理Cに関するメモリ範囲の候補に仮定をおく(ST5)。その際、処理Bおよび処理Aと同時実行が可能な処理Cのメモリ範囲候補がみつかれば、3つの処理A、B、Cの並列実行が可能な解(メモリ範囲候補の組合せ)が見つかったことになるので、そこで深さ優先探索のアルゴリズムは終了する。 FIG. 11 is a diagram for explaining an example of “depth-first search” in the buffer allocation process using a graphical image. For example, in the case where memory range candidates as illustrated in FIG. 10 can be assumed for three processes (processes A, B, and C), let us assume the assumption of memory range candidates for process B (FIG. 6). ST5). When searching a plurality of process B candidate memory areas in the horizontal direction (width direction), a so-called “width priority search” is performed. On the other hand, in the “depth-first search”, a memory range candidate for process A is assumed for one of the plurality of process B memory range candidates (ST5). At that time, with respect to the memory range candidate of the process A that cannot be executed simultaneously with the process B, the depth-first search thereafter is terminated (this can reduce the processing time). When one or more memory range candidates of process A that can be executed simultaneously with process B are found, a memory range candidate for process C is assumed for one of them (ST5). At that time, if a memory range candidate of process C that can be executed simultaneously with process B and process A is found, a solution (a combination of memory range candidates) that can execute three processes A, B, and C in parallel is found. Therefore, the depth-first search algorithm ends there.
この発明の実施の形態では、高速にバッファ割り当て情報BAIを出力するため、目標メモリサイズを初期値設定する(図6ST2)ことの他に、バッファ割り当て探索部507の探索範囲を狭める工夫として、上記「深さ優先探索」を行っている。探索方法には「幅優先探索」もあるが、この発明の実施の形態では「深さ優先探索」の方を採用して説明した。
In the embodiment of the present invention, in order to output the buffer allocation information BAI at high speed, in addition to setting the target memory size to an initial value (ST2 in FIG. 6), as a device for narrowing the search range of the buffer
上記の「深さ優先探索」および「幅優先探索」については下記文献参照:
石畑清、岩波講座 ソフトウエア科学3“アルゴリズムとデータ構造”、岩波書店、1989
図12は、バッファ割り当ての探索範囲が絞り込まれる前の、バッファ割り当て情報初期状態を説明する図である。バッファ割り当て探索部507の探索範囲は、探索範囲絞り込み部508によって絞り込まれる(図6のST4における枝刈り)。その際、次の考え方を導入して、さらに絞り込みを行うことができる。例えば、処理A(s(A)=7)と処理B(s(B)=6)と処理C(s(C)=1)があり、目標メモリサイズが7単位の場合、バッファ割り当て情報の初期状態は図12のようになる。しかし、解(メモリ範囲候補の組合せ)を探索するにあたり、図12のC2〜C6のメモリ範囲候補については、条件が同じであるため(他の処理のメモリ範囲候補との重複関係が同じ)、全てを候補としておく必要はなく、どれか1つで十分(これで絞り込み可)となる。
For the above-mentioned “depth-first search” and “width-first search”, see:
Ishihata Kiyoshi, Iwanami
FIG. 12 is a diagram illustrating an initial state of buffer allocation information before the search range of buffer allocation is narrowed down. The search range of the buffer
既に作成されているバッファ割り当て情報を更新する場合も、上記の流れに従って新たにバッファ割り当て情報を作成する。新たに静的バッファ領域534を利用する処理を追加する場合は、その処理と利用するバッファサイズおよびその処理が関連する排他関係を追加する形で入力情報格納部503の内容を更新し、その内容を元に新たなバッファ割り当て情報を作成する。逆に静的バッファ領域534を利用する処理を減らす場合には、入力情報格納部503に格納されている情報から、削除する処理に関連する情報を削除し、その内容を元に新たなバッファ割り当て情報を作成する。
Even when the buffer allocation information that has already been created is updated, new buffer allocation information is created according to the above flow. When a process that uses the
ところで、図1または図2のメモリ割り当て装置500で実行される図6の処理において、ST2における目標メモリサイズの初期値は、「排他関係にない処理組合せなら実行可能なバッファ割り当て情報が必要とする最小のメモリサイズ(最適メモリサイズ)」以下の値としている。ここで、目標メモリサイズの初期値は0でもバッファ割り当て情報を得ることができるが、最適メモリサイズと目標メモリサイズの初期値が離れ過ぎていると、処理の並列実行が可能な解(メモリ範囲候補の組合せ)の探索に時間がかかる(図6のST2〜ST8の処理ループの反復回数が増えて時間がかかる)ことになる。そこで、図6の説明では、例えば、処理Aと処理Bと処理Cが並行動作するなら、少なくともs(A)+s(B)+s(C)以上のメモリサイズが必要となることを、目標メモリサイズの初期値の設定時(ST2)に利用している。
By the way, in the processing of FIG. 6 executed by the
さらに、図2のメモリ割り当て装置500では、最適メモリサイズと目標メモリサイズの初期値を近づけるため、部分問題作成部505において部分問題を作成し、その部分問題が必要とするメモリサイズを目標メモリサイズの初期値とする仕組みを導入している。具体的には、例えば6個以上の処理が処理情報入力部501に入力された場合、そのうち、処理の実行に必要なバッファサイズが大きい順(または排他関係が多い順)に5つの処理を選択し、その5つの処理が入力となっていると想定した場合のバッファ割り当て情報を計算する。その時、必要となる静的バッファ領域のサイズを目標メモリサイズの初期値(図6のST2)として、元の入力に対するバッファ割り当て情報を計算する。
Further, in the
図13は、図2の部分問題作成部505における処理の一例を説明するフローチャートである。まず、部分問題作成部505が扱う処理の種類がn+1以上あるかどうかチェックされる(ST20)。ここで、例えば6個以上の処理(元の問題)が処理情報入力部501に入力され、nが5であるとする。その場合n+1は6となり(ST20イエス)、必要バッファサイズの多い順、もしくは、排他関係の多い順に、処理がn個(5個)選択される(ST21)。そして、選択したn個の処理、および、選択したn個の処理間の排他関係のみを残した問題を、部分問題として作成し(ST22)、図6の処理を行う。
FIG. 13 is a flowchart for explaining an example of processing in the partial
ここで、ST22において部分問題を作成する理由は、元の問題の目標メモリサイズ(初期値)を、最終的に得る「要求合致のバッファ割り当て情報が必要とする(必要最小限の)メモリサイズ」に近づけるためである。具体的には、部分問題作成部505の作成した部分問題に対する「要求合致バッファ割り当て情報」を計算し、その「要求合致バッファ割り当て情報」で必要なメモリサイズを、元の問題での目標メモリサイズの初期値とする。
Here, the reason why the partial problem is created in ST22 is that the target memory size (initial value) of the original problem is finally obtained "the memory size required (minimum required) by the buffer allocation information for request matching" It is because it is close to. Specifically, the “request match buffer allocation information” for the partial problem created by the partial
このように、「部分問題の要求合致バッファ割り当て情報の必要メモリサイズを、元の問題の目標メモリサイズの初期値とする」ことが、部分問題作成部505を有する図2の構成の特徴となる。
Thus, “the necessary memory size of the request matching buffer allocation information of the partial problem is set to the initial value of the target memory size of the original problem” is a feature of the configuration of FIG. 2 having the partial
部分問題作成部505が扱う処理の種類がn+1以上でない、つまりその種類がn以下であるときは(ST20ノー)、部分問題を作成せず(ST23)、図6の処理を行う。
When the type of processing handled by the
なお、ST21において「必要バッファサイズの多い順、もしくは、排他関係の多い順に」n個選択するのは、部分問題が必要とするメモリサイズ(n個の処理を扱えるバッファサイズ)を元の問題の最適メモリサイズ(n+1個の処理を扱えるバッファサイズ)に近づけるためである。 In ST21, selecting “n in order of increasing required buffer size or in decreasing order of exclusion” selects the memory size required for the partial problem (buffer size that can handle n processes) as the original problem. This is to approach the optimum memory size (buffer size that can handle n + 1 processes).
また、元の問題の処理の種類数がかなり多い場合(ST20におけるn+1がかなり多い場合)、例えばある部分問題1の目標サイズの初期値を、その部分問題1から作成される部分問題2から決定することもできる(この例では部分問題1の扱う処理数>部分問題2が扱う処理数となる)。すなわち、部分問題を多段に作成することもできる。
Further, when the number of types of processing of the original problem is quite large (when n + 1 in ST20 is very large), for example, the initial value of the target size of a certain
図14は、図1または図2のメモリ割り当て装置の応用例を説明する図である。ここでは、バッファを用いた並列処理の具体例として、複数のデジタル放送ストリームの処理を例にとって説明する。図14の例では、TV放送サービスの1つとして放送局から送られてくる電子番組表情報(EPG情報)、インターネット配信される電子番組表情報(iEPG情報)、ユーザがリモコン操作などで入力する番組予約情報などの処理情報ソース601が、ホスト600に接続されている。このホスト600には、映像表示を行う表示部604も接続されている。
FIG. 14 is a diagram illustrating an application example of the memory allocation device of FIG. 1 or FIG. Here, as a specific example of parallel processing using a buffer, processing of a plurality of digital broadcast streams will be described as an example. In the example of FIG. 14, as one of TV broadcast services, electronic program guide information (EPG information) sent from a broadcasting station, electronic program guide information distributed over the Internet (iEPG information), and a user input by remote control operation or the like. A processing information source 601 such as program reservation information is connected to the
ホスト600としては、PC(TVチューナ付きのAVパソコン)、デジタルTV、HDD付きビデオレコーダなどを用いることができる。このホスト600に、図1または図2のメモリ割り当て装置500およびバッファとして利用するリードライトメモリ530が装備される。処理情報ソース601は、図1または図2の処理情報入力部501および処理間排他関係入力部502に対応する。処理情報ソース601から得た情報は、図1または図2の入力情報格納部503に対応する記憶エリア(図示せず)に格納される。
As the
メモリ割り当て装置500は、ホスト600から出力される複数のデジタル放送ストリームに対する処理を、複数の処理として扱う(これらの複数処理は、1つの放送番組中に含まれる映像ストリーム、音声ストリーム、その他のデータストリーム等に対する処理でもよい)。そして、これらの複数処理の排他関係に基づいてバッファ割り当て情報BAIが作成され、作成されたBAIに基づいて、メモリ530上の静的バッファ領域に対するメモリ範囲の割り当てが行われる(図8、図10等参照)。
The
図6等を参照して説明した処理により、必要最小限の静的バッファ領域サイズでバッファリングが可能となっているメモリ530を介して、ホスト600から出力される複数ストリームがHDDなどのデータ記憶装置100aで記録される。あるいは、データ記憶装置100aから読み出された複数ストリームは、メモリ530を介してホスト600に返される。ホスト600は、例えば、読み出されたストリームに含まれる映像を表示部604で表示し、読み出されたストリームに含まれる音声を図示しないスピーカを用いて再生する。
Through the processing described with reference to FIG. 6 and the like, a plurality of streams output from the
図14の装置は、USBインターフェース(I/F)110およびネットワークインターフェース(I/F)110aをさらに備えている。メモリ530でバッファリングされる1以上のデータストリームは、USBI/F110およびUSBハブ112を介して1以上の外付けデータ記憶装置100b〜100dに転送される。あるいは、外付けデータ記憶装置100b〜100dから読み出された1以上のデータストリームは、USBハブ112およびUSBI/F110を通し、メモリ530を介してホスト600に返される。
The apparatus of FIG. 14 further includes a USB interface (I / F) 110 and a network interface (I / F) 110a. One or more data streams buffered in the
同様に、メモリ530でバッファリングされる1以上のデータストリームは、ネットワークI/F110aを介して外付けデータ記憶装置100eに転送される。あるいは、外付けデータ記憶装置100eから読み出された1以上のデータストリームは、ネットワークI/F110aを通し、メモリ530を介してホスト600に返される。
Similarly, one or more data streams buffered in the
ここで、ネットワークI/F110aには、IEEE802.3あるいはDLNA(Digital Living Network Alliance)に準拠したI/Fを用いることができる。
Here, as the network I /
図14の構成では、外部機器(100b〜100e)から見れば、メモリ割り当て装置500は機器外部に存在することになる。それでも、データ転送を仲介するI/Fが必要な速度に対応しておれば、機器内臓のデータ記憶装置100aを用いる場合と同様に、外部機器(100b〜100e)において、メモリ530をバッファとして用いた処理が可能となる。
In the configuration of FIG. 14, when viewed from the external devices (100b to 100e), the
一般論として、PCにおける処理のように、ユーザ毎に実行する処理が異なる場合は、バッファ割り当て情報出力装置510を具備したメモリ割り当て装置500を内蔵してメモリ割り当てを行うのが便利である。一方、HDDビデオレコーダのように、実行する処理が確定されている機器の場合や、頻繁にバッファ割り当て情報を更新する必要がない機器の場合は、機器(外付けHDDレコーダなど)の外部に存在するバッファ割り当て情報出力装置510の出力するバッファ割り当て情報BAIをバッファメモリ範囲決定部522に入力し利用する方が便利である。
In general, when processing to be executed is different for each user, such as processing in a PC, it is convenient to perform memory allocation by incorporating a
図15は、図1または図2のメモリ割り当て装置を具備したデジタルビデオレコーダの構成の一例を説明する図である。このビデオレコーダは複数のTVチューナ(82、89)をもち、複数のTV放送番組の同時録画(W録など)が可能な構成となっている。このビデオレコーダは、図1または図2のメモリ割り当て装置500を持ち、この装置500によって、一時記憶部530内に静的バッファ領域を適宜確保している。もし、メインMPU80の処理能力に余裕があるときは、メモリ割り当て装置500の処理(図6の処理など)を、MPU80のファームウエアでこなしてもよい
<実施の形態のまとめ>
ストリーム処理のように高速な処理実行が必須であることなどから、バッファとして連続メモリ領域の確保が必要な場合に、この発明が実施される。その際、既知の処理がバッファとして利用するメモリ領域(静的バッファ領域)と、その他の処理がバッファとして利用するメモリ領域(動的バッファ領域)に、本来バッファとして利用可能だったメモリ領域を分離する。静的バッファ領域を利用する各処理に関するバッファ領域の確保は、各処理がバッファとして利用可能なメモリ範囲を表わすバッファ割り当て情報BAIに従って行う。動的バッファ領域の利用方法に関しては既存の方法を利用できる。すなわち、従来の処理実行も同様に行える。
FIG. 15 is a diagram for explaining an example of the configuration of a digital video recorder including the memory allocation device of FIG. 1 or FIG. This video recorder has a plurality of TV tuners (82, 89), and is capable of simultaneously recording a plurality of TV broadcast programs (such as W recording). This video recorder has the
The present invention is implemented when it is necessary to secure a continuous memory area as a buffer because high-speed processing execution is essential as in stream processing. At that time, the memory area that was originally available as a buffer is separated into the memory area that is used as a buffer by a known process (static buffer area) and the memory area that is used as a buffer by other processes (dynamic buffer area). To do. The buffer area for each process that uses the static buffer area is secured according to buffer allocation information BAI that represents a memory range in which each process can be used as a buffer. An existing method can be used as a method of using the dynamic buffer area. That is, the conventional process execution can be performed similarly.
バッファ割り当て情報BAIとは、静的バッファ領域を利用する処理毎に処理がバッファとして利用可能なメモリ範囲の候補(1つ以上)を表わす情報である。メモリ割り当て装置は、静的バッファ領域を利用する処理に関しては、既に利用されているメモリ範囲と重複しないメモリ範囲を候補の中から1つ選択し、そのメモリ範囲をバッファとして割り当てる。処理の実行装置は、そのバッファを利用し処理を開始する。バッファ割り当て情報BAIは、次に述べる特長をもつバッファ割り当て情報出力部510から得る。
The buffer allocation information BAI is information representing a candidate (one or more) of a memory range that can be used as a buffer for each process that uses a static buffer area. With respect to processing using the static buffer area, the memory allocation device selects one memory range from candidates that does not overlap with the already used memory range, and allocates the memory range as a buffer. The processing execution device starts processing using the buffer. The buffer allocation information BAI is obtained from the buffer allocation
バッファ割り当て出力部510は、静的バッファ領域を利用する処理、各処理が利用するバッファサイズ、および、それら処理間の排他関係を入力として用いる。排他関係にない処理の組合せであれば、どのような順序で処理が開始されても、処理がバッファとして利用するメモリ範囲を必ず選択でき(処理が実行可能)、かつ、静的バッファ領域のサイズが最小となるような、バッファ割り当て情報BAIを出力する。
The buffer
<実施の形態の効果>
新たに静的バッファ領域を利用する処理が発生した場合や、これまで静的バッファ領域を利用していた処理が不要になった場合は、新たに発生した処理に関する情報や、不要になった処理に関する情報を入力することにより、バッファ割り当て情報を更新することができる(図6の処理)。
<Effect of Embodiment>
When new processing that uses the static buffer area occurs or when processing that previously used the static buffer area is no longer required, information about the newly generated processing or processing that is no longer required The buffer allocation information can be updated by inputting the information regarding (the process of FIG. 6).
この発明を利用すれば、バッファとして連続領域が必要で、かつ、処理が利用するバッファサイズが既知の処理に関しては、静的バッファ領域上に連続するメモリ領域としてバッファを必ず確保できるようになる。そのため、高速な処理実行が可能になる。 If the present invention is used, for a process that requires a continuous area as a buffer and whose buffer size used by the process is known, a buffer can be secured as a continuous memory area on the static buffer area. As a result, high-speed processing can be executed.
また、動的にバッファを確保せざるを得ない処理(もしくは、静的バッファ領域にバッファを確保する必要のない処理)に関しては、従来通り動的バッファ領域上にバッファを確保できる。その上、バッファ割り当て情報出力部510の出力するバッファ割り当て情報BAIは静的バッファ領域のサイズを最小にすることが保証されているため、動的バッファ領域を最大限確保できる。
In addition, with respect to processing in which it is necessary to dynamically secure a buffer (or processing that does not require securing a buffer in the static buffer area), a buffer can be secured in the dynamic buffer area as before. In addition, since the buffer allocation information BAI output from the buffer allocation
<実施の形態と発明との対応例>
(1)バッファとして用いる連続領域をメモリ(530)上に確保する必要のある1以上の処理を処理名の集合({A,B,C,…})で表し、それらの処理が利用するバッファのサイズをバッファサイズ情報(s(N))で表し、それら処理間で並列実行されない処理の組合せを排他関係で表し、前記処理がバッファとして利用可能な1つ以上のメモリ範囲候補をバッファ割り当て情報(BAI)で表すときに、前記処理名の集合({A,B,C,…})、前記バッファサイズ情報(s(N))、および前記排他関係に基づいて、前記バッファ割り当て情報(BAI)を前記処理毎に出力する(ST1〜ST8)。
<Correspondence Example between Embodiment and Invention>
(1) One or more processes that need to secure a continuous area used as a buffer on the memory (530) are represented by a set of process names ({A, B, C,...}), And buffers used by these processes Buffer size information (s (N)), a combination of processes that are not executed in parallel between these processes is expressed in an exclusive relationship, and one or more memory range candidates that can be used as buffers by the processes are buffer allocation information (BAI), the buffer allocation information (BAI) is based on the set of process names ({A, B, C,...}), The buffer size information (s (N)), and the exclusive relationship. ) Is output for each process (ST1 to ST8).
ここで、利用するバッファサイズが既知である処理に対して割り当てられるバッファ領域を静的バッファ領域とし、この静的バッファ領域以外のバッファ領域を動的バッファ領域とするときに、前記バッファとして利用可能な前記メモリの領域(532)が前記静的バッファ領域(534)と前記動的バッファ領域(536)に分割される。 Here, when a buffer area allocated to a process whose buffer size to be used is known is a static buffer area, and a buffer area other than this static buffer area is a dynamic buffer area, it can be used as the buffer. The memory area (532) is divided into the static buffer area (534) and the dynamic buffer area (536).
前記処理名の集合({A,B,C,…})に含まれる特定の処理を開始する際には、前記バッファ割り当て情報(BAI)に記述されているメモリ範囲候補(520に格納されている)のうち、前記特定の処理を開始する時点で他の処理に利用されているメモリ範囲と重複しないメモリ範囲を選択し(ST11)、選択された前記メモリ範囲を前記静的バッファ領域(534)として前記メモリ(530)に確保し(ST12)、確保された前記静的バッファ領域(534)を用いて前記特定の処理を実行する(ST13)。 When a specific process included in the set of process names ({A, B, C,...}) Is started, memory range candidates (stored in 520) described in the buffer allocation information (BAI) are stored. A memory range that does not overlap with a memory range used for other processing at the time of starting the specific processing (ST11), and the selected memory range is selected as the static buffer region (534). ) In the memory (530) (ST12), and the specific processing is executed using the reserved static buffer area (534) (ST13).
(2)利用するバッファサイズが既知である処理に対して割り当てられるバッファ領域を静的バッファ領域とし、この静的バッファ領域以外のバッファ領域を動的バッファ領域とするときに、前記バッファとして利用可能な前記メモリの領域(532)は前記静的バッファ領域(534)と前記動的バッファ領域(536)に分割され、前記バッファメモリ範囲決定モジュール(522)により選択された前記メモリ範囲が、前記静的バッファ領域(534)に対して適用される。 (2) When a buffer area allocated to a process whose buffer size to be used is known is a static buffer area, and a buffer area other than this static buffer area is a dynamic buffer area, it can be used as the buffer. The memory area (532) is divided into the static buffer area (534) and the dynamic buffer area (536), and the memory range selected by the buffer memory range determination module (522) is the static memory area (532). Applied to the dynamic buffer area (534).
(3)新たにバッファとして連続領域を前記メモリ(530)上に確保する必要のある第1の処理の名前、および、その第1の処理が利用するバッファのサイズ(s(N))を入力する処理情報入力モジュール(501)と、前記第1の処理と既に前記バッファ割り当て情報(BAI)に含まれている処理との間の排他関係を入力する処理間排他関係入力モジュール(502)を、さらに具備できる。 (3) Enter the name of the first process that needs to newly secure a continuous area on the memory (530) as a buffer and the size (s (N)) of the buffer used by the first process. A process information input module (501) that performs an exclusive relationship between the first process and a process that is already included in the buffer allocation information (BAI). It can further comprise.
(4)バッファとして連続領域を前記メモリ(530)上に確保する必要のなくなった第2の処理の名前を入力する処理情報入力モジュール(501)をさらに具備し、前記バッファ割り当て情報出力モジュール(511)が、前記第2の処理以外の処理の集合と、前記第2の処理に関連する排他関係を現在利用している排他関係から削除した新たな排他関係に基づいて、前記バッファ割り当て情報(BAI)を出力するように構成できる。 (4) It further includes a processing information input module (501) for inputting a name of the second processing which no longer needs to be secured on the memory (530) as a buffer, and the buffer allocation information output module (511) ) Is based on the set of processes other than the second process and the new exclusive relation deleted from the exclusive relation that currently uses the exclusive relation related to the second process. ).
(5)前記バッファ割り当て情報(BAI)を格納する格納モジュール(520)をさらに具備し、前記バッファメモリ範囲決定モジュール(522)が、前記格納モジュール(520)に格納された前記バッファ割り当て情報(BAI)を用いて前記メモリ範囲を選択するように構成できる。 (5) A storage module (520) for storing the buffer allocation information (BAI) is further provided, and the buffer memory range determination module (522) stores the buffer allocation information (BAI) stored in the storage module (520). ) To select the memory range.
(6)前記バッファとして利用される可能性のある前記メモリの領域について、その領域のサイズの目標値を目標メモリサイズとするときに、この目標メモリサイズを決定する目標メモリサイズ決定モジュール(504)をさらに備えることができる。そして、並行動作する可能性のある処理組合せの各処理が利用するバッファメモリサイズの和の最大値を前記目標メモリサイズの初期値とし、前記排他関係にない処理の組合せであればどのような順序で処理が開始されても必ず処理が利用するバッファを選択できるようなバッファ割り当て情報を要求合致バッファ割り当て情報とするときに、前記目標メモリサイズの初期値では前記要求合致バッファ割り当て情報が前記バッファ割り当て情報(BAI)に存在しない場合に、前記目標メモリサイズをその初期値から増加させるように、前記目標メモリサイズ決定モジュール(504)を構成できる。 (6) A target memory size determination module (504) that determines a target memory size when a target value of the size of the memory area that may be used as the buffer is set as a target memory size. Can further be provided. Then, the maximum value of the sum of the buffer memory sizes used by each process of the process combinations that may be operated in parallel is set as the initial value of the target memory size, and in any order as long as the combinations of processes are not in the exclusive relationship When the buffer allocation information that can always select the buffer to be used even when processing is started is used as the request matching buffer allocation information, the request matching buffer allocation information is the buffer allocation information at the initial value of the target memory size. The target memory size determination module (504) can be configured to increase the target memory size from its initial value when not present in the information (BAI).
(7)前記バッファとして利用される可能性のある前記メモリの領域について、その領域のサイズの目標値を目標メモリサイズとするときに、この目標メモリサイズを決定する目標メモリサイズ決定モジュール(504)と、前記目標メモリサイズをどのように決定するかに関する元の問題から部分問題を作成する部分問題作成モジュール(505)をさらに備えることができる。そして、前記排他関係にない処理の組合せであればどのような順序で処理が開始されても必ず処理が利用するバッファを選択できるようなバッファ割り当て情報を要求合致バッファ割り当て情報とするときに、前記部分問題の要求合致バッファ割り当て情報の必要メモリサイズを、前記元の問題の目標メモリサイズの初期値とする(ST3)ように、前記目標メモリサイズ決定モジュール(504)を構成できる。 (7) A target memory size determination module (504) that determines a target memory size when a target value of the size of the memory area that may be used as the buffer is set as a target memory size. And a partial problem creating module (505) for creating a partial problem from an original problem on how to determine the target memory size. When the buffer allocation information that can always select the buffer used by the process regardless of the order in which the process is started as long as the process is not in the exclusive relationship, the request matching buffer allocation information The target memory size determination module (504) can be configured such that the required memory size of the partial problem request matching buffer allocation information is set as the initial value of the target memory size of the original problem (ST3).
(8)前記処理名の集合({A,B,C,…})の情報、および、この処理名の集合が示す1以上の処理で利用される前記バッファのサイズ情報(s(N))を入力する処理情報入力モジュール(501)と、前記排他関係の情報を入力する排他関係情報入力モジュール(502)と、前記バッファとして利用される可能性のあるメモリ領域のサイズの目標値を目標メモリサイズとするときに、この目標メモリサイズを設定する目標メモリサイズ決定モジュール(504)と、前記目標メモリサイズ決定モジュール(504)により設定された前記目標メモリサイズ内で前記処理が実行可能なメモリ割り当てを探索するバッファ割り当て探索モジュール(507)と、前記処理情報入力モジュール(501)および前記排他関係情報入力モジュール(502)により入力された情報(503に格納された情報)を用いて、前記バッファ割り当て探索モジュール(507)による探索範囲を絞り込む探索範囲絞り込みモジュール(508)と、前記バッファ割り当て探索モジュール(507)による探索で得られた前記バッファ割り当て情報(BAI)で、前記排他関係にない処理が実行可能かどうかを判定する実行可能/不可能判定モジュール(506)を備えることができる。 (8) Information on the set of process names ({A, B, C,...}) And size information (s (N)) of the buffer used in one or more processes indicated by the set of process names The processing information input module (501) for inputting the information, the exclusive information input module (502) for inputting the information on the exclusive relationship, and the target value of the size of the memory area that may be used as the buffer as the target memory A target memory size determining module (504) for setting the target memory size, and memory allocation capable of executing the processing within the target memory size set by the target memory size determining module (504). Allocation search module (507) for searching for, processing information input module (501) and exclusive relation information input module The search range narrowing module (508) for narrowing down the search range by the buffer allocation search module (507) using the information input in (502) (information stored in 503), and the buffer allocation search module (507) An executable / impossible determination module (506) for determining whether or not the processing not in the exclusive relationship can be executed based on the buffer allocation information (BAI) obtained by the search according to (1) can be provided.
ここで、前記バッファメモリ範囲決定モジュール(522)は、前記排他関係にない処理組合せであればどのような順序で処理が開始されても処理が利用する前記バッファを選択するように構成される(その結果524が処理を実行可能になる)。そして、前記バッファ割り当て情報出力モジュール(511)は、前記静的バッファ領域(534)のサイズが最小になるような前記バッファ割り当て情報(BAI)を出力するように構成される。
Here, the buffer memory range determination module (522) is configured to select the buffer to be used by the process regardless of the order in which the process is started as long as the process combination is not in the exclusive relationship ( As a result, the
(9)映像情報のデータストリームを処理する際にバッファとして用いる連続領域を含むメモリ(図14、図15の530)と、前記メモリでバッファリングされた前記データストリームを記録再生するデータ記憶装置(図14、図15の100a〜100e)と、前記メモリ上に前記バッファとして用いる連続領域を割り当てるメモリ割り当て装置(図14の500、図15の500または500a)を備えた映像機器(HDDレコーダ付きTV、DVD/BDレコーダ、ノートパソコンなど)において、前記バッファとして用いる連続領域を前記メモリ(530)上に確保する必要のある1以上の処理を処理名の集合({A,B,C,…})で表し、それら処理間で並列実行されない処理の組合せを排他関係で表し、前記処理がバッファとして利用可能な1つ以上のメモリ範囲候補をバッファ割り当て情報(BAI)で表す。 (9) A memory (530 in FIGS. 14 and 15) including a continuous area used as a buffer when processing a data information data stream, and a data storage device for recording and reproducing the data stream buffered in the memory ( Video equipment (TV with HDD recorder) provided with a memory allocation device (500 in FIG. 14, 500 or 500a in FIG. 15) that allocates a continuous area to be used as the buffer on the memory. A set of process names ({A, B, C,...) For one or more processes that need to secure a continuous area used as the buffer on the memory (530) in a DVD / BD recorder, notebook computer, etc. ), And a combination of processes that are not executed in parallel between the processes is represented by an exclusive relationship, and the process is a buffer. And representing one or more memory ranges candidate available buffer allocation information (BAI) and.
この場合、前記メモリ割り当て装置(500)が、前記処理名の集合({A,B,C,…})および前記排他関係に基づいて、前記バッファ割り当て情報(BAI)を前記処理毎に出力するバッファ割り当て情報出力モジュール(511)と、前記処理名の集合({A,B,C,…})に含まれる特定の処理を開始する際には、前記バッファ割り当て情報(BAI)に記述されているメモリ範囲候補(520に格納されている)のうち、前記特定の処理を開始する時点で他の処理に利用されているメモリ範囲と重複しないメモリ範囲を選択するバッファメモリ範囲決定モジュール(522)と、選択された前記メモリ範囲を前記バッファとして前記メモリ(530)に確保し、確保されたバッファを用いて前記特定の処理を実行する処理モジュール(524)を含んで構成される。 In this case, the memory allocation device (500) outputs the buffer allocation information (BAI) for each process based on the set of process names ({A, B, C,...}) And the exclusive relationship. When starting a specific process included in the buffer allocation information output module (511) and the set of process names ({A, B, C,...}), It is described in the buffer allocation information (BAI). Buffer memory range determination module (522) for selecting a memory range that does not overlap with a memory range used for other processing at the time of starting the specific processing among the memory range candidates (stored in 520) And a processing module for securing the selected memory range as the buffer in the memory (530) and executing the specific processing using the secured buffer. Configured to include a Lumpur (524).
なお、この発明は前述した実施の形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。また、各実施形態は可能な限り適宜組み合わせて実施してもよく、その場合組み合わせた効果が得られる。更に、上記実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適当な組み合わせにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果の欄で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。 In addition, this invention is not limited to embodiment mentioned above, In the implementation stage, it can change variously in the range which does not deviate from the summary. In addition, the embodiments may be appropriately combined as much as possible, and in that case, the combined effect can be obtained. Further, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some constituent requirements are deleted from all the constituent requirements shown in the embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effect described in the column of the effect of the invention Can be obtained as an invention.
500…メモリ割り当て装置、501…処理情報入力部、502…処理間排他関係入力部、503…入力情報格納部、504…目標メモリサイズ決定部、505…部分問題作成部、506…実行可能/不可能判定部、507…バッファ割り当て探索部、508…探索範囲絞り込み部、509…バッファ割り当て決定部、510…バッファ割り当て情報出力部、511…バッファ割り当て情報出力装置、520…データ格納部(バッファ割り当て情報格納部)、522…バッファメモリ範囲決定部、524…処理実行部(CPUまたはMPU)、530…バッファ領域を含むメモリ(バッファとして利用するメモリ)。
DESCRIPTION OF
Claims (10)
前記処理名の集合に含まれる特定の処理を開始する際には、前記バッファ割り当て情報に記述されているメモリ範囲候補のうち、前記特定の処理を開始する時点で他の処理に利用されているメモリ範囲と重複しないメモリ範囲を選択するバッファメモリ範囲決定モジュールと、
選択された前記メモリ範囲を前記バッファとして前記メモリに確保し、確保された前記バッファを用いて前記特定の処理を実行する処理モジュールを具備したメモリ割り当て装置。 One or more processes that need to secure a continuous area used as a buffer in the memory are represented by a set of process names, a combination of processes that are not executed in parallel between the processes is represented by an exclusive relationship, and the processes can be used as a buffer. A buffer allocation information output module that outputs the buffer allocation information for each process based on the set of process names and the exclusive relationship when one or more memory range candidates are represented by buffer allocation information;
When starting a specific process included in the set of process names, the memory range candidates described in the buffer allocation information are used for other processes at the time of starting the specific process. A buffer memory range determination module for selecting a memory range that does not overlap with the memory range;
A memory allocation device comprising: a processing module that secures the selected memory range as the buffer in the memory, and executes the specific processing using the secured buffer.
前記バッファメモリ範囲決定モジュールにより選択された前記メモリ範囲が、前記静的バッファ領域に対して適用される請求項1に記載のメモリ割り当て装置。 The memory that can be used as the buffer when a buffer area allocated to a process whose buffer size to be used is known is a static buffer area and a buffer area other than the static buffer area is a dynamic buffer area Area is divided into the static buffer area and the dynamic buffer area,
The memory allocation device according to claim 1, wherein the memory range selected by the buffer memory range determination module is applied to the static buffer area.
前記第1の処理と既に前記バッファ割り当て情報に含まれている処理との間の排他関係を入力する処理間排他関係入力モジュールをさらに具備した請求項1に記載のメモリ割り当て装置。 A processing information input module for inputting a name of a first process that needs to newly secure a continuous area on the memory as a buffer, and a size of the buffer used by the first process;
The memory allocation device according to claim 1, further comprising an inter-process exclusive relationship input module that inputs an exclusive relationship between the first process and a process already included in the buffer allocation information.
前記バッファ割り当て情報出力モジュールが、前記第2の処理以外の処理の集合と、前記第2の処理に関連する排他関係を現在利用している排他関係から削除した新たな排他関係に基づいて、前記バッファ割り当て情報を出力するように構成される請求項1に記載のメモリ割り当て装置。 A processing information input module for inputting a name of the second processing that no longer needs to secure a continuous area on the memory as a buffer;
The buffer allocation information output module is based on a set of processes other than the second process and a new exclusive relationship deleted from the exclusive relationship that currently uses the exclusive relationship related to the second process. The memory allocation device of claim 1, wherein the memory allocation device is configured to output buffer allocation information.
前記バッファメモリ範囲決定モジュールが、前記格納モジュールに格納された前記バッファ割り当て情報を用いて前記メモリ範囲を選択するように構成される請求項1に記載のメモリ割り当て装置。 A storage module for storing the buffer allocation information;
The memory allocation device according to claim 1, wherein the buffer memory range determination module is configured to select the memory range using the buffer allocation information stored in the storage module.
並行動作する可能性のある処理組合せの各処理が利用するバッファメモリサイズの和の最大値を前記目標メモリサイズの初期値とし、前記排他関係にない処理の組合せであればどのような順序で処理が開始されても必ず処理が利用するバッファを選択できるようなバッファ割り当て情報を要求合致バッファ割り当て情報とするときに、前記目標メモリサイズの初期値では前記要求合致バッファ割り当て情報が前記バッファ割り当て情報に存在しない場合に、前記目標メモリサイズをその初期値から増加させるように、前記目標メモリサイズ決定モジュールが構成される請求項1に記載のメモリ割り当て装置。 A target memory size determination module that determines a target memory size when a target value of the size of the memory area that may be used as the buffer is set as a target memory size;
The maximum value of the sum of the buffer memory sizes used by each process of the process combinations that may operate in parallel is set as the initial value of the target memory size. When the buffer allocation information that can always select the buffer to be used by the process even if the process is started is used as the request matching buffer allocation information, the request matching buffer allocation information is included in the buffer allocation information at the initial value of the target memory size. The memory allocation device according to claim 1, wherein the target memory size determination module is configured to increase the target memory size from its initial value when it does not exist.
前記目標メモリサイズをどのように決定するかに関する元の問題から部分問題を作成する部分問題作成モジュールをさらに備え、
前記排他関係にない処理の組合せであればどのような順序で処理が開始されても必ず処理が利用するバッファを選択できるようなバッファ割り当て情報を要求合致バッファ割り当て情報とするときに、前記部分問題の要求合致バッファ割り当て情報の必要メモリサイズを、前記元の問題の目標メモリサイズの初期値とするように、前記目標メモリサイズ決定モジュールが構成される請求項1ないし請求項6のいずれか1項に記載のメモリ割り当て装置。 A target memory size determination module that determines a target memory size when a target value of the size of the area of the memory that may be used as the buffer is set as a target memory size;
A partial problem creation module for creating a partial problem from an original problem on how to determine the target memory size;
When the request allocation buffer allocation information is used as buffer allocation information that can always select a buffer to be used in any order as long as it is a combination of processes that are not in the exclusive relationship, the partial problem 7. The target memory size determination module is configured so that the required memory size of the request matching buffer allocation information is an initial value of the target memory size of the original problem. A memory allocation device according to claim 1.
前記排他関係の情報を入力する排他関係情報入力モジュールと、
前記バッファとして利用される可能性のあるメモリ領域のサイズの目標値を目標メモリサイズとするときに、この目標メモリサイズを設定する目標メモリサイズ決定モジュールと、
前記目標メモリサイズ決定モジュールにより設定された前記目標メモリサイズ内で前記処理が実行可能なメモリ割り当てを探索するバッファ割り当て探索モジュールと、
前記処理情報入力モジュールおよび前記排他関係情報入力モジュールにより入力された情報を用いて、前記バッファ割り当て探索モジュールによる探索範囲を絞り込む探索範囲絞り込みモジュールと、
前記バッファ割り当て探索モジュールによる探索で得られた前記バッファ割り当て情報で、前記排他関係にない処理が実行可能かどうかを判定する実行可能/不可能判定モジュールを備え、
前記バッファメモリ範囲決定モジュールが、前記排他関係にない処理組合せであれば、どのような順序で処理が開始されても処理が利用する前記バッファを選択するように構成され、かつ、
前記バッファ割り当て情報出力モジュールが、前記静的バッファ領域のサイズが最小になるような前記バッファ割り当て情報を出力するように構成された請求項2に記載のメモリ割り当て装置。 A process information input module for inputting information on the set of process names and size information of the buffer used in one or more processes indicated by the set of process names;
An exclusive relationship information input module for inputting the exclusive relationship information;
A target memory size determination module for setting a target memory size when a target value of a size of a memory area that may be used as the buffer is set as a target memory size;
A buffer allocation search module that searches for a memory allocation capable of performing the processing within the target memory size set by the target memory size determination module;
A search range narrowing module that narrows down a search range by the buffer allocation search module using information input by the processing information input module and the exclusive relationship information input module;
An executable / impossible determination module that determines whether or not processing that is not in the exclusive relationship is executable in the buffer allocation information obtained by the search by the buffer allocation search module;
If the buffer memory range determination module is a processing combination that is not in the exclusive relationship, the buffer memory range determination module is configured to select the buffer used by the process regardless of the order in which the process is started, and
The memory allocation device according to claim 2, wherein the buffer allocation information output module is configured to output the buffer allocation information so that a size of the static buffer area is minimized.
前記バッファとして用いる連続領域を前記メモリ上に確保する必要のある1以上の処理を処理名の集合で表し、それら処理間で並列実行されない処理の組合せを排他関係で表し、前記処理がバッファとして利用可能な1つ以上のメモリ範囲候補をバッファ割り当て情報で表すときに、
前記メモリ割り当て装置が、
前記処理名の集合および前記排他関係に基づいて、前記バッファ割り当て情報を前記処理毎に出力するバッファ割り当て情報出力モジュールと、
前記処理名の集合に含まれる特定の処理を開始する際には、前記バッファ割り当て情報に記述されているメモリ範囲候補のうち、前記特定の処理を開始する時点で他の処理に利用されているメモリ範囲と重複しないメモリ範囲を選択するバッファメモリ範囲決定モジュールと、
選択された前記メモリ範囲を前記バッファとして前記メモリに確保し、確保されたバッファを用いて前記特定の処理を実行する処理モジュールを含んで構成される映像機器。 A memory including a continuous area used as a buffer when processing a data stream of video information, a data storage device for recording and reproducing the data stream buffered in the memory, and a continuous area used as the buffer on the memory In video equipment with a memory allocation device to allocate,
One or more processes that need to secure a continuous area used as the buffer in the memory are represented by a set of process names, a combination of processes that are not executed in parallel between the processes is represented by an exclusive relationship, and the process is used as a buffer. When representing one or more possible memory range candidates in buffer allocation information,
The memory allocation device is
A buffer allocation information output module that outputs the buffer allocation information for each process based on the set of process names and the exclusive relationship;
When starting a specific process included in the set of process names, the memory range candidates described in the buffer allocation information are used for other processes at the time of starting the specific process. A buffer memory range determination module for selecting a memory range that does not overlap with the memory range;
A video apparatus comprising a processing module that secures the selected memory range in the memory as the buffer and executes the specific processing using the secured buffer.
利用するバッファサイズが既知である処理に対して割り当てられるバッファ領域を静的バッファ領域とし、この静的バッファ領域以外のバッファ領域を動的バッファ領域とするときに、前記バッファとして利用可能な前記メモリの領域が前記静的バッファ領域と前記動的バッファ領域に分割される場合において、
前記処理名の集合に含まれる特定の処理を開始する際には、前記バッファ割り当て情報に記述されているメモリ範囲候補のうち、前記特定の処理を開始する時点で他の処理に利用されているメモリ範囲と重複しないメモリ範囲を選択し、
選択された前記メモリ範囲を前記静的バッファ領域として前記メモリに確保し、確保された前記静的バッファ領域を用いて前記特定の処理を実行するメモリ割り当て方法。 One or more processes that need to secure a continuous area used as a buffer in the memory are represented by a set of process names, a combination of processes that are not executed in parallel between the processes is represented by an exclusive relationship, and the processes can be used as a buffer A method of outputting the buffer allocation information for each process based on the set of process names and the exclusive relationship when one or more memory range candidates are represented by buffer allocation information,
The memory that can be used as the buffer when a buffer area allocated to a process with a known buffer size is a static buffer area and a buffer area other than the static buffer area is a dynamic buffer area Is divided into the static buffer area and the dynamic buffer area,
When starting a specific process included in the set of process names, the memory range candidates described in the buffer allocation information are used for other processes at the time of starting the specific process. Select a memory range that does not overlap with the memory range,
A memory allocation method that secures the selected memory range in the memory as the static buffer area, and executes the specific processing using the secured static buffer area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009182698A JP5159721B2 (en) | 2009-08-05 | 2009-08-05 | Memory allocation device and memory allocation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009182698A JP5159721B2 (en) | 2009-08-05 | 2009-08-05 | Memory allocation device and memory allocation method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011034510A true JP2011034510A (en) | 2011-02-17 |
JP5159721B2 JP5159721B2 (en) | 2013-03-13 |
Family
ID=43763488
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009182698A Expired - Fee Related JP5159721B2 (en) | 2009-08-05 | 2009-08-05 | Memory allocation device and memory allocation method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5159721B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102012202223A1 (en) | 2011-02-21 | 2012-08-23 | Kabushiki Kaisha Toyota Jidoshokki | LOADING DEVICE FOR AN ELECTRIC VEHICLE |
JP2014157952A (en) * | 2013-02-18 | 2014-08-28 | Nuflare Technology Inc | Charged particle beam drawing device, and data storage method for buffer memory |
JP2021012465A (en) * | 2019-07-04 | 2021-02-04 | 株式会社東芝 | Information processing apparatus, information processing method, and information processing system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06282446A (en) * | 1993-03-29 | 1994-10-07 | Hitachi Software Eng Co Ltd | Job schedule generating method |
JPH10326195A (en) * | 1997-05-26 | 1998-12-08 | Nec Corp | Signal processing system |
-
2009
- 2009-08-05 JP JP2009182698A patent/JP5159721B2/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06282446A (en) * | 1993-03-29 | 1994-10-07 | Hitachi Software Eng Co Ltd | Job schedule generating method |
JPH10326195A (en) * | 1997-05-26 | 1998-12-08 | Nec Corp | Signal processing system |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102012202223A1 (en) | 2011-02-21 | 2012-08-23 | Kabushiki Kaisha Toyota Jidoshokki | LOADING DEVICE FOR AN ELECTRIC VEHICLE |
US9120641B2 (en) | 2011-02-21 | 2015-09-01 | Kabushiki Kaisha Toyota Jidoshokki | Electric vehicle charger |
JP2014157952A (en) * | 2013-02-18 | 2014-08-28 | Nuflare Technology Inc | Charged particle beam drawing device, and data storage method for buffer memory |
KR101572490B1 (en) * | 2013-02-18 | 2015-11-27 | 가부시키가이샤 뉴플레어 테크놀로지 | Charged particle beam writing device and data storage method of buffer memory |
US9564293B2 (en) | 2013-02-18 | 2017-02-07 | Nuflare Technology, Inc. | Charged particle beam writing apparatus, and buffer memory data storage method |
JP2021012465A (en) * | 2019-07-04 | 2021-02-04 | 株式会社東芝 | Information processing apparatus, information processing method, and information processing system |
JP7362321B2 (en) | 2019-07-04 | 2023-10-17 | 株式会社東芝 | Information processing device, information processing method, and information processing system |
Also Published As
Publication number | Publication date |
---|---|
JP5159721B2 (en) | 2013-03-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8594481B2 (en) | Managing synchronization of media programs to portable devices | |
JP2007257566A (en) | Hash value producing program, storage management program and storage system | |
JP2010009653A (en) | Disk storage device and program | |
US7058770B2 (en) | Method and apparatus for controlling the recording of digital information, by using unit management table | |
JP5159721B2 (en) | Memory allocation device and memory allocation method | |
US20050138664A1 (en) | System and method for allocating resources in an adaptive media center processing system | |
US8478109B2 (en) | Recording apparatus and method, program, and storage medium | |
JP4502375B2 (en) | File system and control method thereof | |
JP2007249938A (en) | Usb host system, av data reproducing device and av data recording device | |
US20080186829A1 (en) | Recording apparatus and recording method for data and file system information | |
JP2005267669A (en) | Information processing device and method, program recording medium, and program | |
US20050259542A1 (en) | Reproduction device and method, recording medium, and program | |
JP2000341635A (en) | Recording method for hierarchical buffer memory and hierarchical buffer memory structure and data reproduction method and device therefor and video data edition system and computer readable recording medium and system on chip type integrated device | |
JP2006079463A (en) | Method, apparatus, system, and program for managing buffer for recording time series data | |
JPWO2008146473A1 (en) | Formatting device | |
US7382970B2 (en) | Process control manager for audio/video file system | |
JP4984677B2 (en) | Information processing device | |
JP5452125B2 (en) | Data processing apparatus and data processing method | |
JP5335215B2 (en) | Data storage device, data storage method and program | |
JP3631234B2 (en) | File data storage management method, file data storage device, program for executing processing for storing file data, and storage medium | |
JP2003296156A (en) | Information recording management device, data recording and regenerating device, information recording management method and file management method | |
JP3717922B2 (en) | File data storage management method, file data storage device, program for executing processing for storing file data, and storage medium | |
JP4694418B2 (en) | Recording / reproducing apparatus, partition creation method, partition creation program, and recording medium | |
JP2010087556A (en) | Image recording and reproducing apparatus, image recording and reproducing program, image recording and reproducing method | |
US7424573B2 (en) | Information processing apparatus, method, and program for formatting multiple recording media integrated as one |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120809 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120821 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121017 |
|
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: 20121113 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20121211 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20151221 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |