JP2013003679A - Program execution control method and program execution control device - Google Patents

Program execution control method and program execution control device Download PDF

Info

Publication number
JP2013003679A
JP2013003679A JP2011131580A JP2011131580A JP2013003679A JP 2013003679 A JP2013003679 A JP 2013003679A JP 2011131580 A JP2011131580 A JP 2011131580A JP 2011131580 A JP2011131580 A JP 2011131580A JP 2013003679 A JP2013003679 A JP 2013003679A
Authority
JP
Japan
Prior art keywords
program
execution
resource
passing
management means
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
Application number
JP2011131580A
Other languages
Japanese (ja)
Other versions
JP5469128B2 (en
Inventor
Fumihiko Sawazaki
文彦 澤崎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2011131580A priority Critical patent/JP5469128B2/en
Publication of JP2013003679A publication Critical patent/JP2013003679A/en
Application granted granted Critical
Publication of JP5469128B2 publication Critical patent/JP5469128B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve processing capability by sufficiently using CPU capability when executing many programs.SOLUTION: A program execution part 10 sets a passage point in a program, and informs that an execution part passes the passage point in such a case, and a program management part 20 stores a set value of the number of times of passage at the passage point in a plurality of execution stages per unit time, and requests a CPU time slice based upon the number of times of passage and the set value. A program management part 30 allocates CPU time slices to respective programs in order from a primary stage, and allocates CPU time slices in secondary and tertiary stages when CPU time slices per unit time are sufficient. Consequently, the processing capability can be improved by sufficiently using the CPU capability. Even a program which has low priority on the whole is executed preferentially as to processing of the primary stage.

Description

本発明は、負荷状況に応じてプログラムの実行を制御する技術に関する。   The present invention relates to a technique for controlling execution of a program according to a load situation.

交換などの組み込みシステムや公衆向けサービスを提供するシステムにおいては、遅延などの発生を抑制し、正常にサービスを継続して提供することが必要である。   In an embedded system such as an exchange or a system that provides a service for the public, it is necessary to suppress the occurrence of a delay and continuously provide the service normally.

従来技術において、プロセスに優先度をつけ、優先度の高いプロセスを優先的に処理する方法がある。プロセス優先度には、絶対優先度と相対優先度があり、絶対優先度は優先度順にプロセスを処理するものであり、相対優先度はプロセスの処理はラウンドロビンが前提で、優先度はCPUのタイムスライスの割当割合の指標値とするものである。現状のOSでは、これらの技術に基づいてプロセスのスケジュール管理を行っている。   In the prior art, there is a method for giving priority to a process and preferentially processing a process with a high priority. The process priority includes an absolute priority and a relative priority. The absolute priority processes processes in order of priority. The relative priority is based on the assumption that the process of the process is round robin. This is an index value of the allocation ratio of time slices. In the current OS, process schedule management is performed based on these technologies.

また、特定のイベントについて、イベント1件あたりのおおよその負荷を想定し、ある周期でのイベント受け入れ件数の上限を設定し、その上限を超えるイベントの受け入れをキャンセルすることで、イベント受け入れ量を平準化するシステムが考えられている。   Also, for a specific event, assuming an approximate load per event, setting an upper limit for the number of events accepted in a certain cycle, and canceling the acceptance of events exceeding the upper limit, leveling the event acceptance amount A system is being considered.

「マルチプロセッサ用リアルタイムOSの解説」、[online]、名古屋大学組込システム研究センター、[2011年5月27日検索]、インターネット〈URL:http://www.nces.is.nagoya-u.ac.jp/NEXCESS/blog/index.php?catid=44&blogid=5〉"Explanation of real-time OS for multiprocessor", [online], Nagoya University Embedded System Research Center, [May 27, 2011 search], Internet <URL: http: //www.nces.is.nagoya-u. ac.jp/NEXCESS/blog/index.php?catid=44&blogid=5>

しかしながら、プロセス優先度、特に絶対優先度が高いイベントが多量に発生し、CPUタイムスライスがプロセス優先度の高いイベントにすべて占められていた場合に、優先度が低いプロセスは動作不可となるという問題がある。例えば、システムの定期的なバックアップのようなプロセスはCPUタイムスライスを優先的に使用しないように優先度を低くしてもよいが、優先度が高いイベントが多量発生した場合でもバックアップ自体は行われる必要がある。   However, if a large number of events with high process priority, especially high absolute priority, occur and the CPU time slice is occupied by all events with high process priority, the process with low priority becomes inoperable. There is. For example, a process such as periodic backup of the system may have a low priority so that the CPU time slice is not preferentially used, but the backup itself is performed even when a large number of high priority events occur. There is a need.

このような場合を想定し、CPUの負荷状態を監視して、CPUが高負荷となった場合に、優先度の高いイベントをキャンセルし、CPUタイムスライスに余力を持たせることで優先度の低いプロセスにCPUタイムスライスを割り当てるシステムが考えられているが、CPUタイムスライスに余力を残す方法では、常に使用されないCPUタイムスライスが発生するという問題がある。また、CPUの負荷状態は統計量としてOS等にて測定されるものであり、測定から統計量として計算されるための時間が必要となり、多量のイベント発生による高負荷状態発生からイベントキャンセルまでのタイムラグが存在するという問題がある。   Assuming such a case, the CPU load state is monitored, and when the CPU is heavily loaded, the event with a high priority is canceled and the CPU time slice is given a low priority, thereby lowering the priority. A system that assigns CPU time slices to processes is considered. However, the method that leaves the CPU time slice has a problem that a CPU time slice that is not always used is generated. Further, the CPU load state is measured by the OS or the like as a statistic, and it takes time to be calculated as a statistic from the measurement. From a high load state due to the occurrence of a large number of events to event cancellation There is a problem that a time lag exists.

受け入れ件数の上限を設定する方法では、計算結果から算出された上限値よりも実際に受け入れ可能な件数は多く、CPU能力を十分に使用していないという問題がある。上限値を超えたイベントは、処理中イベントとして内部保留されたり、次周期に持ち越された後で処理されるが、実際には、イベント発生件数には揺らぎがある場合がほとんどで、イベント発生件数の揺らぎによっては上限値を超えたイベントも処理できてしまう。逆に、計算結果よりも大きい件数を上限値として設定した場合、揺らぎによっては処理しきれないケースが発生する。   In the method of setting the upper limit of the number of accepted cases, there is a problem that the number of cases that can be actually accepted is larger than the upper limit value calculated from the calculation result, and the CPU capacity is not sufficiently used. Events that exceed the upper limit are internally held as a processing event or processed after being carried over to the next cycle, but in actuality, the number of event occurrences often fluctuates. Depending on the fluctuation of the event, the event exceeding the upper limit can be processed. On the contrary, when the number of cases larger than the calculation result is set as the upper limit value, there may be a case where processing cannot be performed due to fluctuation.

本発明は、上記に鑑みてなされたものであり、多数のプログラムに実行する際に、CPU能力を十分に使用して処理能力を向上させることを目的とする。   The present invention has been made in view of the above, and an object of the present invention is to improve the processing capability by sufficiently using the CPU capability when executing a large number of programs.

第1の本発明に係るプログラム実行制御方法は、複数のプログラムにプログラムの実行に必要なリソースを割り当ててプログラムの実行を制御するプログラム実行制御方法であって、プログラム実行手段による、前記リソースを利用してプログラムを実行し、当該プログラムの実行箇所が予め設定された通過ポイントを通過した場合に通過ポイントを通過した通知を送信するステップと、プログラム管理手段による、前記通知を受信して前記通知の受信回数をカウントするとともに、前記通過ポイントの通過回数の設定値を単位時間当たりの複数の実行段階に分けて設定して記憶する記憶手段に記憶された前記設定値に基づいて前記リソースを要求し、当該リソースを前記プログラム実行手段に渡してプログラムの実行制御を行うプログラム管理手段と、プロセス管理手段による、単位時間毎に、前記複数の実行段階のうち優先度の高い実行段階から順に単位時間の終了まで前記リソースを各プログラムに割り当てるステップと、を有することを特徴とする。   A program execution control method according to a first aspect of the present invention is a program execution control method for controlling execution of a program by allocating resources necessary for program execution to a plurality of programs, wherein the resources are used by the program execution means. The program is executed, and when the execution location of the program passes a preset passing point, a notification of passing the passing point is received, and the notification by the program management means is received and the notification Counting the number of receptions, and requesting the resource based on the set value stored in the storage means for setting and storing the set value of the number of passes of the passing point divided into a plurality of execution stages per unit time And a program for controlling execution of the program by passing the resource to the program execution means And assigning the resources to each program in order from the execution stage having the highest priority among the plurality of execution stages to the end of the unit time, for each unit time by the management means and the process management means, To do.

上記プログラム実行制御方法において、前記プログラム管理手段は、前記受信回数が前記設定値に達した時点あるいは超えた時点で、前記リソースを前記プロセス管理手段に戻すことを特徴とする。   In the program execution control method, the program management means returns the resource to the process management means when the number of receptions reaches or exceeds the set value.

上記プログラム実行制御方法において、前記プログラム管理手段は、前記実行段階毎に、各通過ポイントの当該実行段階における前記設定値と前記通過ポイントを通過してから次の通過ポイントを通過するまでの負荷を乗算した値の和から必要な前記リソースを求めて前記プロセス管理手段に要求することを特徴とする。   In the program execution control method, for each execution stage, the program management means loads the set value of each passing point in the execution stage and the load from passing through the passing point to passing through the next passing point. The necessary resource is obtained from the sum of the multiplied values and requested to the process management means.

上記プログラム実行制御方法において、前記プログラム管理手段は、単位時間当たりに利用した前記リソースの統計量を前記プロセス管理手段から取得して単位時間当たりの前記受信回数で割り前記負荷を算出することを特徴とする。   In the program execution control method, the program management unit obtains a statistic of the resource used per unit time from the process management unit and divides by the number of receptions per unit time to calculate the load. And

第2の本発明に係るプログラム実行制御装置は、複数のプログラムにプログラムの実行に必要なリソースを割り当ててプログラムの実行を制御するプログラム実行制御装置であって、前記リソースを利用してプログラムを実行し、当該プログラムの実行箇所が予め設定された通過ポイントを通過した場合に通過ポイントを通過した通知を送信するプログラム実行手段と、前記通過ポイントの通過回数の設定値を単位時間当たりの複数の実行段階に分けて設定して記憶する記憶手段と、前記通知を受信して前記通知の受信回数をカウントするとともに、前記記憶手段に記憶された前記設定値に基づいて前記リソースを要求し、当該リソースを前記プログラム実行手段に渡してプログラムの実行制御を行うプログラム管理手段と、単位時間毎に、前記複数の実行段階のうち優先度の高い実行段階から順に単位時間の終了まで前記リソースを各プログラムに割り当てるプロセス管理手段と、を有することを特徴とする。   A program execution control device according to a second aspect of the present invention is a program execution control device that controls program execution by allocating resources necessary for program execution to a plurality of programs, and executes the program using the resources. And a program execution means for transmitting a notification of passing through the passage point when the execution location of the program passes through a preset passage point, and a plurality of executions per unit time of the set number of passage times of the passage point. Storage means for setting and storing in stages, receiving the notification and counting the number of receptions of the notification, requesting the resource based on the set value stored in the storage means, A program management means for controlling the execution of the program by passing the program execution means, and for each unit time, The resource from high priority execution stage until the end of the unit time in the order of the serial plurality of execution stages and having a a process management unit assigned to each program.

本発明によれば、多数のプログラムに実行する際に、CPU能力を十分に使用して処理能力を向上させることができる。   According to the present invention, when executing a large number of programs, the CPU capability can be fully used to improve the processing capability.

本実施の形態におけるプログラム実行制御装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the program execution control apparatus in this Embodiment. プログラムの実行状態の遷移の例を示す図である。It is a figure which shows the example of a transition of the execution state of a program. 第1の方法のプログラム実行制御処理を示すシーケンス図である。It is a sequence diagram which shows the program execution control process of a 1st method. 第2の方法のプログラム実行制御処理を示すシーケンス図である。It is a sequence diagram which shows the program execution control processing of the 2nd method. 多段階でCPUタイムスライスを割り当てる様子を示す図である。It is a figure which shows a mode that CPU time slice is allocated in multiple steps.

以下、本発明の実施の形態について図面を用いて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本実施の形態におけるプログラム実行制御装置の構成を示す機能ブロック図である。同図に示すプログラム実行制御装置は、プログラム実行部10、プログラム管理部20、およびプロセス管理部30を備える。プログラム実行制御装置が備える各部は、演算処理装置、記憶装置等を備えたコンピュータにより構成して、各部の処理がプログラムによって実行されるものとしてもよい。このプログラムはプログラム実行制御装置が備える記憶装置に記憶されており、磁気ディスク、光ディスク、半導体メモリ等の記録媒体に記録することも、ネットワークを通して提供することも可能である。   FIG. 1 is a functional block diagram showing the configuration of the program execution control device in the present embodiment. The program execution control apparatus shown in FIG. 1 includes a program execution unit 10, a program management unit 20, and a process management unit 30. Each unit included in the program execution control device may be configured by a computer including an arithmetic processing device, a storage device, and the like, and the processing of each unit may be executed by a program. This program is stored in a storage device included in the program execution control device, and can be recorded on a recording medium such as a magnetic disk, an optical disk, or a semiconductor memory, or provided through a network.

プログラム実行部10は、プロセス管理部30から割り当てられたCPUタイムスライスを利用してプログラムを実行し、プログラムの実行箇所が所定の通過ポイントを通過した場合に通過ポイントを通過した旨をプログラム管理部20に通知する。図2に、プログラムの実行状態の遷移の例を示す。同図では、3つの実行状態111,112,113を示しており、実行状態111,112,113それぞれの処理の開始点に通過ポイント121,122,123が設定されている。プログラム実行部10は、プログラムを実行し、プログラムの実行箇所が予めプログラム本体に設定された通過ポイント121,122,123に到達した場合に、プログラム管理部20に通過ポイント121,122,123を通過した旨を通知する。   The program execution unit 10 executes the program using the CPU time slice assigned by the process management unit 30, and indicates that the program has passed the passing point when the execution location of the program passes a predetermined passing point. 20 is notified. FIG. 2 shows an example of transition of the execution state of the program. In the figure, three execution states 111, 112, and 113 are shown, and passing points 121, 122, and 123 are set as the start points of the processes in the execution states 111, 112, and 113, respectively. The program execution unit 10 executes the program and passes the passage points 121, 122, 123 to the program management unit 20 when the execution location of the program reaches the passage points 121, 122, 123 set in the program body in advance. Notify that it has been done.

プログラム管理部20は、プログラムを実行するためのCPUタイムスライスの要求、プログラム実行部10からの通知のカウント及び応答、プログラム実行時の負荷の測定など、プログラム実行部10のプログラムの実行を管理する。   The program management unit 20 manages the execution of the program of the program execution unit 10, such as a request for a CPU time slice for executing the program, a count and response of notifications from the program execution unit 10, and a load measurement during program execution. .

また、プログラム管理部20は、図1に示すように、プログラムそれぞれについて、プログラムの通過ポイント121,122,123毎に、通知された通過の回数と1次、2次、3次と多段階に設定された通過回数の設定値を記載する通過ポイント情報21を記憶している。プログラム実行部10から通過ポイント121,122,123の通過が通知されると通過ポイント情報21に記載された通過回数が更新される。なお、通過回数の設定値はプログラム毎に予め定めておき、通過回数はプログラム起動時に初期化される。   Further, as shown in FIG. 1, the program management unit 20 multi-stages each of the programs for each passing point 121, 122, 123 of the program, and for the number of times of passing and the first, second, third and third. Passing point information 21 describing the set value of the set number of passages is stored. When the passage of the passing points 121, 122, 123 is notified from the program execution unit 10, the number of times of passing described in the passing point information 21 is updated. Note that the set value of the number of passes is predetermined for each program, and the number of passes is initialized when the program is started.

プロセス管理部30は、単位時間内に多段階に設定された1次、2次、3次といった実行段階のうち優先度の高い実行段階から順に、プログラム管理部20から各プログラムについて要求されたCPUタイムスライスを集計し、各プログラムの実行順序をスケジューリングして、CPUタイムスライスをプログラム管理部20経由でプログラムに割り当てる。また、プロセス管理部30は、単位時間当たりの各プログラムのCPUタイムスライスの統計量を求めておき、プログラム管理部20からの要求に応じてCPUタイムスライスの統計量を通知する。   The process management unit 30 is a CPU requested for each program from the program management unit 20 in order from the execution stage with the highest priority among the execution stages such as primary, secondary, and tertiary set in multiple stages within a unit time. The time slices are totaled, the execution order of each program is scheduled, and the CPU time slice is assigned to the program via the program management unit 20. Further, the process management unit 30 obtains the statistics of the CPU time slice of each program per unit time, and notifies the statistics of the CPU time slice in response to a request from the program management unit 20.

なお、プログラムとプログラム管理部20は1対1の関係であり、プロセス管理部30とプログラム管理部20あるいはプログラムとは1対多の関係である。本実施の形態では、プログラムを起動する度に、プログラムを管理する管理プログラムをコンピュータに実行させてプログラム管理部20として機能させる。複数のプログラムが実行される場合は、複数のプログラム管理部20が存在することになり、各プログラム管理部20からCPUタイムスライスの要求がプロセス管理部30に送信される。   The program and the program management unit 20 have a one-to-one relationship, and the process management unit 30 and the program management unit 20 or the program have a one-to-many relationship. In the present embodiment, each time the program is started, a management program for managing the program is executed by the computer so as to function as the program management unit 20. When a plurality of programs are executed, a plurality of program management units 20 exist, and a request for a CPU time slice is transmitted from each program management unit 20 to the process management unit 30.

次に、プログラムの実行制御処理について説明する。   Next, program execution control processing will be described.

本実施の形態におけるプログラムの実行制御方法には2つの方法がある。第1の方法は、プログラムから通知された通過回数をカウントし、通過回数が通過ポイント情報21の設定値に達した場合に制御をプロセス管理部30に戻す方法であり、第2の方法は、通過ポイント情報21の設定値と一通過あたりの処理負荷の積から必要なCPUタイムスライスを求めてプロセス管理部30に要求し、割り当てられたCPUタイムスライスを使い切った時点で制御をプロセス管理部30に戻す方法である。   There are two methods for controlling the execution of a program in the present embodiment. The first method is a method of counting the number of passages notified from the program, and returning the control to the process management unit 30 when the number of passages reaches the set value of the passage point information 21, and the second method is: A required CPU time slice is obtained from the product of the set value of the passage point information 21 and the processing load per passage, and requested to the process management unit 30. When the allocated CPU time slice is used up, the process management unit 30 performs control. It is a method to return to.

まず、第1の方法について説明する。   First, the first method will be described.

図3は、第1の方法のプログラム実行制御処理を示すシーケンス図である。第1の方法では、プロセス管理部30のプログラムディスパッチ(CPUの処理能力の割り当て)をプログラム走りきりとした。走りきりとは、プログラムのディスパッチの通知を一時的にマスクしてプログラムを実行し続ける実行方法である。   FIG. 3 is a sequence diagram showing a program execution control process of the first method. In the first method, the program dispatch (allocation of CPU processing capacity) of the process management unit 30 is a program run. Run-all is an execution method that continues to execute a program while temporarily masking the dispatch notification of the program.

プロセス管理部30がCPUの処理能力をプログラム管理部20を通じてプログラムの実行に割り当てて、プログラムが実行される(ステップS11,S12)。   The process management unit 30 assigns the processing capability of the CPU to the execution of the program through the program management unit 20, and the program is executed (steps S11 and S12).

プログラム実行部10は、プログラムの実行箇所が通過ポイントを通る毎にプログラム管理部20に通知する(ステップS13)。   The program execution unit 10 notifies the program management unit 20 every time the execution location of the program passes the passing point (step S13).

プログラム管理部20は、通過ポイント情報21の通過回数を更新し、通過回数が1次分の設定値より小さい場合は通過OKであることをプログラム実行部10に通知する(ステップS14)。   The program management unit 20 updates the number of passages of the passage point information 21, and notifies the program execution unit 10 that the passage is OK when the number of passages is smaller than the set value for the first order (step S14).

プログラム実行部10が通過ポイントの通過をプログラム管理部20に通知したときに、通過回数が1次分の設定値に達した時点でプロセス管理部30に制御を戻す(ステップS15,S16)。あるいは、通過回数が設定値に達しない時点で単位時間当たりのプログラムの処理が終了した場合は、プロセス管理部30に制御を戻す。   When the program execution unit 10 notifies the program management unit 20 that the passage point has been passed, control is returned to the process management unit 30 when the number of passages reaches the set value for the first order (steps S15 and S16). Alternatively, when the processing of the program per unit time is completed when the number of passages does not reach the set value, the control is returned to the process management unit 30.

プロセス管理部30は、制御が戻されると、別のプログラムにCPUの処理能力を割り当てる。全てのプログラムの1次分の処理が完了したときに単位時間当たりのCPUリソースに余分があれば、2次分、3次分のプログラムの実行制御処理が行われる。単位時間が経過したら、次の単位時間において再び1次分の実行段階から順に処理を行う。   When the control is returned, the process management unit 30 assigns the processing capacity of the CPU to another program. If there is an extra CPU resource per unit time when the processing for the first order of all programs is completed, execution control processing for the second and third order programs is performed. When the unit time elapses, the process is performed again in order from the execution stage for the first order in the next unit time.

続いて、第2の方法について説明する。   Subsequently, the second method will be described.

図4は、第2の方法のプログラム実行制御処理を示すシーケンス図である。第2の方法では、プロセス管理部30のプログラムディスパッチをタイムスライス割当とした。割り当てるCPUタイムスライスは、通過ポイント情報21に記載された設定値と処理負荷により決定する。   FIG. 4 is a sequence diagram showing the program execution control process of the second method. In the second method, the program dispatch of the process management unit 30 is time slice allocation. The CPU time slice to be assigned is determined by the set value and processing load described in the passing point information 21.

プログラム管理部20は、各通過ポイントの1次分の設定値と一通過あたりの処理負荷の積を求め、その和から必要なCPUタイムスライスをプロセス管理部30に要求する(ステップS21)。CPUタイムスライスの要求はプログラム起動時に行う。もしくは、単位時間毎に次の単位時間のCPUタイムスライス要求として実施してもよい。なお、一通過あたりの処理負荷の算出については後述する。   The program management unit 20 obtains the product of the set value for the first order of each passing point and the processing load per pass, and requests the required CPU time slice from the sum to the process management unit 30 (step S21). The CPU time slice request is made when the program is started. Alternatively, it may be implemented as a CPU time slice request for the next unit time every unit time. The calculation of the processing load per pass will be described later.

プロセス管理部30は、各プログラムの要求をスケジューリングして各プログラムにCPUタイムスライスを割り振り、CPUタイムスライスをプログラム管理部20を通じてプログラムの実行に割り当てて、プログラムが実行される(ステップS22,S23)。   The process management unit 30 schedules requests for each program, allocates a CPU time slice to each program, assigns the CPU time slice to program execution through the program management unit 20, and executes the program (steps S22 and S23). .

プログラム管理部20は、割り当てられたCPUタイムスライスを使い切った時点でプロセス管理部30に制御を戻す(ステップS24)。あるいは、CPUタイムスライスを使い切らないで単位時間当たりのプログラムの処理が終了した場合は、プロセス管理部30に制御を戻す。   The program management unit 20 returns control to the process management unit 30 when the allocated CPU time slice is used up (step S24). Alternatively, when the processing of the program per unit time is completed without using up the CPU time slice, the control is returned to the process management unit 30.

プロセス管理部30は、制御が戻されると、別のプログラムにCPUタイムスライスを割り当てる。全てのプログラムの1次分の処理が完了したときに単位時間当たりのCPUリソースに余分があれば、2次分、3次分のプログラムの実行制御処理が行われる。単位時間が経過したら、次の単位時間において再び1次分の実行段階から順に処理を行う。   When the control is returned, the process management unit 30 assigns a CPU time slice to another program. If there is an extra CPU resource per unit time when the processing for the first order of all programs is completed, execution control processing for the second and third order programs is performed. When the unit time elapses, the process is performed again in order from the execution stage for the first order in the next unit time.

次に、プロセス管理部30によるスケジューリングについて説明する。   Next, scheduling by the process management unit 30 will be described.

通過回数の設定値は1次、2次、3次・・・と多段階に設定されており、全てのプログラムの1次分の処理が完了したときに単位時間当たりのCPUリソースに余分があれば、2次分、3次分のプログラムの実行制御処理が行われる。   The set value of the number of passes is set in multiple stages such as primary, secondary, tertiary, etc., and there is an extra CPU resource per unit time when the primary processing of all programs is completed. For example, execution control processing of secondary and tertiary programs is performed.

図5に、多段階でCPUタイムスライスを割り当てる様子を示す。   FIG. 5 shows how CPU time slices are assigned in multiple stages.

図5(a)に示すように、プロセス管理部30は、多数のプログラムから1次分のCPUタイムスライスが要求されるので、1次分の要求を集計し、実行順序をスケジューリングし、各プログラムに対してCPUタイムスライスを割り当てる。図5(a)では、符号100A〜Dで示す部分が各プログラムから要求されて割り当てたCPUタイムスライスを示す。   As shown in FIG. 5A, the process management unit 30 requests a primary CPU time slice from a large number of programs. Therefore, the process management unit 30 totals the primary requests and schedules the execution order. CPU time slice is assigned to. In FIG. 5A, the portions indicated by reference numerals 100A to 100D indicate CPU time slices assigned and requested by each program.

プロセス管理部30から各プログラムに対してCPUタイムスライスが割り当てられて順次プログラムが実行され、1次分の処理実績が確定した時点でCPUタイムスライスに余分があれば、図5(b)に示すように2次分のスケジューリングを行い、CPUタイムスライスを各プログラムに対して割り当てる。図5(b)では、符号100で示す部分が1次分で使用されたCPUタイムスライスの実績を示し、符号200A〜Dで示す部分が2次分として各プログラムから要求されて割り当てたCPUタイムスライスを示す。以下同様に、2次分処理後に余分なCPUタイムスライスがあれば3次分をスケジューリングする。なお、多段階の処理分をすべて処理後にもCPUタイムスライスに余分があれば、既存のタイムスライス割当論理などに従いCPUタイムスライスを割り当てる。   If the CPU time slice is allocated to each program from the process management unit 30 and the program is sequentially executed and the processing time for the first order is determined, there is an excess in the CPU time slice, as shown in FIG. Thus, scheduling for the second order is performed, and a CPU time slice is assigned to each program. In FIG. 5 (b), the portion indicated by reference numeral 100 indicates the performance of the CPU time slice used for the primary part, and the part indicated by reference numerals 200A to 200D is assigned to the CPU time requested by each program as the secondary part. Indicates a slice. Similarly, if there is an extra CPU time slice after the secondary processing, the tertiary is scheduled. Note that if there is an excess in the CPU time slice after all the multi-stage processing is processed, the CPU time slice is allocated according to the existing time slice allocation logic or the like.

次に、通過ポイントを用いた負荷測定について説明する。   Next, load measurement using a passing point will be described.

プログラム管理部20は、プログラムの実行箇所が所定の通過ポイントを通過した場合に通知を受けて通過回数をカウントする。プロセス管理部30は、単位時間当たりの各プログラムのCPUタイムスライスの統計量を求める。プログラム管理部20は、CPUタイムスライスの統計量をプロセス管理部30に問い合わせ、単位時間当たりのタイムスライスの統計量と通過ポイントの通過回数より単位時間当たりの1通過の負荷を算出する。   The program management unit 20 receives a notification and counts the number of passages when the execution location of the program passes a predetermined passage point. The process management unit 30 obtains the statistics of the CPU time slice of each program per unit time. The program management unit 20 inquires the statistics of the CPU time slice to the process management unit 30, and calculates the load of one pass per unit time from the statistics of the time slice per unit time and the number of passages of the passing points.

現在のOS(オペレーティングシステム)はプロセス単位でCPU使用率などの負荷の統計をとっていることが多い。負荷と1通過の処理負荷の関係は、1通過の処理負荷を変数とし、通過回数をパラメータとした多元方程式で表される。1通過の処理負荷をx〜x、通過回数をa〜a、CPUタイムスライスの統計値をLとした場合次式となる。 Current OSs (operating systems) often take statistics of loads such as CPU usage on a process basis. The relationship between the load and the one-pass processing load is represented by a multiple equation using the one-pass processing load as a variable and the number of passes as a parameter. When the processing load for one pass is x 1 to x n , the number of passes is a 1 to a n , and the statistical value of the CPU time slice is L, the following equation is obtained.

L=a+a+・・・+a
プログラムへの入力を変更することにより、複数の多元方程式が得られるのでそれを計算することで1通過の処理負荷を求めることができる。a〜aの負荷割合はある程度の周期で統計をとった場合に同じような割合になることが多い。その場合はx〜xの処理をもとめたものを考えてXとし、通過回数をAとすると以下といえる。
L = a 1 x 1 + a 2 x 2 +... + An x n
By changing the input to the program, a plurality of multi-way equations can be obtained, so that the processing load for one pass can be obtained by calculating them. a 1 loading ratio of ~a n is often a similar rate when taking statistics at a certain period. In that case, it can be said that X is considered in consideration of the processing of x 1 to x n and A is the number of passes.

L=A×X
これを計算することによって1通過あたりの平均の処理負荷を求めることができる。
L = A × X
By calculating this, the average processing load per pass can be obtained.

次に、各実行段階における通過回数の設定について説明する。   Next, the setting of the number of passes in each execution stage will be described.

1次分など低次の段階では、システムが輻輳した場合でも必ず処理しなくてはならない処理とその処理に対する通過回数を設定しておく。これにより、輻輳中でもその処理が設定値分処理されることが保証される。逆に、輻輳中に抑止したい処理については、通過回数を0もしくは抑止したい処理分のCPUタイムスライスとなるように設定する。   In a low-order stage such as the first order, a process that must be processed even when the system is congested and the number of passes for the process are set. This ensures that the processing is performed for the set value even during congestion. Conversely, for a process that is desired to be suppressed during congestion, the number of passes is set to 0 or a CPU time slice for the process that is desired to be suppressed.

高次の段階では、プログラムの処理が一定時間内に終わるようにする、一定時間内のイベント処理量がある一定値を超えるようにするなど、システムが対外的に保証する性能等に基づき設定値を決定する。これにより、輻輳中でない場合にプログラムの処理性能が保証される。その間の段階では、輻輳/負荷レベルに沿った性能や実行したい内容を上記と同様に設定することによって保証される。   At higher levels, set values based on the performance that the system guarantees externally, such as allowing program processing to finish within a certain period of time, or ensuring that the amount of event processing within a certain period of time exceeds a certain value. To decide. This guarantees the processing performance of the program when it is not congested. In the meantime, it is guaranteed by setting the performance according to the congestion / load level and the content to be executed in the same manner as described above.

また、処理の上限回数を定義しておき、優先度の低いプログラムがCPUタイムスライスを使用しすぎないようにする。   In addition, the upper limit number of processes is defined so that a low-priority program does not use the CPU time slice too much.

以上説明したように、本実施の形態によれば、プログラム実行部10が、プログラムに通過ポイントを設定して実行箇所が通過ポイントを通過したときに通知し、プログラム管理部20が、単位時間当たりの複数の実行段階に分けて通過ポイントの通過回数の設定値を記憶しておき、通過回数と設定値に基づいてCPUタイムスライスを要求し、プロセス管理部30が、単位時間毎に、1次分から順にCPUタイムスライスを各プログラムに割り当てて、単位時間のCPUタイムスライスに余裕がある場合は、2次分、3次分と割り当てることで、CPU能力を十分に使用して処理能力を向上させることができる。全体として優先度が低いプログラムについても、1次分とした処理については優先的に実行される。   As described above, according to the present embodiment, the program execution unit 10 sets a passing point in the program and notifies when the execution point passes the passing point, and the program management unit 20 performs the unit per unit time. The setting value of the passing number of passage points is stored in a plurality of execution stages, and a CPU time slice is requested based on the passing number and the setting value, and the process management unit 30 performs primary processing every unit time. If CPU time slices are assigned to each program in order from the minute, and there is room in the CPU time slice of the unit time, the CPU capacity is fully used to improve the processing capacity by assigning the secondary part and the tertiary part. be able to. Even for a program having a low priority as a whole, the primary processing is preferentially executed.

10…プログラム実行部
20…プログラム管理部
30…プロセス管理部
21…通過ポイント情報
DESCRIPTION OF SYMBOLS 10 ... Program execution part 20 ... Program management part 30 ... Process management part 21 ... Passing point information

Claims (8)

複数のプログラムにプログラムの実行に必要なリソースを割り当ててプログラムの実行を制御するプログラム実行制御方法であって、
プログラム実行手段による、前記リソースを利用してプログラムを実行し、当該プログラムの実行箇所が予め設定された通過ポイントを通過した場合に通過ポイントを通過した通知を送信するステップと、
プログラム管理手段による、前記通知を受信して前記通知の受信回数をカウントするとともに、前記通過ポイントの通過回数の設定値を単位時間当たりの複数の実行段階に分けて設定して記憶する記憶手段に記憶された前記設定値に基づいて前記リソースを要求し、当該リソースを前記プログラム実行手段に渡してプログラムの実行制御を行うプログラム管理手段と、
プロセス管理手段による、単位時間毎に、前記複数の実行段階のうち優先度の高い実行段階から順に単位時間の終了まで前記リソースを各プログラムに割り当てるステップと、
を有することを特徴とするプログラム実行制御方法。
A program execution control method for controlling program execution by allocating resources necessary for program execution to a plurality of programs,
Executing a program using the resource by the program execution means, and transmitting a notification of passing through the passage point when the execution location of the program passes through a preset passage point;
A storage unit that receives the notification by the program management unit and counts the number of times the notification is received, and stores the setting value of the number of passages of the passing point in a plurality of execution stages per unit time. Program management means for requesting the resource based on the stored setting value, passing the resource to the program execution means, and controlling execution of the program;
A step of assigning the resources to each program in order from the execution stage having a high priority among the plurality of execution stages to the end of the unit time for each unit time by the process management means;
A program execution control method comprising:
前記プログラム管理手段は、前記受信回数が前記設定値に達した時点あるいは超えた時点で、前記リソースを前記プロセス管理手段に戻すことを特徴とする請求項1記載のプログラム実行制御方法。   2. The program execution control method according to claim 1, wherein the program management means returns the resource to the process management means when the number of receptions reaches or exceeds the set value. 前記プログラム管理手段は、前記実行段階毎に、各通過ポイントの当該実行段階における前記設定値と前記通過ポイントを通過してから次の通過ポイントを通過するまでの負荷を乗算した和から必要な前記リソースを求めて前記プロセス管理手段に要求することを特徴とする請求項1記載のプログラム実行制御方法。   The program management means, for each execution stage, the necessary value from the sum obtained by multiplying the set value at the execution stage of each passing point and the load from passing through the passing point to passing through the next passing point. 2. The program execution control method according to claim 1, wherein said process management means is requested for a resource. 前記プログラム管理手段は、単位時間当たりに利用した前記リソースの統計量を前記プロセス管理手段から取得して単位時間当たりの前記受信回数で割り前記負荷を算出することを特徴とする請求項3記載のプログラム実行制御方法。   The said program management means acquires the statistics of the said resource used per unit time from the said process management means, divides by the said frequency | count of reception per unit time, and calculates the said load. Program execution control method. 複数のプログラムにプログラムの実行に必要なリソースを割り当ててプログラムの実行を制御するプログラム実行制御装置であって、
前記リソースを利用してプログラムを実行し、当該プログラムの実行箇所が予め設定された通過ポイントを通過した場合に通過ポイントを通過した通知を送信するプログラム実行手段と、
前記通過ポイントの通過回数の設定値を単位時間当たりの複数の実行段階に分けて設定して記憶する記憶手段と、
前記通知を受信して前記通知の受信回数をカウントするとともに、前記記憶手段に記憶された前記設定値に基づいて前記リソースを要求し、当該リソースを前記プログラム実行手段に渡してプログラムの実行制御を行うプログラム管理手段と、
単位時間毎に、前記複数の実行段階のうち優先度の高い実行段階から順に単位時間の終了まで前記リソースを各プログラムに割り当てるプロセス管理手段と、
を有することを特徴とするプログラム実行制御装置。
A program execution control device that controls execution of a program by allocating resources necessary for program execution to a plurality of programs,
Program execution means for executing a program using the resource, and transmitting a notification that the program has passed through the passage point when the execution location of the program passes through a preset passage point;
Storage means for setting and storing a set value of the number of times of passage of the passing point divided into a plurality of execution stages per unit time;
The notification is received, the number of times the notification is received is counted, the resource is requested based on the setting value stored in the storage unit, and the resource is passed to the program execution unit to control execution of the program. Program management means to perform,
Process management means for allocating the resources to each program in order from the execution stage having the highest priority among the plurality of execution stages until the end of the unit time for each unit time;
A program execution control device comprising:
前記プログラム管理手段は、前記受信回数が前記設定値に達した時点あるいは超えた時点で、前記リソースを前記プロセス管理手段に戻すことを特徴とする請求項5記載のプログラム実行制御装置。   6. The program execution control device according to claim 5, wherein the program management means returns the resource to the process management means when the number of receptions reaches or exceeds the set value. 前記プログラム管理手段は、前記実行段階毎に、各通過ポイントの当該実行段階における前記設定値と前記通過ポイントを通過してから次の通過ポイントを通過するまでの負荷を乗算した和から必要な前記リソースを求めて前記プロセス管理手段に要求することを特徴とする請求項5記載のプログラム実行制御装置。   The program management means, for each execution stage, the necessary value from the sum obtained by multiplying the set value at the execution stage of each passing point and the load from passing through the passing point to passing through the next passing point. 6. The program execution control apparatus according to claim 5, wherein a resource is requested from the process management means. 前記プログラム管理手段は、単位時間当たりに利用した前記リソースの統計量を前記プロセス管理手段から取得して単位時間当たりの前記受信回数で割り前記負荷を算出することを特徴とする請求項7記載のプログラム実行制御装置。   8. The program management unit according to claim 7, wherein the program management unit obtains a statistic of the resource used per unit time from the process management unit and divides by the number of receptions per unit time to calculate the load. Program execution control device.
JP2011131580A 2011-06-13 2011-06-13 Program execution control method and program execution control apparatus Expired - Fee Related JP5469128B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011131580A JP5469128B2 (en) 2011-06-13 2011-06-13 Program execution control method and program execution control apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011131580A JP5469128B2 (en) 2011-06-13 2011-06-13 Program execution control method and program execution control apparatus

Publications (2)

Publication Number Publication Date
JP2013003679A true JP2013003679A (en) 2013-01-07
JP5469128B2 JP5469128B2 (en) 2014-04-09

Family

ID=47672215

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011131580A Expired - Fee Related JP5469128B2 (en) 2011-06-13 2011-06-13 Program execution control method and program execution control apparatus

Country Status (1)

Country Link
JP (1) JP5469128B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066321A (en) * 2016-01-21 2017-08-18 罗伯特·博世有限公司 The method and apparatus for being performed in parallel multiple threads for standard

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102017001765A1 (en) 2016-02-29 2017-09-14 Fanuc Corporation NUMERICAL CONTROL FOR TOOL MACHINE

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107066321A (en) * 2016-01-21 2017-08-18 罗伯特·博世有限公司 The method and apparatus for being performed in parallel multiple threads for standard

Also Published As

Publication number Publication date
JP5469128B2 (en) 2014-04-09

Similar Documents

Publication Publication Date Title
Ren et al. Hopper: Decentralized speculation-aware cluster scheduling at scale
KR102207050B1 (en) Methods and apparatus to manage jobs that can and cannot be suspended when there is a change in power allocation to a distributed computer system
US20190116128A1 (en) Dynamic allocation of edge computing resources in edge computing centers
US9386086B2 (en) Dynamic scaling for multi-tiered distributed systems using payoff optimization of application classes
US10541939B2 (en) Systems and methods for provision of a guaranteed batch
KR101651871B1 (en) Job Allocation Method on Multi-core System and Apparatus thereof
US8984521B2 (en) Computer system performance by applying rate limits to control block tenancy
JP2006260565A (en) Process scheduler using adaptive partitioning of process thread
Huang et al. A workflow for runtime adaptive task allocation on heterogeneous MPSoCs
Armstrong et al. Scheduling many-task workloads on supercomputers: Dealing with trailing tasks
EP3238055A1 (en) Allocating cloud computing resources in a cloud computing environment
Dimopoulos et al. Justice: A deadline-aware, fair-share resource allocator for implementing multi-analytics
CN112219191A (en) Self-configuration of services and servers in a data center
Muthuvelu et al. On-line task granularity adaptation for dynamic grid applications
Björkqvist et al. Dynamic replication in service-oriented systems
JP5469128B2 (en) Program execution control method and program execution control apparatus
Yazdanov et al. EHadoop: Network I/O aware scheduler for elastic MapReduce cluster
CN111930516B (en) Load balancing method and related device
Camponogara et al. Optimization-based dynamic reconfiguration of real-time schedulers with support for stochastic processor consumption
Du et al. Scheduling for cloud-based computing systems to support soft real-time applications
Wu et al. QoS oriented resource reservation in shared environments
JP5997659B2 (en) Distributed processing system and distributed processing method
Zabolotnyi et al. Profiling-based task scheduling for factory-worker applications in infrastructure-as-a-service clouds
Papazachos et al. Gang scheduling in a two-cluster system implementing migrations and periodic feedback
JP6059259B2 (en) Computer system and computer resource allocation method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130624

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140121

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: 20140128

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140130

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5469128

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees