JP2013152636A - Information processing device and task scheduling method - Google Patents
Information processing device and task scheduling method Download PDFInfo
- Publication number
- JP2013152636A JP2013152636A JP2012013404A JP2012013404A JP2013152636A JP 2013152636 A JP2013152636 A JP 2013152636A JP 2012013404 A JP2012013404 A JP 2012013404A JP 2012013404 A JP2012013404 A JP 2012013404A JP 2013152636 A JP2013152636 A JP 2013152636A
- Authority
- JP
- Japan
- Prior art keywords
- task
- data
- execution
- registration table
- information processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は、複数のタスクの実行タイミングが競合した場合、優先度順に実行する高いタスクをリソースに割り当てる情報処理装置に関する。 The present invention relates to an information processing apparatus that assigns, to resources, high tasks that are executed in order of priority when execution timings of a plurality of tasks compete.
1つのマイコン上で複数のタスクやスレッド(以下、単にタスクという)がCPUへ割り当てられ実行されるマルチタスク処理が知られている。この割り当て制御は主にOS(Operating System)のスケジューラなどにより行われる。タスクには優先度の記述があり、スケジューラは原則的に優先度の高いタスクから先にCPUへ割り当てる。ここで、スケジューラのタスクの割り当て方法には、ノンプリエンプティブとプリエンプティブがある。ノンプリエンプティブな割り当てでは、すでにCPUが実行中のタスクに対し、実行待ち状態のタスクが発生した場合、スケジューラは実行中のタスクの終了を待つ。プリエンプティブな割り当てでは、実行中のタスクの優先度よりも実行待ち状態のタスクの優先度の方が高い場合に、スケジューラは実行中のタスクを強制的に終了して実行待ち状態のタスクをCPUに割り当てる。プリエンプティブなマルチタスクでは、優先度の関係を維持できるのでリアルタイム性を保証しやすくできる。 Multitask processing is known in which a plurality of tasks and threads (hereinafter simply referred to as tasks) are assigned to a CPU and executed on one microcomputer. This allocation control is mainly performed by an OS (Operating System) scheduler or the like. The task has a description of priority, and the scheduler assigns the task to the CPU in principle from the task with the highest priority. Here, the task assignment method of the scheduler includes non-preemptive and preemptive. In non-preemptive allocation, when a task waiting for execution occurs for a task that is already being executed by the CPU, the scheduler waits for the task being executed to end. In preemptive assignment, if the priority of a task waiting to be executed is higher than the priority of the task being executed, the scheduler forcibly terminates the task that is executing and causes the task waiting for execution to be sent to the CPU. assign. In preemptive multitasking, the priority relationship can be maintained, so that real-time performance can be easily guaranteed.
しかしながら、プリエンプティブなマルチタスクでは、タスク切り替えのために必要なコンテキストの切り替え処理がオーバーヘッドとなる場合がある。そこで、従来からオーバーヘッドを低減する技術が考えられている(例えば、特許文献1参照。)。特許文献1には、競合する複数の周期駆動タスク用に専用のレジスタを用意しておき、タスクが競合した際、専用レジスタに格納された高優先度のタスク情報によりこのタスクをCPUに割り当てる周期駆動タスク実行装置が開示されている。
However, in preemptive multitasking, context switching processing required for task switching may be an overhead. Therefore, a technique for reducing overhead has been conventionally considered (see, for example, Patent Document 1). In
しかしながら、特許文献1ではオーバーヘッドを低減できる可能性があるが、優先度の低いタスクが、結局、優先度の高いタスクの実行終了後に実行されているので、CPU負荷を増大させているという問題がある。また、特許文献1では専用レジスタが必要になるという問題もある。
However, although there is a possibility that the overhead can be reduced in
図1は、優先度の低いタスクの実行による負荷の増大を説明する図の一例である。タスクAは例えばタイマ割込みで定期的に実行されるタスクであり、タスクBは例えばイベント発生により実行されるタスクである。ここではタスクBの優先度>タスクAの優先度であるとする。なお、ISR(Interrupt Service Routine)は割り込み処理を行うサービスで、割込みに対応したタスクを実行する処理などを行う。割り込みハンドラと呼ばれる場合もある。 FIG. 1 is an example for explaining an increase in load due to execution of a low priority task. Task A is a task that is periodically executed by a timer interrupt, for example, and task B is a task that is executed by occurrence of an event, for example. Here, it is assumed that the priority of task B> the priority of task A. Note that ISR (Interrupt Service Routine) is a service that performs interrupt processing, and performs processing that executes tasks corresponding to interrupts. Sometimes called an interrupt handler.
タスクAは例えばセンサからのデータ取得、演算、共有メモリへの書き出しを行う。タスクBは共有メモリからデータを読み出し、車載装置を制御する。このように、タスクAとタスクBにはデータ依存性がある。タスクBとしてはタスクAが更新した(新しい)データを読み出すことが好ましい。 Task A performs, for example, data acquisition from a sensor, calculation, and writing to a shared memory. Task B reads data from the shared memory and controls the in-vehicle device. Thus, task A and task B have data dependency. As task B, it is preferable to read out (new) data updated by task A.
タスクBの優先度>タスクAの優先度なので、2回目の周期のように、実行タイミングが競合した場合、スケジューラはタスクAよりもタスクBを優先してCPUに割り当てる(図のマルの中)。したがって、この周期ではタスクAは共有メモリのデータを更新できないことになり、タスクBは1周期前のデータを共有メモリから読み出す。そして、タスクBの終了後、スケジューラはタスクAをCPUに割り当てるので、タスクAは共有メモリのデータを更新する。 Since the priority of task B> priority of task A, if the execution timing conflicts as in the second cycle, the scheduler assigns the task B to the CPU with priority over the task A (in the circle in the figure). . Therefore, in this cycle, task A cannot update the data in the shared memory, and task B reads the data one cycle before from the shared memory. After the task B ends, the scheduler assigns the task A to the CPU, so the task A updates the data in the shared memory.
タスクAの周期は変わらないので、タスクAは次の周期(図の3回目の周期)が到来すると、共有メモリのデータを更新する。したがって、データの更新周期が短くなり、タスクBが実行された後に更新されたデータは、タスクBに読み出されることなく更新される。このため、タスクAのCPUへの割り当て(2回目の周期の割り当て)が無駄になり、CPU負荷が無駄に増大しているという問題がある。 Since the cycle of task A does not change, task A updates the data in the shared memory when the next cycle (the third cycle in the figure) arrives. Therefore, the data update cycle is shortened, and the data updated after the task B is executed is updated without being read by the task B. For this reason, assignment of task A to the CPU (assignment of the second cycle) is wasted, and there is a problem that the CPU load is unnecessarily increased.
本発明は,上記課題に鑑み、実行する必要性が低いタスクの実行を禁止することができる情報処理装置を提供することを目的とする。 In view of the above problems, an object of the present invention is to provide an information processing apparatus that can prohibit execution of a task that is less necessary to be executed.
本発明は、複数のタスクの実行タイミングが競合した場合、優先度順にタスクをリソースに割り当てる情報処理装置において、周期起動タスク、及び、前記周期起動タスクよりも優先度の高い競合タスクが共有するデータ毎に、周期起動タスクと前記競合タスクの組が予め登録されたタスク登録テーブルと、前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記競合タスクを優先して実行し、競合した周期における前記周期起動タスクの実行を禁止するスケジューリング制御手段と、を有することを特徴とする。 In the information processing apparatus that assigns tasks to resources in order of priority when the execution timings of a plurality of tasks compete, the present invention shares data that is shared by the periodically activated task and the competing task having a higher priority than the periodically activated task Each time, a task registration table in which a set of a cyclic start task and the competing task is registered in advance, the cyclic start task, and an execution timing of the competing task registered in the task registration table in association with the cyclic start task Scheduling control means for preferentially executing the competing task and prohibiting the execution of the periodic activation task in the conflicting period when there is a conflict.
実行する必要性が低いタスクの実行を禁止することができる情報処理装置を提供することができる。 It is possible to provide an information processing apparatus that can prohibit execution of a task that is less necessary to be executed.
以下、本発明を実施するための形態について図面を参照しながら説明する。 Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.
図2は、本実施形態の情報処理装置100によるタスク割り当てを説明する図の一例である。スケジューリング制御部32は後述するスケジューラやOSの機能であり、CPUへのタスクの割り当てを制御する。
FIG. 2 is an example of a diagram illustrating task assignment by the
タスクAはセンサからのデータ取得、演算、共有メモリへの書き出しを行う。タスクBは共有メモリからデータを読み出し車載装置を制御する。このように、タスクAとタスクBにはデータ依存性がある。タスクAは例えばタイマ割込みで定期的に実行されるタスクである。タスクBは例えばイベント発生により実行されるタスクとするが、タスクBも定周期で実行されるタスクであってもよい。 Task A performs data acquisition from the sensor, calculation, and writing to the shared memory. Task B reads data from the shared memory and controls the in-vehicle device. Thus, task A and task B have data dependency. Task A is a task that is periodically executed by a timer interrupt, for example. For example, task B is a task that is executed when an event occurs, but task B may also be a task that is executed at regular intervals.
スケジューリング制御部32は、タスクAとタスクBの実行タイミングが競合した場合排他登録テーブルを参照して、タスクAの割り当てを制御する必要があるか否かを判定する。排他登録テーブルには、互いにデータ依存性のあるタスクが対応づけて登録されている。図の例では、競合タスクBに対し制御対象としてタスクAが登録されている。制御対象のタスクは競合タスクと競合すると、実行が禁止されるタスクである。
When the execution timings of task A and task B conflict, the
スケジューリング制御部32は、タスクAとタスクBの実行タイミングが同時期に重なると、排他登録テーブルを参照して、タスクAを実行する必要がないと判定する。そして、スケジューリング制御部32は、タスクAの実行を禁止する。すなわち、図示するように、タスクAは定周期の実行タイミングが到来した場合に、競合した周期では実行されない。したがって、従来では、タスクAはタスクBの後に実行されていたが、本実施形態では実行されないのでCPUなどの資源を無駄に使用することを防止できる。
When the execution timings of task A and task B overlap in the same period, the
〔構成例〕
図3は、車両に搭載される情報処理装置100のハードウェア構成図の一例である。情報処理装置100は、ECU(Electronic Control Unit)に搭載されることが想定されているがその用途は車両に限定されない。車載されるECUには、その主要な機能により、エンジンECU、ブレーキECU、ボディECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等の種類がある。本実施例の情報処理装置100はECUの機能の違いに影響されず搭載されることが可能である。また、複数の機能が1つに統合されたECUに情報処理装置100を搭載してもよい。
[Configuration example]
FIG. 3 is an example of a hardware configuration diagram of the
情報処理装置100は、メインバス21に接続されたCPU11、RAM12、ROM13、INTC14、WDT15、DMAC16、並びに、ブリッジ17を有し、ブリッジ17には周辺バス22を介してADC(Analog to Digital Converter)19及びCANコントローラ20が接続されている。
The
CPU11は1つ以上のコア1〜nを有する。すなわち、各コア1〜nは一般的な演算機能(例えば、ALU等の演算装置、命令バッファ、命令デコーダ、レジスタセット等)を有している。1つのチップに複数のコア1〜nを有するCPU11でなく、複数のCPU11が独立にメインバス21に接続されていてもよい。
The
ROM13はフラッシュメモリなどの不揮発メモリであり、CPU11が実行するプログラム30や初期値、パラメータ等を記憶している。
The
INTC14はタイマなど、各種の割込み要求に応じてフラグがセットされる割込みレジスタを有している。INTC14は、タイマやI/O18などの受信割込み、その他の割り込み端子を介して周辺機器から入力された割り込み要求を、周辺機器の優先順位に基づき調停してCPU11に通知する。これによりCPU11は、割り込みした周辺機器に応じて決まったアドレスの命令をROM13から読み出して処理を実行する。本実施例ではISR30が起動して割り込み処理を行う。WDT15は、カウント値がオーバーフローする前にクリアされないと、情報処理装置をリセットするなどのフェールセーフを行う。
The
RAM12は、CPU11がプログラム30を実行するための作業領域である。CPU11はROM13からプログラム30を読み込み、また、必要であればメインバス21を介してRAM12からデータを読み出しプログラム30を実行する。DMAC16は、CPU11からの指示によりRAM12からブリッジ17を介して周辺機器にデータを送信する。また、周辺機器から割り込みされたCPU11から指示を受けて、ブリッジ17を介して周辺機器からデータを受け取り、RAM12に書き込む。
The
ブリッジ17は、メインバス21と周辺バス22との間の周波数等の違いを吸収し、メインバス側の回路と周辺バス側の回路のデータを互いに受け渡す。ブリッジ17は、マルチプレクサやブリッジ回路などであり、チャネル毎に、1つ以上のI/O18、ADC19、及び、CANコントローラ20とそれぞれ接続されており、これらの周辺機器とデータを送受信する。
The
I/O18は、例えばシリアル通信の入出力インタフェースであり、アクチュエータ、スイッチ、監視回路、他のマイコンと通信するために使用される。通信規格はI2C、UART等が知られている。ADC19は、各種のセンサが検出したアナログ信号をデジタル信号に変換する。ADC19は変換の終了を、INTC14を介してCPU11に通知する。CANコントローラ20は、車載ネットワークを介して接続された他のECUと通信するための通信装置である。CANコントローラ20は、CPU11から通信データの送信要求を受け付けるとフレームの各フィールドにCAN IDやデータを格納しCANバスに出力する。また、CANコントローラ20は、受信すべきCAN IDの通信データを検出するとそれを取り込みINTC14を介してCPU11に割り込んで通知する。
The I /
〔スケジューリングについて〕
図4は、タスクのスケジューリング説明する図の一例である。タスクとは、1つのプログラム(例えば、Main関数を1つのプログラムとして)に含まれるいくつかの機能を機能毎に抽出したものである。どのような機能を1つのタスクとするかは、開発者が設計できる。具体的には、Main関数内の関数、サブルーチンなどが相当する。割込みなどで実行される関数もタスクである。
[About scheduling]
FIG. 4 is an example of a diagram explaining task scheduling. A task is obtained by extracting several functions included in one program (for example, the Main function as one program) for each function. The developer can design what function is one task. Specifically, a function, a subroutine, and the like in the Main function correspond. A function executed by an interrupt or the like is also a task.
タスクは一般に、休止状態、実行可能状態、実行状態、及び、待ち状態の各状態を経る。休止状態は生成直後又は実行が完了したタスクの状態である。実行状態は、コアにより現在、実行されているタスクの状態をいう。実行状態のタスクはコアの数以下しか存在しない。実行可能状態は、周辺機器の入出力などが完了し、実行の準備が整ったタスクの状態をいう。休止状態から実行可能状態への遷移を起床という。実行可能状態のタスクは、コアが実行状態のタスクを終了させれば(コアが空けば)、後述する優先度に従ってコアに割り当てられる(ディスパッチされる)。待ち状態は、周辺機器が入出力を完了させるなど、実行に必要な条件が整うまで待機しているタスクの状態をいう。 In general, a task goes through a dormant state, an executable state, an executing state, and a waiting state. The dormant state is the state of a task that has just been created or has completed execution. The execution state refers to the state of the task currently being executed by the core. There are less than the number of cores in the running state. The executable state refers to a task state in which input / output of peripheral devices is completed and ready for execution. The transition from the sleep state to the executable state is called wake-up. The task in the executable state is assigned (dispatched) to the core according to the priority described later when the core finishes the task in the execution state (if the core is free). The wait state is a state of a task that is waiting until a necessary condition for execution is satisfied, such as a peripheral device completing input / output.
例えば、Main関数のようなプログラムは、割込みの種類に対応したタスクのタスクID、アドレス、優先度等を引数にしてシステムコールなどの仕組みを利用しタスクを生成しておく。これによりスケジューラ31が呼び出され、スケジューラ31がタスクコントロールブロック(TCB)38を作成する(ISRがTCBを作成してもよい)。TCB38は、例えば、タスクID、タスク(関数)の開始アドレス、終了アドレス、コンテキスト(例えば、汎用レジスタ、プログラムカウンタ、スタックポインタ、ステータスフラグの状態など)、状態を表すステータス等の各情報が含まれる。これによりタスクは休止状態になっている。
For example, a program such as the Main function generates a task by using a system call mechanism using the task ID, address, priority, etc. of the task corresponding to the type of interrupt as arguments. As a result, the
割込みの発生により割込みに対応した(又は割込みの種類に関係なく共通した)ISR30が実行されると、ISR30は例えばタスクID等を引数にして、タスクを起床するシステムコールを行う。これにより、スケジューラ31がTCB38のステータスを変更してタスクが実行可能状態になる。以降、スケジューラ31は、プリエンプティブな優先度制御を行う。
When the
スケジューラ31は優先度毎にレディーキューを管理している。レディーキューには、優先度毎に、実行順にタスクが配列されている。同じ優先度におけるタスクの順番は、タスクが実行可能状態になった順番である。レディーキューは、例えば、タスクIDがキュー構造に配列された構造体である。スケジューラ31は、実行可能状態になったタスクの優先度に応じてレディーキューを選択し、そのレディーキューの末尾にタスクIDを登録する。そして、スケジューラ31は例えば以下のようにして、CPU11などの資源に割り当てるタスクを決定する。
・最も優先度の高いレディーキューのタスクを検索する。タスクがある場合にはキュー内の配置順にタスクを割り当てると決定する。
・最も優先度の高いレディーキューにタスクがない場合、次に優先度が高いレディーキューのタスクを検索する。このレディーキューにタスクがある場合にはキュー内の順にタスクを割り当てると決定する。
The
-Search for the task with the highest priority ready queue. If there are tasks, it is determined that the tasks are assigned in the order of arrangement in the queue.
If there is no task in the ready queue with the highest priority, the task of the ready queue with the next highest priority is searched. If there are tasks in this ready queue, it is determined that the tasks are assigned in the order in the queue.
このように、スケジューラ31は、原則的に優先度が高いタスクから、同じ優先度の複数のタスクについては実行可能状態になった順からタスクを割り当てると決定する。また、このように優先度だけを考慮すると、長時間実行されないタスクが生じてしまう。そこで、スケジューラ31は例外的に、所定時間、優先度1のタスクを実行したら優先度2のタスクを実行する、などラウンドロビン方式を併用する。
As described above, the
CPU11などの資源への割り当てはディスパッチャにより行われる。ディスパッチャは、TCB38の開始アドレスを参照してPC(プログラムカウンタ)に配置するなどして、CPU11にタスクを割り当てる。なお、すでに、待ち状態を経たタスクの場合、直前の実行状態を再生するためコンテキストをレジスタ等に再設定する。
Allocation to resources such as the
実行状態のタスクは、タスクの終了のシステムコールにより消滅し、起床待ちのシステムコールにより休止状態になる。また、周辺機器からのデータ待ちなどで(セマフォの状態を検出して)必要になれば、待ち状態になるためのシステムコールを実行する。これにより、スケジューラ31は、このタスクのTCB38のステータスを待ち状態にして、ディスパッチャが次に割り当てるタスクをCPU等に割り当てる。なお、スケジューラ31は、待ち状態になった要因のセマフォを監視して、セマフォが変わると、待ち状態のタスクを自動的に実行可能状態に変更する。
The task in the execution state disappears by a system call at the end of the task, and enters a dormant state by a system call waiting for waking up. Also, if necessary, such as waiting for data from a peripheral device (detecting the state of the semaphore), a system call for entering the wait state is executed. As a result, the
本実施形態では、タスクの前にISRがCPUを使用し、ISRがタスクを起床することでタスクが実行可能状態となる。複数のタスクの実行タイミングの競合は、どちらかのISRが実行されれば生じ得る。このため、以下では、ISRの契機である「タスクの割込みが発生する」ことを実行タイミングの競合の契機として説明する。なお、実行タイミングの競合については後述する。 In this embodiment, the ISR uses the CPU before the task, and the task is ready to be executed when the ISR wakes up the task. Contention timing conflicts between multiple tasks can occur if either ISR is executed. Therefore, hereinafter, “task interruption occurs”, which is the trigger of ISR, will be described as a trigger of conflict of execution timing. The execution timing conflict will be described later.
〔タスクの競合の例〕
図5(a)は、タスクの処理とその競合を説明する図の一例である。
タスクA:定周期起動タスク
タスクB:イベント起動タスク(周期的に発生)
タスクBの優先度>タスクAの優先度
タスクAはセンサからのデータ取得、演算、共有メモリへの書き出しを行う。タスクBは共有メモリからデータを読み出し、車載装置を制御する。2回目の周期において、タスクAのISRが実行されている状態で、タスクBの割込みが発生する。なお、タスクAが実行状態になっていてもよい。
[Example of task conflict]
FIG. 5A is an example of a diagram illustrating task processing and its competition.
Task A: Periodic start task B: Event start task (occurs periodically)
Priority of task B> priority of task A Task A performs data acquisition from the sensor, calculation, and writing to the shared memory. Task B reads data from the shared memory and controls the in-vehicle device. In the second cycle, an interrupt for task B occurs while an ISR for task A is being executed. Task A may be in the execution state.
スケジューラ31はタスクAよりもタスクBを優先してCPU11に割り当てる。したがって、この周期ではタスクAは共有メモリのデータを更新できないことになり、タスクBは1周期前のデータを共有メモリから読み出す。この後、タスクAが実行状態になっても、タスクAが更新したデータは、タスクBに読み出されることなく更新される。
The
そこで、後述するスケジューリング制御部32は、タスクAの実行を禁止する。こうすることで、タスクAが無駄にCPU11へ割り当てられることを防止できる。
Therefore, the
なお、図5(a)のようにタスクA,Bが競合するのは、CPU11がコアを1つしか有さないシングルコアの場合である。CPU11がマルチコアの場合、優先度の高低だけでは、コア1がタスクAを中断する必要がなくタスクBが優先される必要がない。マルチコアの2つのタスクがデータ依存性を保つには、例えば、セマフォを用いて、タスクBがタスクAのデータ更新を待つことで、タスクAを先に実行することも可能である。
Note that the tasks A and B compete as shown in FIG. 5A when the
しかしながら、本実施例では、データの整合性よりもタスクBが遅延なく実行されることを優先するため、シングルコアかマルチコアかに関係なく、タスクBを優先するものとする。データ依存性があるため、互いに競合するタスクはタスク排他登録テーブル33に登録されている。したがって、本実施例のタスク制御はCPU11がシングルコアかマルチコアかを問わず実現可能である。
However, in the present embodiment, priority is given to the task B being executed without delay rather than data consistency, so the task B is given priority regardless of whether it is a single core or a multi-core. Due to data dependency, tasks that compete with each other are registered in the task exclusive registration table 33. Therefore, the task control of this embodiment can be realized regardless of whether the
図5(b)は、タスクAとタスクB(C)の競合を説明する図の一例である。タスクAは、例えば2ミリ秒周期でタイマ割込みが発生することで実行される。タスクBは、クランク角が45度になるというイベント割込みが発生することで実行される。タスクCは、クランク角が60度になるというイベント割込みが発生することで実行される。したがって、例えば、図では4ミリ秒でタスクAとタスクBの競合が、14ミリ秒でタスクAとタスクCの競合が発生している。 FIG. 5B is an example of a diagram illustrating competition between task A and task B (C). Task A is executed, for example, when a timer interrupt occurs at a cycle of 2 milliseconds. Task B is executed by the occurrence of an event interrupt that the crank angle is 45 degrees. Task C is executed by the occurrence of an event interrupt that the crank angle is 60 degrees. Therefore, for example, in the figure, a conflict between task A and task B occurs in 4 milliseconds, and a conflict between task A and task C occurs in 14 milliseconds.
本実施例によれば、スケジューリング制御部は、4ミリ秒と14ミリ秒でタスクAを実行しないので、CPU負荷を低減することができる。クランク角を含め、車両制御では車速やエンジン回転数が高速になるほど、制御のためのタスクが実行される頻度も増大する。このような状況に対応するには、CPU11の機能を増大させる(コスト増となる)などの必要があるが、本実施例では、競合してもタスクAが実行されないのでCPU11の機能を増大させる必要がない。
According to the present embodiment, the scheduling control unit does not execute the task A in 4 milliseconds and 14 milliseconds, so that the CPU load can be reduced. In the vehicle control including the crank angle, the higher the vehicle speed and the engine speed, the more frequently the task for the control is executed. In order to cope with such a situation, it is necessary to increase the function of the CPU 11 (increase the cost). However, in this embodiment, the task A is not executed even if it competes, so the function of the
〔実行タイミングの競合について〕
図6によりタスクAとタスクBが競合するタイミングについて説明する。
(i) タスクBの割込みがタスクAよりも先に発生した場合
優先度が高いタスクBがそのまま(コンテキストスイッチなく)実行される。タスクBの後にタスクAが実行されるが、タスクBはタスクAが更新したデータを参照しないので、タスクAの実行が無駄になる。このため、スケジューリング制御部32はタスクAを実行しないことが好ましい。
(ii) タスクBとタスクAの割込みが同時に発生した場合
優先度によりタスクBが先に実行される。したがって、この場合もタスクBがタスクAよりも先に実行可能状態となった場合と同様である。
(iii) タスクBの割込みがタスクAよりも後に発生した場合(これまでの説明と同様)
タスクAのISR30又はタスクAの実行中にタスクBの割込みが発生する。プリエンプションによりタスクAは中止され、タスクBがCPU11に割り当てられる。この後、タスクAがCPU11に割り当てられても、タスクBはタスクAが更新したデータを参照しないので、タスクAの実行が無駄になる。このため、スケジューリング制御部32はタスクAを実行しない。
[About execution timing conflicts]
The timing when task A and task B compete with each other will be described with reference to FIG.
(I) When an interruption of task B occurs before task A, task B having a higher priority is executed as it is (without context switch). Although task A is executed after task B, since task B does not refer to the data updated by task A, execution of task A is wasted. For this reason, it is preferable that the
(Ii) When task B and task A interrupts occur simultaneously, task B is executed first according to priority. Therefore, this case is the same as the case where the task B is in an executable state before the task A.
(Iii) When task B interrupt occurs after task A (same as above)
Task B interrupt occurs during task A ISR30 or task A execution. Task A is canceled by preemption, and task B is assigned to the
したがって、タスクAの実行が禁止されるべき状況としては、タスクAの割込みが発生してからタスクAが終了するまでの間にタスクBの割込みが発生した場合、又は、タスクBの割込みが発生してから、タスクBが終了するまでの間にタスクAの割込みが発生した場合である。よって、(i)〜(iii)の全ての場合、スケジューリング制御部32はタスクAの実行を禁止する。
Therefore, execution of task A should be prohibited when task B interrupt occurs between task A interrupt and task A termination, or task B interrupt occurs. This is a case where an interruption of task A occurs between task B and the end of task B. Therefore, in all cases (i) to (iii), the
なお、(iii)のような場合において、ISRが終了しタスクAが実行状態になってから、タスクBの割込みが生じる場合がある。この場合、タスクAからタスクBにコンテキストスイッチすることなく、タスクAの実行を完了させることもできる。タスクAの実行時間が短い場合は、コンテキストスイッチしない方が負荷の低減になるためである。 In the case of (iii), the task B may be interrupted after the ISR ends and the task A enters the execution state. In this case, the execution of task A can be completed without context switching from task A to task B. This is because when the execution time of task A is short, the load is reduced if context switching is not performed.
〔スケジューラの機能例〕
図7はスケジューラの機能ブロック図とタスク排他登録テーブル33の一例を示す図である。スケジューラ31はスケジューリング制御部32を有し、RAM12にはタスク排他登録テーブル33が記憶されている。
[Scheduler function examples]
FIG. 7 is a functional block diagram of the scheduler and an example of the task exclusive registration table 33. The
タスク排他登録テーブル33には、データ競合が発生するタスクの優先度が登録されている。タスク排他登録テーブル33は、開発者が予めスケジューラ31などの一部として記述しておく。タスク排他登録テーブル33は複数のセット(セット1〜n)を有し、競合タスクと制御対象のタスクが登録されている。1つの競合タスクに制御対象のタスクが複数個、登録されていてもよい。競合タスクは優先して実行されるタスクであり、制御対象は競合タスクと競合すると、実行が禁止されるタスクである。多くの場合、競合タスクの優先度>制御対象の優先度、である。例えばデータXに対し競合するタスクがA,Bであることは開発者にとって既知であるので、各種の競合データについて図のようなセットを作成しておくことができる。
In the task exclusion registration table 33, the priority of a task in which data conflict occurs is registered. The task exclusive registration table 33 is described in advance as a part of the
スケジューリング制御部32はスケジューラ31の機能の1つであり、競合タスクと競合した場合に、例えば実行可能状態のタスクから制御対象のタスクを検出し、該タスクの実行を禁止する。すなわち、スケジューリング制御部32は、競合タスクの割込みが発生すると、タスク排他登録テーブル33にて対応づけられた制御対象のタスクが実行可能状態や休止状態のタスクに含まれるか否かを判定する。制御対象のタスクが検出された場合(図6の(iii)の場合)、スケジューリング制御部32は、レディーキューに登録されている場合はレディーキューから削除しまたTCB38を消去する。レディーキューに登録されていない場合はレディーキューに登録することなくTCBを削除する。これにより、タスクAが実行状態になることを禁止する。
The
また、スケジューリング制御部32は、制御対象のタスクAの割込みが発生すると、タスク排他登録テーブル33にて対応づけられた競合タスク(タスクB)が実行可能状態のタスクに含まれるか否か、又は、実行状態か否かを判定する。この場合(図6の(i)の場合)も、制御対象のタスクAを実行する必要性が小さいので、スケジューリング制御部32は、タスクAのTCBをレディーキューに登録することなく削除し、TCB38を消去する。
In addition, when an interrupt of the task A to be controlled occurs, the
〔動作手順〕
図8は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。図8の手順は、例えば新たに割込みが発生するとスタートする。
[Operation procedure]
FIG. 8 is an example of a flowchart illustrating a procedure in which the
まず、スケジューリング制御部32は割込みが生じたタスクに対し、制御対象のタスクがタスク排他登録テーブル33に登録されているか否かを判定する(S10)。
First, the
制御対象のタスクがタスク排他登録テーブル33に登録されている場合(S10のYes)、スケジューリング制御部32はレディーキューに制御対象のタスク(タスクAのこと)があるか否かを判定する(S20)。これにより、割込みが生じたタスクBの実行により実行が不要になるタスクAを特定できる。
When the control target task is registered in the task exclusive registration table 33 (Yes in S10), the
レディーキューに制御対象のタスクがある場合(S20のYes)、スケジューリング制御部32はレディーキューのタスクAを実行禁止にする(S30)。これにより、タスクAが実行されることを防止する。
When there is a task to be controlled in the ready queue (Yes in S20), the
なお、レディーキューに制御対象のタスクがない場合(S20のNo)、制御対象のタスクを実行禁止にする必要がないので、スケジューラ31がレディーキューにタスクBを登録する(S60)。これによりタスクBが実行される。
If there is no task to be controlled in the ready queue (No in S20), the
制御対象のタスクがタスク排他登録テーブル33に登録されていない場合(S10のNo)、スケジューリング制御部32は、レディーキューに、割込みが生じたタスクから見て競合タスクがあるか否かを判定する(S40)。これにより、割込みが生じたタスクAの実行を不要にするタスクBの有無を判定できる。
If the task to be controlled is not registered in the task exclusive registration table 33 (No in S10), the
レディーキューに競合タスクがある場合(S40のYes)、スケジューリング制御部32は、割込みが生じた制御対象のタスクであるタスクAを実行禁止にする(S50)。すなわち、タスクAはレディーキューに登録されることなく消滅する。
If there is a competing task in the ready queue (Yes in S40), the
なお、レディーキューに競合タスクがない場合(S40のNo)、割込みが生じたタスクAは制御対象のタスクでないので、スケジューラ31がレディーキューにタスクAを登録する(S60)。したがって、タスクAは、タスクBと実行タイミングが競合しなければ禁止されることなく実行される(この後、タスクBの割込みが生じない限り)。
If there is no competing task in the ready queue (No in S40), since the task A in which the interrupt has occurred is not a control target task, the
以上説明したように、本実施例の情報処理装置100は、データ依存性がある2つのタスクの実行タイミングが競合した場合、優先度が低いタスクAの実行を禁止するので、CPU11などの資源を無駄に使用することを防止できる。
As described above, the
実施例1では、強制的にタスクAの実行を禁止していたが、タスクAの実行が高頻度に禁止されるとタスクBが演算に用いるデータの信頼性が低下するおそれがある。そこで、本実施では、タスクAの実行禁止の妥当性を判定する情報処理装置100について説明する。
In the first embodiment, the execution of the task A is forcibly prohibited. However, if the execution of the task A is prohibited at a high frequency, the reliability of the data used by the task B for the calculation may be reduced. Therefore, in the present embodiment, the
図9は、スケジューラ31の機能ブロック図、タスク排他登録テーブル33、及び、タスク起動管理データ記録部34の一例を示す図である。図9において図7と同一部の説明は省略する。本実施例では、RAM12にタスク起動管理データ記録部34が設けられている。タスク起動管理データ記録部34は、競合対象となるデータ毎に「回数」「発動数」「しきい値」の各フィールドを有する。このうち、「しきい値」は固定値であり、開発者等が予めスケジューラ31などの一部として記述しておく。
FIG. 9 is a diagram illustrating an example of a functional block diagram of the
「回数」「発動数」はスケジューリング制御部32が更新するフィールドである。「回数」は、タスクAが禁止されることなく実行され、データXを連続して更新した回数である。すなわち、スケジューリング制御部32はタスクAが終了する毎に「回数」を1つ大きくし、タスクAの実行を禁止すると「回数」をゼロにする。
“Number of times” and “Number of activations” are fields that the
また、「発動数」は、スケジューリング制御部32が制御対象であるタスクAの実行を禁止した回数である。したがって、スケジューリング制御部32は実施例1のようにタスクAの実行を禁止する毎に「発動数」を1つ大きくする。
Further, the “number of activations” is the number of times that the
「しきい値」は、「回数」と比較される値である。つまり、「回数」が「しきい値」より大きければ、データXは十分に更新されており、タスクAが更新しなくてもタスクBにとって支障は少ないと考えられる。また、「回数」が「しきい値」以下であれば、データXの更新頻度が少ないので、タスクAの実行を禁止すべきでないと考えられる。 The “threshold value” is a value compared with the “number of times”. That is, if the “number of times” is larger than the “threshold value”, the data X is sufficiently updated, and it is considered that there is little trouble for the task B even if the task A is not updated. Further, if the “number of times” is equal to or less than the “threshold value”, the update frequency of the data X is low, and it is considered that the execution of the task A should not be prohibited.
このように、本実施例のスケジューリング制御部32は、「回数」と「しきい値」を比較して、タスクAの実行を禁止するか否かを判定する。
As described above, the
なお、「発動数」は、バッテリが外されるなどしてRAM12が初期化されない限り、最後の値を保持する。「発動数」が多いことは、データの競合回数やタスクAの実行禁止の回数が多いことを意味するので、「発動数」が極端に大きいことは好ましくない。そこで、ディーラなどでは、サービスマンがスキャンツールを車載ネットワークに接続することで「発動数」を読み出し車両の点検に利用することができる。なお、「発動数」は所定期間毎(例えばワントリップ、所定距離の走行毎)に初期化されてもよい。
Note that the “number of activations” holds the last value unless the
図10は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。本実施例では、ステップS25、S45において、スケジューリング制御部32が、「回数」>「しきい値」か否かを判定している。
FIG. 10 is an example of a flowchart illustrating a procedure in which the
すなわち、レディーキューに制御対象のタスクがある場合(S20のYes)、スケジューリング制御部32はタスク起動管理データ記録部34の「回数」が「しきい値」より大きいか否かを判定する(S25)。スケジューリング制御部32は「回数」が「しきい値」より大きい場合にだけ(S25のYes)、レディーキューのタスクAを実行禁止にする(S30)。これにより、タスクAがしきい値より多く連続して実行されている場合には、タスクAが実行されることを禁止できる。
That is, when there is a task to be controlled in the ready queue (Yes in S20), the
また、レディーキューに競合タスクがある場合(S40のYes)、スケジューリング制御部32はタスク起動管理データ記録部34の「回数」が「しきい値」より大きいか否かを判定する(S45)。スケジューリング制御部32は「回数」が「しきい値」より大きい場合にだけ(S45のYes)、制御対象のタスクAを実行禁止にする(S50)。すなわち、タスクAがしきい値より多く連続して実行されている場合にだけ、タスクAはレディーキューに登録されることなく消滅する。
If there is a competing task in the ready queue (Yes in S40), the
ステップS25、S45で「回数」が「しきい値」より大きくない場合(S25、S45のNo)、処理はステップS60に進むので、スケジューリング制御部32はタスクBをレディーキューに登録し、タスクAをレディーキューに登録する。したがって、この場合は、タスクAが禁止されることなく実行される。
If the “number of times” is not greater than the “threshold value” in steps S25 and S45 (No in S25 and S45), the process proceeds to step S60, so that the
この後、スケジューリング制御部32はタスク起動管理データ記録部34を更新する(S70)。タスクAを実行した場合は「回数」を1つ大きくし、タスクAの実行を禁止した場合は「発動数」を1つ大きくし「回数」をゼロに初期化する。
Thereafter, the
本実施例の情報処理装置100によれば、実施例1の効果に加えて、タスクAの実行頻度を判定して、タスクBが演算に用いるデータの信頼性が低下するおそれがない場合にのみ、タスクAの実行を禁止することができる。
According to the
実施例1,2では、タスクAよりも優先度が高いタスクBは、タスクAがデータを更新しないためやや時間的に古いデータを演算に使用している。本実施例では、この古いデータから、タスクBが実行される時のデータを過去のデータの補間により求める情報処理装置100について説明する。
In the first and second embodiments, task B, which has a higher priority than task A, uses data that is slightly older in time for calculation because task A does not update data. In the present embodiment, an
図11は、スケジューラ31の機能ブロック図、タスク排他登録テーブル33、タスク起動管理データ記録部34、及び、補間データ記録部36の一例を示す図である。図11において図9と同一部の説明は省略する。本実施例では、スケジューラ31が補間データ制御部35を有し、RAM12に補間データ記録部36が設けられている。
FIG. 11 is a diagram illustrating an example of a functional block diagram of the
補間データ記録部36には、過去の所定数のデータ(取得値)と、過去の取得値から求められた予測値が記録される。補間データ記録部36には、タスクAの起動周期である2ミリ秒ごとにタスクAがRAM12に書き込んだデータが記録される。タスクAの実行が禁止された場合、タスクBはこの予測値を車載装置の制御に利用する。具体的には、スケジューリング制御部32が予測値を補間データ記録部36から読み出し、タスクAの代わりにRAM12に書き込む。タスクBはこの予測値をRAM12から読み出して使用することができる。
The interpolation
補間データ制御部35は、補間データ記録部36に、タスクAが読み出した取得値を登録する。補間データ記録部36は、リングバッファであり、例えば、6個のデータが記録されると、最も古いデータから上書きされる。補間データ制御部35は、補間データ記録部36に新たにデータを記録すると、予測値を更新する。すなわち、次回、タスクAが実行された場合に、タスクAがRAM12に書き込むであろうデータを予測して、補間データ記録部36の予測値に書き込む。
The interpolation
予測のアルゴリズムはどのようなものでもよく、また、データによって異なることが多いので最適なアルゴリズムで予測する。例えば、時間と共に増大するデータであれば、補間データ制御部35は、過去の数個のデータの差を算出し、その差の平均を最後のデータに加えた予測値とする。
例えば、3〜6回分のデータの差が「6,6,5」なので、平均は6(切り上げ)となる。よって予測値=31+6=37となる。
Any prediction algorithm may be used, and since it is often different depending on data, the prediction is performed with an optimal algorithm. For example, if the data increases with time, the interpolation
For example, since the difference in data for 3 to 6 times is “6, 6, 5”, the average is 6 (rounded up). Therefore, the predicted value = 31 + 6 = 37.
また、時間と共に余り変化のないデータであれば、補間データ制御部35は、過去の数個のデータの平均値を予測値とする。例えば、3〜6回分のデータの平均から、予測値=26となる。
If the data does not change much with time, the interpolation
また、最後のデータをそのまま予測値(31)としてもよい。こうすることで、CPU負荷を低減できる。 The last data may be used as the predicted value (31) as it is. By doing so, the CPU load can be reduced.
なお、「タイマー値」は、タスクAがデータXを処理した(演算した、又は、RAM12に書き込んだ)時刻を表す。「タイマー値」により、スケジューリング制御部32はタスクAの起動間隔を検出できる。当然ながら、タスクAの実行が禁止されると、「タイマー値」の間隔が大きくなる。
The “timer value” represents the time when the task A processed the data X (calculated or written in the RAM 12). Based on the “timer value”, the
また、タスク起動管理データ記録部34は「補間有」のフィールドを有する。「補間有」のフィールドは、補間データ制御部35が補間データ記録部36を作成する必要があるか否かを制御するためのフラグである。また、スケジューリング制御部32が、予測値を補間データ記録部36から読み出し、タスクAの代わりにRAM12に書き込むか否かを制御するためのフラグでもある。
Further, the task activation management
図12は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。本実施例では、ステップS30、S50において、タスクAの実行が禁止された後、スケジューリング制御部32が、タスク起動管理データ記録部34を参照して、「補間」が“有り”か否かを判定する(S55)。
FIG. 12 is an example of a flowchart illustrating a procedure in which the
「補間」が“有り”の場合(S55のYes)、スケジューリング制御部32は補間データ記録部36から予測値を読み出し、RAM12に書き込む(S56)。この後、レディーキューが更新されタスクBが実行されるので、タスクBは予測値を使用して車載装置を制御できる。
When “interpolation” is “present” (Yes in S55), the
図13は、タスクAと補間データ制御部35の動作手順を示すフローチャート図の一例である。タスクBと実行タイミングが競合せずに実行された場合、又は、タスクBと実行タイミングが競合したが実行された場合、タスクAはセンサ値の読み出し(S101)、演算(S102)、演算結果のRAM12への書き込みを行う(S103)。
FIG. 13 is an example of a flowchart showing an operation procedure of the task A and the interpolation
スケジューリング制御部32はシステムコールによりタスクAの終了を検出すると、タスク起動管理データ記録部34の「補間有」が“有り”になっているため、補間データ制御部35に予測値の補間を要求する。
When the
これにより、補間データ制御部35は以下の処理を開始する。補間データ制御部35は、RAM12からデータXを読み出し(S111)、読み出したデータXを補間データ記録部36に書き込む(S112)。補間データ記録部36において更新されるデータは最も古いデータである。
Thereby, the interpolation
補間データ制御部35は、補間データ記録部の所定数個のデータを用いて予測値を更新する(S113)。これにより、次回、タスクAの実行が禁止された場合、タスクBは予測値を使用して車載装置を制御できる。
The interpolation
本実施例の情報処理装置100によれば、実施例1,2の効果に加え、タスクAが実行されない場合、過去のデータからタスクAのデータを予測するので、タスクBは信頼性のあるデータを用いて車載装置を制御できる。
According to the
本実施例では、連続データ更新カウンタの「回数」が「しきい値」より小さい場合でも、データXの更新が遅延している場合は、タスクAの実行を禁止する情報処理装置100について説明する。
In the present embodiment, the
図14は、スケジューラ31の機能ブロック図、タスク排他登録テーブル33、タスク起動管理データ記録部34、及び、補間データ記録部36の一例を示す図である。図14において図11と同一部の説明は省略する。本実施例では、タスク起動管理データ記録部34に、新たに「起動周期」「周期しきい値」のフィールドが設けられている。「起動周期」は、タスクAの実際の起動周期である。「起動周期」はスケジューリング制御部32が更新するデータであり、スケジューリング制御部32は、補間データ記録部36の「タイマー値」を参照して、「起動周期」に設定する。タスクAの理想的な起動周期は予め既知なので(例えば、2ミリ秒)、「起動周期」によりどの程度、理想的な起動周期に対し遅れているかが検出される。
FIG. 14 is a diagram illustrating an example of a functional block diagram of the
「周期しきい値」は、「起動周期」と比較される値であり、「起動周期>周期しきい値」の場合、スケジューリング制御部32はタスクAの実行を禁止すべきと判定する。例えば、車速が高速なため、タスクAの起動周期が遅れてきた場合、タスクAの実行を停止しないデータの更新がさらに遅れてしまう。そこで、スケジューリング制御部32は「起動周期>周期しきい値」の場合、「回数(例えば、10回)」が「しきい値(例えば、12回)」より小さい場合でも、タスクAの実行を禁止する。
The “periodic threshold value” is a value to be compared with the “activation period”. When “activation period> periodic threshold value”, the
図15は、スケジューリング制御部32が、優先度の低いタスクの実行を禁止する手順を示すフローチャート図の一例である。本実施例では、ステップS26、S46において、スケジューリング制御部32が、「起動周期」が「周期しきい値」より大きいか否かを判定している。
FIG. 15 is an example of a flowchart illustrating a procedure in which the
すなわち、レディーキューに制御対象のタスクがある場合(S20のYes)、スケジューリング制御部32は「回数」が「しきい値」より大きいか否かを判定する(S25)。スケジューリング制御部32は「回数」が「周期しきい値」以下の場合(S25のNo)、さらにタスク起動管理データ記録部34の「起動周期」が「周期しきい値」より大きいか否かを判定する(S26)。
That is, when there is a task to be controlled in the ready queue (Yes in S20), the
スケジューリング制御部32は「起動周期」が「周期しきい値」より大きい場合(S26のYes)、タスクAを実行禁止として、処理をステップS60に進める。これにより、タスクAの起動周期が遅れ気味な場合は、タスクAの実行を禁止し処理遅延の拡大を防止できる。
If the “start cycle” is larger than the “cycle threshold” (Yes in S26), the
また、レディーキューに競合タスクがある場合(S40のYes)、スケジューリング制御部32はタスク起動管理データ記録部34の「回数」が「しきい値」より大きいか否かを判定する(S45)。スケジューリング制御部32は「回数」が「しきい値」以下の場合(S45のNo)、さらに「起動周期」が「周期しきい値」より大きいか否かを判定する(S46)。
If there is a competing task in the ready queue (Yes in S40), the
スケジューリング制御部32は「起動周期」が「周期しきい値」より大きい場合(S46のYes)、タスクAを実行禁止として、処理をステップS60に進める。これにより、タスクAの起動周期が遅れ気味な場合は、タスクAの実行を禁止し処理遅延の拡大を防止できる。
If the “start cycle” is greater than the “cycle threshold” (Yes in S46), the
本実施例によれば、実施例1〜3の効果に加え、連続データ更新カウンタの「回数」が「しきい値」より小さい場合でも、データXの更新が遅延している場合は、タスクAによるデータ更新を確実に行うことができる。 According to the present embodiment, in addition to the effects of the first to third embodiments, even when the “number of times” of the continuous data update counter is smaller than the “threshold value”, if the update of the data X is delayed, the task A It is possible to reliably update the data.
11 CPU
12 RAM
31 スケジューラ
32 スケジューリング制御部
33 タスク排他登録テーブル
34 タスク起動管理データ記録部
35 補間データ制御部
36 補間データ記録部
38 TCB
100 情報処理装置
11 CPU
12 RAM
31
100 Information processing apparatus
Claims (8)
周期起動タスク、及び、前記周期起動タスクよりも優先度の高い競合タスクが共有するデータ毎に、周期起動タスクと前記競合タスクの組が予め登録されたタスク登録テーブルと、
前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記競合タスクを優先して実行し、競合した周期における前記周期起動タスクの実行を禁止するスケジューリング制御手段と、
を有することを特徴とする情報処理装置。 When the execution timings of multiple tasks conflict, in the information processing apparatus that assigns tasks to resources in order of priority,
A task registration table in which a set of a cyclic start task and the competing task is registered in advance for each data that is shared by a cyclic start task and a competing task having a higher priority than the cyclic start task,
When the execution timing of the conflicting task registered in the task registration table in association with the periodic activation task and the periodic activation task conflicts, the competitive task is preferentially executed, and the periodic activation in the conflicting cycle Scheduling control means for prohibiting execution of tasks;
An information processing apparatus comprising:
前記スケジューリング制御手段は、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記回数が前記下限値より大きい場合にのみ、競合した周期における前記周期起動タスクの実行を禁止する、
ことを特徴とする請求項1記載の情報処理装置。 The number of times the execution of the periodic start task is continuously executed without being prohibited, and a start management table in which a lower limit value of the number of times is registered;
The scheduling control means, when the execution timing of the competing task registered in the task registration table in association with the periodic activation task competes, only when the number of times is larger than the lower limit value, Prohibit execution of cyclically activated tasks,
The information processing apparatus according to claim 1.
前記周期起動タスクが実行された場合に、前記周期起動タスクが生成したデータを前記データ登録テーブルに書き込むデータ書き込み手段と、を有し、
前記スケジューリング制御手段は、前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記データ登録テーブルに登録された過去の1つ以上のデータから予測された予測値を、前記競合タスクに提供し、前記競合タスクを優先して実行する、
ことを特徴とする請求項2記載の情報処理装置。 A data registration table in which past data generated by the cyclic start task is registered in time series;
Data writing means for writing the data generated by the periodic start task to the data registration table when the periodic start task is executed,
When the execution timing of the competing task registered in the task registration table in association with the periodic activation task conflicts with the periodic activation task, the scheduling control unit is configured to store the past one registered in the data registration table. Providing predicted values predicted from one or more data to the competing task, and executing the competing task with priority.
The information processing apparatus according to claim 2.
前記起動管理テーブルに前記周期起動タスクの起動周期の上限値が登録されており、
前記スケジューリング制御手段は、前記データ登録テーブルの前記周期情報が前記上限値を上回っている場合、前記回数が前記下限値以下でも、競合した周期における前記周期起動タスクの実行を禁止する、
ことを特徴とする請求項3記載の情報処理装置。 The data writing means writes, in the data registration table, cycle information on which the cycle activation task has been executed,
An upper limit value of the activation cycle of the periodic activation task is registered in the activation management table,
The scheduling control means prohibits the execution of the periodic activation task in a conflicting period even when the number of times is equal to or less than the lower limit value when the period information of the data registration table exceeds the upper limit value.
The information processing apparatus according to claim 3.
ことを特徴とする請求項1〜4いずれか1項記載の情報処理装置。 The scheduling control means records in the activation management table the number of times the execution of the periodic activation task in the conflicting period is prohibited;
The information processing apparatus according to claim 1, wherein the information processing apparatus is an information processing apparatus.
ことを特徴とする請求項3記載の情報処理装置。 The scheduling control means has an instruction to interpolate data in the data registration table when the execution timing of the competing task registered in the task registration table in association with the periodic activation task conflicts with the periodic activation task. Only if the prediction value is provided to the competing task,
The information processing apparatus according to claim 3.
ことを特徴とする請求項1〜6いずれか1項記載の情報処理装置。 The periodic start task is a task that is periodically woken up by a timer, performs a calculation on data acquired from a peripheral circuit, and updates data on the memory, and the competing task is woken up by an event signal detected by a sensor, A task to read data and control the device,
The information processing apparatus according to claim 1, wherein:
スケジューリング制御手段が、周期起動タスク、及び、前記周期起動タスクよりも優先度の高い競合タスクが共有するデータ毎に、周期起動タスクと前記競合タスクの組が予め登録されたタスク登録テーブルを参照して、
前記周期起動タスクと、前記周期起動タスクに対応づけて前記タスク登録テーブルに登録された前記競合タスクの実行タイミングが競合した場合、前記競合タスクを優先して実行し、競合した周期における前記周期起動タスクの実行を禁止する、
ことを特徴とするタスクスケジューリング方法。 In the task scheduling method of the information processing apparatus that assigns tasks to resources in order of priority when execution timings of a plurality of tasks conflict,
The scheduling control means refers to a task registration table in which a set of the periodic start task and the competing task is registered in advance for each data shared by the periodic start task and the competing task having a higher priority than the periodic start task. And
When the execution timing of the conflicting task registered in the task registration table in association with the periodic activation task and the periodic activation task conflicts, the competitive task is preferentially executed, and the periodic activation in the conflicting cycle Prohibit execution of tasks,
A task scheduling method characterized by the above.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012013404A JP2013152636A (en) | 2012-01-25 | 2012-01-25 | Information processing device and task scheduling method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012013404A JP2013152636A (en) | 2012-01-25 | 2012-01-25 | Information processing device and task scheduling method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013152636A true JP2013152636A (en) | 2013-08-08 |
Family
ID=49048919
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012013404A Pending JP2013152636A (en) | 2012-01-25 | 2012-01-25 | Information processing device and task scheduling method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013152636A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017059009A (en) * | 2015-09-17 | 2017-03-23 | 横河電機株式会社 | Control device |
US20200039453A1 (en) * | 2016-10-19 | 2020-02-06 | Hitachi Automotive Systems, Ltd. | Vehicle controller |
WO2021106353A1 (en) * | 2019-11-29 | 2021-06-03 | 日立Astemo株式会社 | Electronic control device |
CN116859874A (en) * | 2023-09-04 | 2023-10-10 | 成都科江科技有限公司 | Industrial logic control task scheduling method |
-
2012
- 2012-01-25 JP JP2012013404A patent/JP2013152636A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017059009A (en) * | 2015-09-17 | 2017-03-23 | 横河電機株式会社 | Control device |
US20200039453A1 (en) * | 2016-10-19 | 2020-02-06 | Hitachi Automotive Systems, Ltd. | Vehicle controller |
WO2021106353A1 (en) * | 2019-11-29 | 2021-06-03 | 日立Astemo株式会社 | Electronic control device |
JP7333251B2 (en) | 2019-11-29 | 2023-08-24 | 日立Astemo株式会社 | electronic controller |
CN116859874A (en) * | 2023-09-04 | 2023-10-10 | 成都科江科技有限公司 | Industrial logic control task scheduling method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5347451B2 (en) | Multiprocessor system, conflict avoidance program, and conflict avoidance method | |
US9298504B1 (en) | Systems, devices, and techniques for preempting and reassigning tasks within a multiprocessor system | |
JP5653431B2 (en) | Multiprocessor system | |
US20120233616A1 (en) | Stream data processing method and stream processor | |
JP5861718B2 (en) | Electronic control device for vehicle and data receiving method | |
JP4213572B2 (en) | Electronic device and processor speed control method | |
WO2010067492A1 (en) | Multiprocessor system and multiprocessor exclusive control adjustment method | |
JP5745868B2 (en) | Multiprocessor system | |
US20110022809A1 (en) | Consolidated electronic control unit and relay program implemented in the same | |
US7398378B2 (en) | Allocating lower priority interrupt for processing to slave processor via master processor currently processing higher priority interrupt through special interrupt among processors | |
JP2013152636A (en) | Information processing device and task scheduling method | |
US9367349B2 (en) | Multi-core system and scheduling method | |
JP2014191655A (en) | Multiprocessor, electronic control device, and program | |
US20100281485A1 (en) | Method For Changing Over A System Having Multiple Execution Units | |
JP2010170320A (en) | Program and control device | |
JP2010280356A (en) | Onboard system, and load distribution method | |
JP5726006B2 (en) | Task and resource scheduling apparatus and method, and control apparatus | |
JP2007164421A (en) | Parallel processors, parallel processing method and parallel processing program | |
US20050160425A1 (en) | Limitation of the response time of a software process | |
JP4614239B2 (en) | Multitask scheduling function-equipped device and program | |
JP5699896B2 (en) | Information processing apparatus and abnormality determination method | |
JP2012137920A (en) | Electronic control device and start control method | |
JPWO2018211865A1 (en) | Vehicle control device | |
JP2010140239A (en) | Apparatus and method for shortening interrupt latency | |
JP4441592B2 (en) | Parallel processing apparatus and exclusive control method |