[go: up one dir, main page]

JP2005327007A - Integrated computer control program, recording medium for recording its program and integrated system - Google Patents

Integrated computer control program, recording medium for recording its program and integrated system Download PDF

Info

Publication number
JP2005327007A
JP2005327007A JP2004143253A JP2004143253A JP2005327007A JP 2005327007 A JP2005327007 A JP 2005327007A JP 2004143253 A JP2004143253 A JP 2004143253A JP 2004143253 A JP2004143253 A JP 2004143253A JP 2005327007 A JP2005327007 A JP 2005327007A
Authority
JP
Japan
Prior art keywords
task
executed
priority
cpu
tasks
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
JP2004143253A
Other languages
Japanese (ja)
Other versions
JP3893136B2 (en
Inventor
Shinji Shibata
信次 柴田
Tsutomu Anriyo
努 安陵
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.)
FIRMWARE SYSTEMS Inc
Original Assignee
FIRMWARE SYSTEMS Inc
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 FIRMWARE SYSTEMS Inc filed Critical FIRMWARE SYSTEMS Inc
Priority to JP2004143253A priority Critical patent/JP3893136B2/en
Publication of JP2005327007A publication Critical patent/JP2005327007A/en
Application granted granted Critical
Publication of JP3893136B2 publication Critical patent/JP3893136B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an integrated system having a plurality of CPU for properly and dynamically distributing tasks to those respective CPU, and for quickly processing the tasks whose priority is high. <P>SOLUTION: This integrated system A having a plurality of CPU (B through B) and a storage device C is provided with a task execution right releasing means M for, while tasks F through F whose priority is lower than the priority of the task F to be executed are under execution, releasing the task execution rights of all the tasks F through F under execution, and for temporarily putting all the CPU (B through B) in a task non-execution status and a task assigning means O for successively assigning the tasks F through F related with task information storage region information J through J stored in ready queues D through D whose priority is high among the tasks F through F related with the task management information storage region information J through J stored in the plurality of ready queues D through D to the respective CPU (B through B) which has been put in the task non-execution status by the task execution right releasing means M from the leading side of the ready queues D through D. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、複数のCPUを有する組込みコンピュータの制御プログラム、そのプログラムを記録した記録媒体、及び組込みシステムに関し、タスクの動的分散の技術分野に属する。   The present invention relates to a control program for an embedded computer having a plurality of CPUs, a recording medium storing the program, and an embedded system, and belongs to the technical field of dynamic distribution of tasks.

従来より、家電製品や産業機器等に組込まれてこれらの作動を制御する機器組込み制御システム(組込みシステム)としては、単一のCPUやメモリ(記憶装置)等を有するコンピュータを、例えばTRON仕様等のリアルタイムオペレーティングシステム(制御プログラム)により制御するようにしたものが広く知られている。   Conventionally, as a device embedded control system (embedded system) that is incorporated in home appliances, industrial equipment, etc. and controls these operations, a computer having a single CPU, memory (storage device), etc., for example, TRON specification, etc. Those controlled by a real-time operating system (control program) are widely known.

このリアルタイムオペレーティングシステムは、メモリ(記憶装置)に記憶された複数のタスク(プログラムの並行実行の単位)のうちの実行すべきタスクを、異なる優先度が設定された複数のレディキューのうちの所定のレディキューに接続し、かつ、この接続されたタスクの優先度が実行中のタスクの優先度よりも高いときにはこの接続されたタスクをCPUに割り当てると共に、この接続されたタスクの優先度が実行中のタスクの優先度よりも低いときには現在実行中のタスクの処理が終了したときに、タスクが接続されたレディキューのうちの最も優先度の高いレディキューの先頭に接続されたタスクをCPUに割り当てるように構成されており、これにより、優先度の高いタスクのリアルタイムな処理を可能としている。   This real-time operating system is configured to specify a task to be executed among a plurality of tasks (units of parallel execution of programs) stored in a memory (storage device) as a predetermined one of a plurality of ready queues having different priorities. When the priority of the connected task is higher than the priority of the task being executed, the connected task is assigned to the CPU, and the priority of the connected task is executed. When the priority of the task currently being executed is finished, the task connected to the head of the ready queue with the highest priority among the ready queues to which the task is connected is sent to the CPU. It is configured to be assigned, thereby enabling real-time processing of high priority tasks.

ところで、近年、組込みシステム分野においては、上記家電製品や産業機器等の機能の高度化等に伴って処理対象データ量が増大しており、これに対処するため組込みシステムの処理能力の向上が要求されるようになってきている。   By the way, in recent years, in the embedded system field, the amount of data to be processed has increased with the advancement of functions such as the above-mentioned home appliances and industrial equipment, and in order to cope with this, it is necessary to improve the processing capacity of embedded systems. It has come to be.

組込みシステムの処理能力を向上させる方策としては、組込みシステム以外の分野において既に採用されているように複数のCPUを用いることが考えられる(特許文献1参照)。   As a measure for improving the processing capability of the embedded system, it is conceivable to use a plurality of CPUs as already adopted in fields other than the embedded system (see Patent Document 1).

特開平11−53327号公報Japanese Patent Laid-Open No. 11-53327

しかしながら、特許文献1に記載のシステムにおいては、実行すべきタスクを接続するキューはCPU毎に専用のものが1つずつ設けられているだけであり、優先度の異なる複数のキューを有するリアルタイムオペレーティングシステムとは前提とする構成が大きく異なり、参考とすることができない。   However, in the system described in Patent Document 1, only one queue for connecting tasks to be executed is provided for each CPU, and a real-time operating system having a plurality of queues with different priorities. The system assumes a very different configuration and cannot be used as a reference.

特に、このように複数のCPUを用いても、各CPUに負荷を適切に分散しないと、例えば、実行すべきタスクは多くあるにも拘わらず、あるCPUにはタスクが割り当てられていない等の状態が生じ、CPUの複数化による処理能力向上効果を十分に発揮させることができない。また、複数のCPUを用いる場合、優先度の高いタスクを如何に迅速にCPUに割り当てるかという課題がある。   In particular, even if a plurality of CPUs are used in this manner, if the load is not properly distributed to each CPU, for example, there are many tasks to be executed, but no tasks are assigned to a certain CPU. A state arises, and the effect of improving the processing capability by using multiple CPUs cannot be fully exhibited. Further, when using a plurality of CPUs, there is a problem of how quickly a task with a high priority is assigned to the CPUs.

そこで、本発明は、複数のCPUを有する組込みシステムにおいて、各CPUにタスクを適切に動的分散することができると共に、優先度の高いタスクを迅速に処理することができるシステム及びプログラム等を提供することを課題とする。   Therefore, the present invention provides a system, a program, and the like that can appropriately dynamically distribute tasks to each CPU and can quickly process high priority tasks in an embedded system having a plurality of CPUs. The task is to do.

上記課題を解決するために、本発明は、次のように構成したことを特徴とする。   In order to solve the above-mentioned problems, the present invention is configured as follows.

まず、本願の請求項1に記載の発明(以下、第1発明という)は、複数のCPUと、該複数のCPUで共用の第1、第2、第3記憶装置とを有する組込みコンピュータを制御するプログラムであって、コンピュータを、上記第1記憶装置上に、上記各CPUで共用とされて異なる優先度が設定された複数のレディキューを作成するレディキュー作成手段、上記第2記憶装置に記憶されている複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定するタスク優先度設定手段、上記第3記憶装置上に、上記複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成するタスク管理情報作成手段、該タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第3記憶装置上における格納領域の情報を、上記レディキュー作成手段で作成された複数のレディキューのうちの、上記タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納するタスク管理情報格納領域情報格納手段、上記複数のCPUで実行中のタスクのうちのいずれかのタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除するタスク管理情報格納領域情報削除手段、上記タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中の全タスクのタスク実行権を解放させて全CPUを一時タスク非実行状態とさせるタスク実行権解放手段、該タスク実行権解放手段で全タスクのタスク実行権が解放されるときに、この解放される各タスクの状態を当該各タスクのタスク管理情報に記録するタスク実行権解放時状態記録手段、上記タスク実行権解放手段でタスク非実行状態とされた各CPUに、上記複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューに格納されたタスク情報格納領域情報に係るタスクを、該レディキューの先頭側から順に割り当てるタスク割り当て手段、該タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させるタスク実行手段として機能させることを特徴とする。   First, the invention according to claim 1 of the present application (hereinafter referred to as the first invention) controls an embedded computer having a plurality of CPUs and first, second, and third storage devices shared by the plurality of CPUs. A ready queue creating means for creating a plurality of ready queues which are shared by the CPUs and set different priorities on the first storage device, and the second storage device Task priority setting means for setting a priority of at least a task to be executed among a plurality of stored tasks, and task management of at least a task to be executed among the plurality of tasks on the third storage device Task management information creating means for creating information, information on the storage area on the third storage device of the task management information of the task to be executed created by the task management information creating means Management information storage area information stored at the tail of the ready queue having the same priority as the priority set by the task priority setting means among the plurality of ready queues created by the ready queue creation means Task management information for deleting, from the ready queue, task management information storage area information related to a task for which execution has been completed when execution of any of the tasks being executed by the storage means and the plurality of CPUs is completed When the task information storage area information related to the task to be executed by the storage area information deletion means and the task information storage area information storage means is stored at the end of the ready queue corresponding to the priority of the task, the execution is executed. If a task whose priority is lower than the priority of the task to be executed is being executed, the task execution right of all the tasks being executed is released and all tasks are Task execution right release means for setting the PU in a temporary task non-execution state, and when the task execution right of all tasks is released by the task execution right release means, the state of each released task is set as the task management of each task. The task execution right release state recording means to record in the information, the task management information storage area information stored in the plurality of ready queues is stored in each of the CPUs in the task non-execution state by the task execution right release means. Task allocation means for allocating tasks related to the task information storage area information stored in the ready queue having a high priority in order from the head side of the ready queue, and the task assigned to the CPU to which the task is allocated by the task allocation means As a task execution means for executing the task based on the task management information storage area information of the task. The

また、本願の請求項2に記載の発明(以下、第2発明という)は、第1発明において、コンピュータをタスク実行権解放手段として機能させるときに、タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるとき、または実行が終了したタスクに係るタスク管理情報格納領域情報がタスク管理情報格納領域情報削除手段によってレディキューから削除されるときに、実行中の全タスクのタスク実行権を解放させて全CPUを一時タスク非実行状態とさせることを特徴とする。   The invention according to claim 2 of the present application (hereinafter referred to as the second invention) should be executed by the task information storage area information storage means when the computer functions as the task execution right releasing means in the first invention. When task information storage area information related to a task is stored at the end of the ready queue corresponding to the priority of the task, a task having a lower priority than the priority of the task to be executed is being executed Or when the task management information storage area information related to the task whose execution has been completed is deleted from the ready queue by the task management information storage area information deletion means, the task execution right of all the tasks being executed is released and all CPUs are released. The temporary task is not executed.

そして、本願の請求項3に記載の発明(以下、第3発明という)は、第1発明または第2発明において、複数のCPUのうちに特定の機能を有する特定CPUが備えられている場合において、コンピュータをレディキュー作成手段として機能させるときに、上記特定CPUに関連付けた特定のレディキューを作成するように機能させ、タスク管理情報格納領域情報格納手段として機能させるときに、上記特定の機能を利用する特定タスクのタスク管理情報格納領域情報については上記特定のレディキューに格納するように機能させ、タスク割り当て手段として機能させるときに、特定のレディキューに接続された特定タスクを、該特定CPUに割り当てるように機能させることを特徴とする。   In the invention according to claim 3 of the present application (hereinafter referred to as the third invention), in the first invention or the second invention, a specific CPU having a specific function is provided among a plurality of CPUs. When the computer functions as a ready queue creation unit, the function is performed so as to create a specific ready queue associated with the specific CPU, and the specific function is performed when the computer functions as a task management information storage area information storage unit. The task management information storage area information of the specific task to be used is functioned to be stored in the specific ready queue, and when functioning as task assigning means, the specific task connected to the specific ready queue is assigned to the specific CPU. It is made to function so that it may be assigned to.

そして、本願の請求項4に記載の発明(以下、第4発明という)は、第1発明から第3発明のいずれかの発明において、複数のCPU及び第1、第2、第3記憶装置に加え、外部割り込み処理機能を有する専用CPU及び第4、第5、第6記憶装置が備えられた組込みコンピュータにおいて、コンピュータにおける上記複数のCPU及び第1、第2、第3記憶装置を含む第1の部分を請求項1から請求項3のいずれかに記載の各手段として機能させる第1の制御部と、専用CPU及び第4、第5、第6記憶装置を含む第2の部分を、第1の複数のタスクの実行制御に係る要求を第1の制御部に対して行う第2の複数のタスクを制御する手段として機能させる第2の制御部とからなり、第2の制御部は、コンピュータの第2の部分を、上記第4記憶装置上に専用CPUで共用とされて異なる優先度が設定された第2の複数のレディキューを作成する第2レディキュー作成手段、上記第5記憶装置に記憶されている、第1の複数のタスクを実行制御する第2の複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定する第2タスク優先度設定手段、上記第6記憶装置上に、上記第2の複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成する第2タスク管理情報作成手段、該第2タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第6記憶装置上における格納領域の情報を、上記第2レディキュー作成手段で作成された第2の複数のレディキューのうちの、上記第2タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納する第2タスク管理情報格納領域情報格納手段、上記専用CPUで実行中のタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除する第2タスク管理情報格納領域情報削除手段、上記第2タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中のタスクのタスク実行権を解放させてCPUを一時タスク非実行状態とさせる第2タスク実行権解放手段、該第2タスク実行権解放手段でタスクの実行権が解放されるときに、この解放されるタスクの状態を当該タスクのタスク管理情報に記録する第2タスク実行権解放時状態記録手段、上記第2タスク実行権解放手段でタスク非実行状態とされたCPUに、上記第2の複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューの先頭に格納されたタスク情報格納領域情報に係るタスクを割り当てる第2タスク割り当て手段、該第2タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させる第2タスク実行手段として機能させることを特徴とする。   The invention according to claim 4 of the present application (hereinafter referred to as the fourth invention) includes a plurality of CPUs and first, second, and third storage devices in any of the first to third inventions. In addition, in an embedded computer provided with a dedicated CPU having an external interrupt processing function and fourth, fifth, and sixth storage devices, the first CPU including the plurality of CPUs and the first, second, and third storage devices in the computer A second control unit including a dedicated control unit, a fourth CPU, a fourth storage unit, and a sixth storage unit; and a second control unit configured to function as each unit according to any one of claims 1 to 3. A second control unit that functions as a means for controlling a second plurality of tasks that perform requests related to execution control of a plurality of tasks to the first control unit, and the second control unit includes: The second part of the computer is connected to the fourth part Second ready queue creating means for creating a second plurality of ready queues that are shared by the dedicated CPU and set with different priorities on the storage device; the first plurality of queues stored in the fifth storage device Second task priority setting means for setting the priority of at least the task to be executed among the second plurality of tasks for controlling execution of the second task, and the second storage task on the sixth storage device. Second task management information creating means for creating task management information of at least a task to be executed, task management information of a task to be executed created by the second task management information creating means on the sixth storage device The storage area information has the same priority as the priority set by the second task priority setting means among the plurality of second ready queues created by the second ready queue creation means. The second task management information storage area information storage means stored at the end of the dequeue, and when the execution of the task being executed by the dedicated CPU is completed, the task management information storage area information relating to the task that has been executed is ready The second task management information storage area information deletion means to be deleted from the queue, the task information storage area information relating to the task to be executed by the second task information storage area information storage means is the last of the ready queue corresponding to the priority of the task. In the case where the task is stored in the tail and the task whose priority is lower than the priority of the task to be executed is being executed, the task execution right of the task being executed is released and the CPU is in a temporary task non-execution state. Second task execution right releasing means, and when the task execution right is released by the second task execution right releasing means, The second task execution right release state recording means for recording the state in the task management information of the task, the CPU in the task non-execution state by the second task execution right release means, and the second plurality of ready queues Of the tasks related to the stored task management information storage area information, the second task allocation means for allocating the task related to the task information storage area information stored at the head of the ready queue having a high priority, the second task allocation means The CPU to which the task is assigned is made to function as a second task execution unit that causes the task to be executed based on the task management information storage area information of the task.

また、本願の請求項5に記載の発明(以下、第5発明という)は、第1発明から第4発明のいずれかの組込みシステム制御用プログラムを記録したコンピュータ読み取り可能な記録媒体に関するものである。   The invention according to claim 5 of the present application (hereinafter referred to as the fifth invention) relates to a computer-readable recording medium recording the embedded system control program according to any of the first to fourth inventions. .

次に、本願の請求項6に記載の発明(以下、第6発明という)は、複数のCPUと、該複数のCPUで共用の第1、第2、第3記憶装置と、上記第1記憶装置上に、上記各CPUで共用とされて異なる優先度が設定された複数のレディキューを作成するレディキュー作成手段と、上記第2記憶装置に記憶されている複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定するタスク優先度設定手段と、上記第3記憶装置上に、上記複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成するタスク管理情報作成手段と、該タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第3記憶装置上における格納領域の情報を、上記レディキュー作成手段で作成された複数のレディキューのうちの、上記タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納するタスク管理情報格納領域情報格納手段と、上記複数のCPUで実行中のタスクのうちのいずれかタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除するタスク管理情報格納領域情報削除手段と、上記タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中の全タスクの実行権を解放させて全CPUを一時タスク非実行状態とさせるタスク実行権解放手段と、該タスク実行権解放手段で全タスクの実行権が解放されるときに、この解放される各タスクの状態を当該各タスクのタスク管理情報に記録するタスク実行権解放時状態記録手段と、上記タスク実行権解放手段でタスク非実行状態とされた各CPUに、上記複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューに格納されたタスク情報格納領域情報に係るタスクを、該レディキューの先頭側から順に割り当てるタスク割り当て手段と、該タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させるタスク実行手段とを有することを特徴とする。   Next, an invention according to claim 6 of the present application (hereinafter referred to as a sixth invention) includes a plurality of CPUs, first, second, and third storage devices shared by the plurality of CPUs, and the first memory. A ready queue creating means for creating a plurality of ready queues shared by the CPUs and set with different priorities on the device, and at least execution of a plurality of tasks stored in the second storage device Task priority setting means for setting the priority of a task to be performed; task management information creating means for creating task management information for at least a task to be executed among the plurality of tasks on the third storage device; The information of the storage area on the third storage device of the task management information of the task to be executed created by the task management information creation means is stored in the plurality of ready queues created by the ready queue creation means. The task management information storage area information storage means for storing at the tail of the ready queue having the same priority as the priority set by the task priority setting means, and any of the tasks being executed by the plurality of CPUs The task management information storage area information deletion means for deleting the task management information storage area information related to the task for which execution has been completed from the ready queue and the task information storage area information storage means When task information storage area information related to a task to be stored is stored at the end of the ready queue corresponding to the priority of the task, a task having a lower priority than the priority of the task to be executed is being executed. When there is, task execution right releasing means for releasing the execution right of all the tasks being executed and setting all the CPUs to the temporary task non-execution state, and the task When the execution right for all tasks is released by the right release means, the task execution right release state recording means for recording the state of each released task in the task management information of each task, and the task execution right The task information storage area stored in the ready queue having a high priority among the tasks related to the task management information storage area information stored in the plurality of ready queues in each CPU that has been set to the task non-execution state by the release means Task allocation means for assigning tasks related to information in order from the head of the ready queue, and the CPU to which the tasks are assigned by the task assignment means, execute the tasks based on the task management information storage area information of the tasks And a task execution means.

また、本願の請求項7に記載の発明(以下、第7発明という)は、第6発明において、タスク実行権解放手段は、タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるとき、または実行が終了したタスクに係るタスク管理情報格納領域情報がタスク管理情報格納領域情報削除手段によってレディキューから削除されるときに、実行中の全タスクのタスク実行権を解放させて全CPUを一時タスク非実行状態とさせることを特徴とする。   In the invention according to claim 7 of the present application (hereinafter referred to as the seventh invention), in the sixth invention, the task execution right releasing means stores task information related to a task to be executed by the task information storage area information storage means. When the area information is stored at the tail of the ready queue corresponding to the priority of the task, when a task having a lower priority than the priority of the task to be executed is being executed, or the execution has been completed When the task management information storage area information related to the task is deleted from the ready queue by the task management information storage area information deletion means, the task execution right of all the tasks being executed is released and all the CPUs are set to the temporary task non-execution state. It is characterized by making it.

また、本願の請求項8に記載の発明(以下、第8発明という)は、第6発明または第7発明において、複数のCPUのうちに特定の機能を有する特定CPUが備えられている場合において、レディキュー作成手段は、上記特定CPUに関連付けた特定のレディキューを作成し、タスク管理情報格納領域情報格納手段は、上記特定の機能を利用する特定タスクのタスク管理情報格納領域情報については上記特定のレディキューに格納し、タスク割り当て手段は、特定のレディキューに接続された特定タスクを、該特定CPUに割り当てることを特徴とする。   In the invention according to claim 8 of the present application (hereinafter referred to as the eighth invention), in the sixth invention or the seventh invention, a specific CPU having a specific function is provided among a plurality of CPUs. The ready queue creation means creates a specific ready queue associated with the specific CPU, and the task management information storage area information storage means includes the task management information storage area information of the specific task that uses the specific function. The task assigning means stores a specific task connected to the specific ready queue, and stores the specific task in the specific ready queue.

そして、本願の請求項9に記載の発明(以下、第9発明という)は、第6発明から第8発明のいずれかにおいて、複数のCPU及び第1、第2、第3記憶装置に加え、外部割り込み処理機能を有する専用CPU及び第4、第5、第6記憶装置が備えられており、かつ、請求項6から請求項8のいずれかに記載の各手段を含む第1の制御部は、上記複数のCPU及び第1、第2、第3記憶装置を含む第1の部分を制御し、上記専用CPU及び第4、第5、第6記憶装置を含む第2の部分を、第1の複数のタスクの実行制御に係る要求を第1の制御部に行う第2の複数のタスクを制御する手段として機能させる第2の制御部は、上記第4記憶装置上に、専用CPUで共用とされて異なる優先度が設定された第2の複数のレディキューを作成する第2レディキュー作成手段と、上記第5記憶装置に記憶されている、第1の複数のタスクを実行制御する第2の複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定する第2タスク優先度設定手段と、上記第6記憶装置上に、上記第2の複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成する第2タスク管理情報作成手段と、該第2タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第6記憶装置上における格納領域の情報を、上記第2レディキュー作成手段で作成された第2の複数のレディキューのうちの、上記第2タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納する第2タスク管理情報格納領域情報格納手段と、上記専用CPUで実行中のタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除するタスク第2管理情報格納領域情報削除手段と、上記第2タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中のタスクのタスク実行権を解放させてCPUを一時タスク非実行状態とさせる第2タスク実行権解放手段と、該第2タスク実行権解放手段でタスクのタスク実行権が解放されるときに、この解放されるタスクの状態を当該タスクのタスク管理情報に記録する第2タスク実行権解放時状態記録手段と、上記第2タスク実行権解放手段でタスク非実行状態とされたCPUに、上記第2の複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューの先頭に格納されたタスク情報格納領域情報に係るタスクを割り当てる第2タスク割り当て手段と、該第2タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させる第2タスク実行手段とを有することを特徴とする。   The invention according to claim 9 of the present application (hereinafter referred to as the ninth invention), in any of the sixth invention to the eighth invention, in addition to the plurality of CPUs and the first, second, and third storage devices, A first control unit including a dedicated CPU having an external interrupt processing function and fourth, fifth, and sixth storage devices, and including each unit according to any one of claims 6 to 8. The first portion including the plurality of CPUs and the first, second and third storage devices is controlled, and the second portion including the dedicated CPU and the fourth, fifth and sixth storage devices is controlled as the first portion. The second control unit that functions as a means for controlling the second plurality of tasks that requests the first control unit to execute requests related to the execution control of the plurality of tasks is shared by the dedicated CPU on the fourth storage device. To create a second plurality of ready queues with different priorities A second task for setting a priority of at least a task to be executed among a plurality of second tasks stored in the fifth storage device and controlled to execute the first plurality of tasks. Priority setting means; second task management information creating means for creating task management information of at least a task to be executed out of the second plurality of tasks on the sixth storage device; and the second task management. The information of the storage area on the sixth storage device of the task management information of the task to be executed created by the information creating means is stored in the second plurality of ready queues created by the second ready queue creating means. The second task management information storage area information storage means for storing at the tail of the ready queue having the same priority as the priority set by the second task priority setting means, and the dedicated CPU Task second management information storage area information deletion means for deleting task management information storage area information relating to the task for which execution has ended from the ready queue when the execution of the current task is completed, and the second task information storage area When task information storage area information related to a task to be executed by the information storage means is stored at the tail of the ready queue corresponding to the priority of the task, the priority is lower than the priority of the task to be executed When the task is being executed, the second task execution right releasing means for releasing the task execution right of the task being executed and causing the CPU to be in a temporary task non-execution state, and the second task execution right releasing means Second task execution right release state recording means for recording the state of the released task in the task management information of the task when the task execution right is released; The CPU in the task non-execution state by the second task execution right releasing means has a higher priority among the tasks related to the task management information storage area information stored in the second plurality of ready queues. A second task assigning means for assigning a task related to task information storage area information stored at the head of the queue, and a task management information storage area for the task to the CPU assigned the task by the second task assignment means And a second task execution means that is executed based on the information.

次に、本発明の効果について説明する。   Next, the effect of the present invention will be described.

まず、第1発明によれば、タスクを処理するタスク処理手段としての複数のCPUを有する組込みコンピュータにおいて、上記各CPUで共用とされて異なる優先度が設定された複数のレディキューが作成され、第2記憶装置に記憶されている複数のタスクのうちの少なくとも実行すべきタスクの優先度が設定され、第3記憶装置に、上記複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報が作成される。   First, according to the first invention, in a built-in computer having a plurality of CPUs as task processing means for processing tasks, a plurality of ready queues that are shared by the CPUs and set with different priorities are created. The priority of at least a task to be executed among the plurality of tasks stored in the second storage device is set, and task management information of at least the task to be executed among the plurality of tasks is stored in the third storage device. Created.

そして、この実行すべきタスクのタスク管理情報の上記第3記憶装置上における格納領域の情報が、上記複数のレディキューのうちの、上記タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納される。 また、上記複数のCPUで実行中のタスクのうちのいずれかのタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報がレディキューから削除される。   The information of the storage area on the third storage device of the task management information of the task to be executed is the same priority as the priority set by the task priority setting means in the plurality of ready queues. Stored at the end of the ready queue. Further, when the execution of any of the tasks being executed by the plurality of CPUs is completed, the task management information storage area information relating to the task for which the execution has been completed is deleted from the ready queue.

そして、実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中の全タスクのタスク実行権が解放されて全CPUが一時タスク非実行状態とされると共に、全タスクの実行権が解放されるときに、この解放される各タスクの状態が当該各タスクのタスク管理情報に記録される。   When task information storage area information relating to a task to be executed is stored at the tail of the ready queue corresponding to the priority of the task, a task having a lower priority than the priority of the task to be executed When the task is being executed, the task execution right of all the tasks being executed is released and all CPUs are set to the temporary task non-execution state. The task status is recorded in the task management information of each task.

そして、上記タスク非実行状態とされた各CPUに、上記複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューに格納されたタスク情報格納領域情報に係るタスクが、該レディキューの先頭側から順に割り当てられ、タスクが割り当てられたCPUにより、当該タスクが、当該タスクのタスク管理情報格納領域情報に基づいて実行される。   The task information storage area stored in the ready queue having a high priority among the tasks related to the task management information storage area information stored in the plurality of ready queues in each CPU in the task non-execution state Tasks related to information are assigned in order from the head of the ready queue, and the task is executed by the CPU to which the task is assigned based on the task management information storage area information of the task.

これによれば、実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、該タスクが即座に複数のCPUのうちのいずれかのCPUに割り当てられて実行されることとなり、複数のCPUを有する組込みコンピュータにおいても優先度の高いタスクのリアルタイム処理が確実に確保される。   According to this, when a task having a lower priority than the priority of the task to be executed is being executed, the task is immediately assigned to any one of a plurality of CPUs and executed. Thus, even in an embedded computer having a plurality of CPUs, real-time processing of tasks with high priority is ensured.

また、複数のCPUで実行中の複数のタスクのいずれかについて実行が終了したときには、このタスクの実行が終了したCPUに即座にタスクが割り当てられて実行されることとなり、タスク処理が終了したCPUにいつまでもタスクが割り当てられない状態が生じることがない。   Further, when execution of any of a plurality of tasks being executed by a plurality of CPUs is completed, the task is immediately assigned to the CPU that has completed the execution of the task and executed, and the CPU that has completed the task processing. There is no case where a task is not assigned indefinitely.

つまり、複数のCPUにタスクが適切に動的分散されて、各CPUの負荷のばらつきが少なくなると共に、優先度の高いタスクの迅速な処理が確保される。   That is, tasks are appropriately dynamically distributed to a plurality of CPUs, variation in the load of each CPU is reduced, and prompt processing of tasks with high priority is ensured.

また、全CPUにタスクが割り当て直されることとなるから、これらのCPUに、確実に、処理の優先順位が最も高いタスクから順に割り当てられることとなる。   Further, since tasks are reassigned to all CPUs, these CPUs are surely assigned in order from the task having the highest processing priority.

なお、第1記憶装置、第2記憶装置、及び第3記憶装置は、1つの記憶装置を共用してもよい。   Note that the first storage device, the second storage device, and the third storage device may share one storage device.

次に、第2発明によれば、複数のCPUで実行中のタスクのうちのいずれかのタスクの実行が終了したときも、このタスクの実行が終了したCPUに即座にタスクが割り当てられて実行されることとなり、タスク実行が終了したCPUにいつまでもタスクが割り当てられない状態が生じることがない。   Next, according to the second invention, even when the execution of any of the tasks being executed by a plurality of CPUs is completed, the task is immediately assigned to the CPU that has completed the execution of the task and executed. As a result, there is no case where a task is not assigned to a CPU for which task execution has been completed.

また、第3発明によれば、複数のCPUのうちに特定の機能を有する特定CPUが備えられている場合において、上記特定CPUに関連付けた特定のレディキューが作成され、上記特定の機能を利用する特定タスクは、複数のレディキューのうちの特定のレディキューに接続され、特定のレディキューに接続された特定タスクは、特定CPUに割り当てられることとなる。   According to the third invention, when a specific CPU having a specific function is provided among a plurality of CPUs, a specific ready queue associated with the specific CPU is created and the specific function is used. The specific task to be connected is connected to a specific ready queue among the plurality of ready queues, and the specific task connected to the specific ready queue is assigned to a specific CPU.

これによれば、例えば特定タスクの処理は特定CPUでしかできないような場合に、特定タスクが、当該タスクを処理することができないCPUに割り当てられることがない。また、特定タスクの処理は特定CPU以外のCPUでもできるが特定CPUで処理すればよりタスク処理速度の向上が望めるような場合に、当該特定タスクを当該タスクの実行に適した特定CPUによって処理することができ、この結果、特定タスクの処理速度の向上等が図れる。   According to this, for example, when a specific task can be processed only by a specific CPU, the specific task is not assigned to a CPU that cannot process the task. Further, the specific task can be processed by a CPU other than the specific CPU, but if the specific CPU can improve the task processing speed, the specific task is processed by the specific CPU suitable for executing the task. As a result, the processing speed of the specific task can be improved.

なお、特定レディキューよりも優先度が高いレディキューにタスクが存在する場合、当該優先度が高いレディキューのタスクを特定CPUに割り当てるようにしてもよいし、特定レディキューに存在するタスクを、優先度が高いレディキューに存在するタスクに優先して特定CPUに割り当てるようにしてもよい。また、特定レディキューには特定タスクのみ接続するようにしてもよいし、特定タスク以外のタスクも接続するようにしてもよい。   If a task exists in a ready queue having a higher priority than the specific ready queue, the task of the ready queue having a higher priority may be assigned to the specific CPU, or the task existing in the specific ready queue may be You may make it allocate to a specific CPU in priority to the task which exists in the ready queue with a high priority. Further, only a specific task may be connected to the specific ready queue, or a task other than the specific task may be connected.

さらに、第4発明によれば、組込みコンピュータ制御プログラムには、コンピュータにおける複数のCPU及び第1、第2、第3記憶装置を含む第1の部分を請求項1から請求項3のいずれかに記載の各手段として機能させる第1の制御部に加えて、外部割り込み処理機能を有する専用CPU及び第4、第5、第6記憶装置を含む第2の部分を、第1の複数のタスクの実行制御の要求を第1の制御部に行う第2の複数のタスクを制御する手段として機能させる第2の制御部が備えられているから、専用CPUで外部割込み処理が処理される。なお、この場合、他の複数のCPUで外部割込み処理を行わないようにしてもよく、これによれば他の複数のCPUの外部割込み処理の負荷が解消される。また、第2の制御部で第1の制御部を状況に応じて制御することができる。また、第1の制御部と第2の制御部とはほぼ同じ構成であるから、専用CPUで外部割込み処理を行う仕組みを容易に構築することができると共に、第1の制御部及び第2の制御部をそれぞれの機能にあわせて最適化することができる。   Further, according to the fourth invention, the embedded computer control program includes a first part including a plurality of CPUs and first, second, and third storage devices in the computer according to any one of claims 1 to 3. In addition to the first control unit functioning as each described unit, the second part including the dedicated CPU having the external interrupt processing function and the fourth, fifth, and sixth storage devices is provided for the first plurality of tasks. Since the second control unit that functions as a means for controlling the second plurality of tasks for executing the execution control request to the first control unit is provided, the external interrupt processing is processed by the dedicated CPU. In this case, external interrupt processing may not be performed by a plurality of other CPUs, thereby eliminating the load of external interrupt processing of the other CPUs. Further, the second control unit can control the first control unit according to the situation. In addition, since the first control unit and the second control unit have substantially the same configuration, it is possible to easily construct a mechanism for performing external interrupt processing with the dedicated CPU, and the first control unit and the second control unit. The control unit can be optimized for each function.

また、第5発明によれば、第1発明から第4発明のいずれかの組込みシステム制御用プログラムを記録したコンピュータ読み取り可能な記録媒体が構成される。   According to the fifth aspect of the invention, there is provided a computer-readable recording medium on which the embedded system control program according to any of the first to fourth aspects of the invention is recorded.

次に、第6発明から第9発明は、第1発明から第4発明のプログラムに対応する組込みシステムの発明であって、これによれば、第1発明から第4発明で説明した作用効果が組込みシステムで達成される。   Next, the sixth invention to the ninth invention are inventions of embedded systems corresponding to the programs of the first invention to the fourth invention, and according to this, the functions and effects described in the first invention to the fourth invention are achieved. Achieved with embedded systems.

以下、本発明の実施の形態について説明する。   Hereinafter, embodiments of the present invention will be described.

まず、図1を用いて本発明に係る組込みシステムAについて説明すると、該組込みシステムAは、複数のCPUB…Bと、該複数のCPUB…Bで共用の記憶装置Cと、上記記憶装置Cに、上記各CPUB…Bで共用とされて異なる優先度が設定された複数のレディキューD…Dを作成するレディキュー作成手段Eと、上記記憶装置Cに記憶されている複数のタスクF…Fのうちの少なくとも実行すべきタスクF…Fの優先度を設定するタスク優先度設定手段Gと、上記記憶装置Cに、上記複数のタスクF…Fのうちの少なくとも実行すべきタスクF…Fのタスク管理情報H…Hを作成するタスク管理情報作成手段Iと、該タスク管理情報作成手段Iで作成された実行すべきタスクF…Fのタスク管理情報H…Hの上記記憶装置C上における格納領域の情報J…Jを、上記レディキュー作成手段Eで作成された複数のレディキューD…Dのうちの、上記タスク優先度設定手段Gで設定された優先度と同一優先度のレディキューDの最後尾に格納するタスク管理情報格納領域情報格納手段Kと、上記複数のCPUB…Bで実行中のタスクF…FのうちのいずれかタスクFの実行が終了したときに、この実行が終了したタスクFに係るタスク管理情報格納領域情報JをレディキューDから削除するタスク管理情報格納領域情報削除手段Lと、上記タスク情報格納領域情報格納手段Kによって実行すべきタスクFに係るタスク情報格納領域情報Jが該タスクFの優先度に対応するレディキューDの最後尾に格納される場合において、該実行すべきタスクFの優先度よりも優先度が低いタスクF…Fが実行中であるときは、実行中の全タスクF…Fのタスク実行権を解放させて全CPUB…Bを一時タスク非実行状態とさせるタスク実行権解放手段Mと、該タスク実行権解放手段Mで全タスクF…Fの実行権が解放されるときに、この解放された各タスクF…Fの状態を当該各タスクF…Fのタスク管理情報H…Hに記録するタスク実行権解放時状態記録手段Nと、上記タスク実行権解放手段Mでタスク非実行状態とされた各CPUB…Bに、上記複数のレディキューD…Dに格納されたタスク管理情報格納領域情報J…Jに係るタスクF…Fのうちの、優先度の高いレディキューD…Dに格納されたタスク情報格納領域情報J…Jに係るタスクF…Fを、該レディキューD…Dの先頭側から順に割り当てるタスク割り当て手段Oと、該タスク割り当て手段OでタスクF…Fを割り当てたCPUB…Bに、当該タスクF…Fを、当該タスクF…Fのタスク管理情報格納領域情報J…Jに基づいて実行させるタスク実行手段Pとを有する。以下、この組込みシステムAについて、第1〜第3の実施の形態を通して詳しく説明する。なお、この組込みシステムAにおいては、特許請求の範囲の請求項1〜3に係る第1,第2,第3記憶装置は共用とされている。   First, the embedded system A according to the present invention will be described with reference to FIG. 1. The embedded system A includes a plurality of CPUB ... B, a storage device C shared by the plurality of CPUB ... B, and the storage device C. , A ready queue creation means E for creating a plurality of ready queues D... D that are shared by the CPUs B and set with different priorities, and a plurality of tasks F... F stored in the storage device C. Task priority setting means G for setting the priority of at least the task F... F to be executed, and at least the tasks F... F to be executed among the plurality of tasks F. Task management information creation means I for creating task management information H ... H, and task management information H ... H of the task F ... F to be executed created by the task management information creation means I on the storage device C The storage area information J... J is used as a ready queue having the same priority as the priority set by the task priority setting means G among the plurality of ready queues D... D created by the ready queue creation means E. When the execution of any one of the task management information storage area information storage means K stored at the end of D and the tasks F... F being executed by the CPUs B. Task management information storage area information deletion means L for deleting the task management information storage area information J related to the finished task F from the ready queue D, and task information related to the task F to be executed by the task information storage area information storage means K When the storage area information J is stored at the end of the ready queue D corresponding to the priority of the task F, a task having a lower priority than the priority of the task F to be executed When F... F is being executed, task execution right releasing means M for releasing the task execution right of all currently executing tasks F... F and making all CPU B. When the right release means M releases the right to execute all the tasks F ... F, the task execution records the state of each released task F ... F in the task management information H ... H of each task F ... F. The task management information storage area information J stored in the plurality of ready queues D... D is stored in each of the CPU B... B that is in a task non-execution state by the right release state recording means N and the task execution right release means M. Among the tasks F... F related to J, the task F storage F related to the task information storage area information J... J stored in the ready queue D. Task assignment means O assigned in order The task execution means P for causing the CPUs B ... B to which the tasks F ... F are assigned by the task assignment means O to execute the tasks F ... F based on the task management information storage area information J ... J of the tasks F ... F. And have. Hereinafter, the embedded system A will be described in detail through the first to third embodiments. In this embedded system A, the first, second and third storage devices according to claims 1 to 3 of the claims are shared.

まず、第1の実施の形態について説明する。   First, the first embodiment will be described.

図2に示すように、第1の実施の形態の組込みシステムを構成する組込みコンピュータ1は、複数のCPU11−1〜11−n(以下、CPU1,CPU2,CPU3,…CPUnという)と、単一の共有メモリ12(図1の記憶装置Cに相当)と、これらを接続する共有バス13とを有する。   As shown in FIG. 2, the embedded computer 1 constituting the embedded system of the first embodiment includes a plurality of CPUs 11-1 to 11-n (hereinafter referred to as CPU1, CPU2, CPU3,. Shared memory 12 (corresponding to the storage device C in FIG. 1) and a shared bus 13 for connecting them.

共有メモリ12は、ROM及びRAMからなる。該共有メモリ12には、請求項1及び請求項2に記載の組込みコンピュータ制御プログラムを構成して、組込みコンピュータ1を図1に記載の各手段として機能させるリアルタイムオペレーティングシステム21(以下、OS21という)と、複数のタスク22…22(図1のタスクF…Fに相当)と、該OS21に関する種々のパラメータや一時データ等からなるOSデータ23とが格納されている。   The shared memory 12 includes a ROM and a RAM. In the shared memory 12, a real-time operating system 21 (hereinafter referred to as an OS 21) that configures the embedded computer control program according to claims 1 and 2 to cause the embedded computer 1 to function as each means described in FIG. And a plurality of tasks 22... 22 (corresponding to tasks F... F in FIG. 1) and OS data 23 including various parameters and temporary data related to the OS 21 are stored.

OS21は、上記共有メモリ12からCPU1〜CPUn上にそれぞれ読み込まれて実行される。換言すれば、共有メモリ12上に格納されているOS21は1つであるが、各CPU1〜CPUn上で並行して実行され、各CPU上で実行されるOS21により当該各CPU上でのタスク22の実行が制御されることとなる。なお、このOS21の機能の詳細については後述する。   The OS 21 is read from the shared memory 12 and executed on each of the CPUs 1 to CPUn. In other words, although there is one OS 21 stored on the shared memory 12, the task 21 on each CPU is executed by the OS 21 that is executed in parallel on each CPU1 to CPUn and executed on each CPU. Execution is controlled. Details of the function of the OS 21 will be described later.

OSデータ23は、上記複数のCPU上でそれぞれ実行されるOS21で共有のOS共有データ23aと、上記複数のCPU上でそれぞれ実行されるOS21毎に固有の非共有データ23bとからなる。OS共有データ23aには、複数のレディキュー(図1のレディキューD…Dに相当、図3参照)の状態を管理するレディキューテーブル(図4参照)が含まれている。なお、その詳細については後述する。   The OS data 23 includes OS shared data 23a shared by the OS 21 executed on the plurality of CPUs, and non-shared data 23b unique to each OS 21 executed on the plurality of CPUs. The OS shared data 23a includes a ready queue table (see FIG. 4) for managing the states of a plurality of ready queues (corresponding to the ready queues D to D in FIG. 1, see FIG. 3). Details thereof will be described later.

OS21は、CPU1〜CPUnがタスク22…22を実行しているときにはCPU実行状態と判定し、タスク22…22を実行していないときはCPUアイドル状態(特許請求の範囲に記載のタスク非実行状態)と判定する。   The OS 21 determines the CPU execution state when the CPUs 1 to CPUn are executing the tasks 22... 22, and the CPU idle state (the task non-execution state described in the claims) when the tasks 22. ).

タスク22は、OS21によって、実行状態、実行可能状態、待ち状態、休止状態のうちのいずれかの状態に制御される。ここで、実行状態とは、タスク22がOS21によりCPU1〜CPUnのうちのいずれかのCPUに割り当てられて実行中の状態を意味し、実行可能状態とは、タスク22の実行準備は整っているが、そのタスク22よりも優先順位の高いタスク22が実行中であるためそのタスク22を実行できない状態を意味し、待ち状態とは、起動はされたがタスク22の実行条件が整わないため実行できない状態を意味し、休止状態とはタスク22が起動されていない状態をいう。   The task 22 is controlled by the OS 21 to one of an execution state, an executable state, a waiting state, and a hibernation state. Here, the execution state means a state in which the task 22 is assigned to any one of the CPUs 1 to CPUn by the OS 21 and is being executed, and the executable state is ready for execution of the task 22. However, since the task 22 having a higher priority than the task 22 is being executed, it means that the task 22 cannot be executed, and the waiting state is executed because the execution condition of the task 22 is not established although it has been started. This means a state where the task 22 cannot be performed, and the dormant state means a state where the task 22 is not activated.

上記タスク22…22の、例えば上記実行状態等の情報、タスク22…22の優先度等の情報を含むタスク管理情報(図1のタスク管理情報H…Hに相当)は、OS21によって、例えばOS21の起動時にタスク22…22の全てに対して作成され、上記メモリ12上のOS共有データ23aの一部として記憶される。   Task management information (equivalent to the task management information H... H in FIG. 1) of the tasks 22... 22 including information such as the execution status and the priority of the tasks 22. Are created for all of the tasks 22... 22 and stored as a part of the OS shared data 23 a on the memory 12.

また、タスク22…22の実行の優先度は、OS21によって、タスク重要性、緊急性、サイズ等に基づいて、例えばOS21の起動時にタスク22…22毎に設定され、上記タスク管理情報の一つの情報として上記メモリ12上に記憶される。なお、この優先度は、タスク22…22がOS21に対して要求することにより、または、OS21によって、起動後に変更してもよい。   Also, the priority of execution of the tasks 22... 22 is set by the OS 21 for each task 22... 22 when the OS 21 is started, based on task importance, urgency, size, and the like. Information is stored on the memory 12 as information. This priority may be changed after the task 22... 22 requests the OS 21 or by the OS 21 after activation.

図3は、優先度毎に設けられたレディキューの一例を示す説明図であり、図4は、このような優先度毎のレディキューの状態を管理するレディキューテーブルの構成を示す。このレディキューテーブルは、各レディキュー毎に、当該優先度のレディキューに接続されたタスクの次に接続されたタスクのタスク情報を格納している領域の上記メモリ12上における先頭アドレス情報と、1つ前に接続されたタスクのタスク情報を格納している領域の先頭アドレス情報とからなるタスク管理情報格納領域情報とを格納しており、OS21の起動時に共有メモリ12上のOS共有データ23aの一部として作成される。換言すれば、OS21の起動時に、異なる優先度を持つレディキューが複数作成されることとなる。   FIG. 3 is an explanatory diagram showing an example of a ready queue provided for each priority, and FIG. 4 shows a configuration of a ready queue table for managing the status of the ready queue for each priority. The ready queue table includes, for each ready queue, start address information on the memory 12 in an area storing task information of a task connected next to a task connected to the ready queue of the priority, It stores task management information storage area information consisting of the start address information of the area storing the task information of the task connected immediately before, and the OS shared data 23a on the shared memory 12 when the OS 21 is activated. Created as part of In other words, when the OS 21 is activated, a plurality of ready queues having different priorities are created.

なお、図3は7つのタスク管理情報格納領域情報が格納されている状態を示したが、OS21の起動時にはタスク管理情報格納領域情報は格納されておらず、例えば、タスク22の実行条件が成立したときに、OS21によって、上記複数のレディキューのうちの、当該タスク22の優先度と同一優先度のレディキューの最後尾に格納され、タスク22の実行が終了したときに、この実行が終了したタスク22に係るタスク管理情報格納領域情報がレディキューから削除される。   FIG. 3 shows a state in which seven pieces of task management information storage area information are stored, but no task management information storage area information is stored when the OS 21 is started, and for example, the execution condition of the task 22 is satisfied. Is stored at the tail of the ready queue having the same priority as that of the task 22 among the plurality of ready queues, and the execution is terminated when the execution of the task 22 is completed. The task management information storage area information related to the task 22 is deleted from the ready queue.

ここで、本実施の形態に係るOS21は、スケジューリング方式として、イベントドリブン型タスク優先度順スケジューリング方式を採用している。なお、スケジューリングとは、上記レディキューテーブルを検索して次に実行すべきタスクを決定する(タスクをCPUに割り当てることをいう)。   Here, the OS 21 according to the present embodiment employs an event-driven task priority order scheduling method as a scheduling method. Note that scheduling refers to searching the ready queue table to determine a task to be executed next (referring to assigning a task to a CPU).

具体的には、各CPU1〜CPUn上で実行中のOS21は、(1)実行状態のタスク22または割込み処理から他タスク22の起動(休止状態から実行可能状態への移行)の要求(システムコール等)があったとき、(2)実行状態のタスク22または割込み処理から他タスク22の停止(実行状態から休止状態への移行)の要求があったとき、(3)実行状態のタスク22から自タスク22の待ち状態への移行の宣言があったとき、(4)実行状態のタスク22または割込み処理から他タスク22の待ち状態解除(待ち状態から実行可能状態への移行)の要求があったとき、(5)実行状態のタスク22から自タスク終了の宣言があったとき、(6)実行可能状態のタスクに対し、実行状態のタスクのタスク優先度よりも高優先度のタスク優先度が設定されたとき(システムコール等)のうちのいずれか1つの条件が成立して、実行状態のタスク22の優先度よりも優先度の高いレディキュー(の最後尾)にタスク情報格納領域情報が格納されるとき(接続されるタスクFの優先度よりも優先度が低いタスクが実行状態であるとき)、または実行状態のタスク22がレディキューから切り離されるとき(以下、「所定のスケジューリング条件が成立したとき」という)には、排他制御として、上記複数のCPU1〜CPUnで実行中の全タスク22…22の実行権を解放させてCPU1〜CPUnの全てを一時CPUアイドル状態(タスク非実行状態)とさせると共に、この解放される各タスク22…22の解放されるときの状態を当該各タスク22…22のタスク情報に記録した上で、CPUアイドル状態のCPU1〜CPUnに、上記複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスク22…22のうちの、優先度の高いレディキューに格納されたタスク情報格納領域情報に係るタスク22…22を、該レディキューの先頭側から順に割り当てる。そして、タスク22…22を割り当てたCPU1〜CPUnに、当該タスク22…22を、当該タスク22…22のタスク管理情報格納領域情報に基づいて実行させる。   Specifically, the OS 21 running on each of the CPUs 1 to CPUn (1) requests (system calls) for activation of the task 22 or interrupt processing of the execution state (transition from the sleep state to the executable state) from the other task 22. Etc.) (2) When there is a request to stop another task 22 from the execution state task 22 or interrupt processing (transition from the execution state to the dormant state), (3) from the execution state task 22 When the invoking task 22 transitions to the wait state, there is a request for (4) canceling the wait state of the other task 22 (transition from the wait state to the executable state) from the task 22 or interrupt processing in the execution state. (5) When the invoking task 22 declares the end of its own task, (6) a task with a higher priority than the task priority of the executing task is given to the executing task. When any priority is set (system call or the like), one of the conditions is satisfied, and task information is stored in the ready queue (at the tail) having a higher priority than the priority of the task 22 in the execution state. When area information is stored (when a task having a lower priority than the priority of the task F to be connected is in an execution state), or when an execution state task 22 is disconnected from the ready queue (hereinafter, “predetermined” When the scheduling condition is satisfied ”), as exclusive control, the execution right of all the tasks 22... 22 being executed by the plurality of CPUs 1 to CPUn is released, and all of the CPU1 to CPUn are temporarily in the CPU idle state (tasks). In the non-execution state), the released state of each task 22 ... 22 is recorded in the task information of each task 22 ... 22. In addition, the task information stored in the ready queue having a high priority among the tasks 22... 22 related to the task management information storage area information stored in the plurality of ready queues in the CPU idle CPUs 1 to CPUn. The tasks 22... 22 relating to the storage area information are assigned in order from the head of the ready queue. Then, the CPUs 1 to CPUn to which the tasks 22... 22 are assigned execute the tasks 22... 22 based on the task management information storage area information of the tasks 22.

なお、以後、説明の便宜上、レディキューにタスク管理情報格納領域情報が格納されていることを、レディキューにタスクT1〜T7が接続されているといい、レディキューからタスク管理情報格納領域情報を削除することを、レディキューからタスクを切り離すという。   Hereinafter, for convenience of explanation, it is said that task management information storage area information is stored in the ready queue, that tasks T1 to T7 are connected to the ready queue, and task management information storage area information is stored in the ready queue. Deleting is called disconnecting the task from the ready queue.

次に、上記所定のスケジューリング条件が成立したときに行われるこのリアルタイムOS21によるスケジューリングについて、図5のフローチャートを用いて説明する。   Next, the scheduling by the real-time OS 21 performed when the predetermined scheduling condition is satisfied will be described with reference to the flowchart of FIG.

まず、ステップS1で、割り当て対象のCPUの番号cとして1を設定する。
なお、CPU番号とは、上記CPU1〜CPUnの添字1〜nのことを意味する。次いで、ステップS2で、スケジューリング対象のレディキューの優先度kとして0を設定すると共に、ステップS3で、kに1を加算した後、ステップS4で、kが所定値m以下か否かを判定し、その判定がYESのとき、すなわち、kが所定値m以下のときは、さらに、ステップS5で、優先度kのレディキューにタスクが接続されているか否かを判定する。
First, in step S1, 1 is set as the number c of the allocation target CPU.
The CPU number means the subscripts 1 to n of the CPUs 1 to CPUn. Next, in step S2, 0 is set as the priority k of the ready queue to be scheduled, and in step S3, 1 is added to k. Then, in step S4, it is determined whether k is a predetermined value m or less. When the determination is YES, that is, when k is equal to or smaller than the predetermined value m, it is further determined in step S5 whether or not the task is connected to the ready queue having the priority k.

そして、ステップS5の判定がNOのとき、すなわち、優先度kのレディキューにタスクが接続されていときは、ステップS3に戻り、以後の処理を繰り返す。ここで、ステップS4の所定値mは、OS21が設定する優先度の最大値である。つまり、kが所定値mより大きくなったときは、全レディキューの検索が終了したわけであり、スケジューリングを終了する。   If the determination in step S5 is NO, that is, if a task is connected to the ready queue having the priority k, the process returns to step S3 and the subsequent processing is repeated. Here, the predetermined value m in step S4 is the maximum priority set by the OS 21. That is, when k becomes larger than the predetermined value m, the search for all ready queues is completed, and the scheduling is terminated.

一方、上記ステップS5の判定がYESのとき、すなわち、優先度kのレディキューにタスクが存在するときは、ステップS6で、タスク順位pとして1を設定する。ここで、このタスク順位pは、優先度kのレディキュー上において対象タスクが先頭タスクから何番目に位置するかを示す値である。次いで、ステップS7で、優先度kのレディキューにおける先頭からp番目のタスクを、CPU番号cのCPUに割り当てる。   On the other hand, when the determination in step S5 is YES, that is, when a task exists in the ready queue having the priority k, 1 is set as the task order p in step S6. Here, the task order p is a value indicating the position of the target task from the top task on the ready queue having the priority k. Next, in step S7, the p-th task from the top in the ready queue with the priority k is assigned to the CPU with the CPU number c.

次いで、ステップS8で、CPU番号cに1を加算すると共に、ステップS9で、CPU番号cがCPU数nを超えているか否かを判定し、NOのとき、すなわち超えているときは、ステップS10で、タスク順位pに1を加算すると共に、ステップS11で、タスク順位pが優先度kのレディキューに接続されたタスクの数よりも大きいか否かを判定する。そして、このステップS11の判定がYESのとき、すなわち、タスク順位pが優先度kのレディキューに接続されたタスクの数よりも大きく、優先度kのレディキューにタスク順位pのタスクが存在しないときは、ステップS3に戻って以後の処理を繰り返し、NOのときは、ステップS7に戻って以後の処理を繰り返す。   Next, in step S8, 1 is added to the CPU number c, and in step S9, it is determined whether or not the CPU number c exceeds the number of CPUs n. If NO, that is, if it exceeds, step S10. In step S11, it is determined whether or not the task order p is larger than the number of tasks connected to the ready queue having the priority k. When the determination in step S11 is YES, that is, the task rank p is larger than the number of tasks connected to the ready queue with the priority k, and there is no task with the task rank p in the ready queue with the priority k. If so, the process returns to step S3 and the subsequent processes are repeated. If NO, the process returns to step S7 and the subsequent processes are repeated.

一方、上記ステップS9の判定がYESのとき、すなわち、CPU番号cがCPU数nを超えたときは、全てのCPUにタスクが割り当てられたわけであり、スケジューリングを終了する。   On the other hand, when the determination in step S9 is YES, that is, when the CPU number c exceeds the CPU number n, the task is assigned to all the CPUs and the scheduling is terminated.

次に、図6〜図8を用いて、上記所定のスケジューリング条件が成立したときに行われる本OS21によるスケジューリングの一例を説明する。なお、この説明に際しては、組込みコンピュータ1は、図2において、n=3の場合、すなわち、3つのCPU1,CPU2,CPU3を有するものとする。また、優先度1〜5の5つのレディキューを有するものとする。   Next, an example of scheduling by the OS 21 performed when the predetermined scheduling condition is satisfied will be described with reference to FIGS. In this description, the embedded computer 1 is assumed to have three CPUs 1, CPU2, and CPU3 when n = 3 in FIG. It is assumed that there are five ready queues with priorities 1 to 5.

まず、上記所定のスケジューリング条件が成立すると、CPU1,2,3で実行中のタスクのタスク実行権が全て解放されると共に、実行中の各タスクのタスク実行権解放時の状態が各タスク毎に各タスク情報に記録される。なお、このとき、7つのセカンダリタスク22…22(以下、T1〜T7という)が実行可能状態になったものとする。具体的には、図3に示すように、優先度1のレディキューにタスクT1が、優先度3のレディキューにタスクT2、及びタスクT3が、優先度5のレディキューにタスクT4、タスクT5、及びタスクT6が、優先度6のレディキューにタスクT7がそれぞれ接続されているものとする。なお、優先度3のレディキューにはタスクは接続されていないものとする。タスクのタスク実行権が全て解放された結果、CPU1,2,3の全てがCPUアイドル状態となっている。   First, when the predetermined scheduling condition is satisfied, all task execution rights of the tasks being executed by the CPUs 1, 2, and 3 are released, and the state at the time of task execution right release of each task being executed is set for each task. Recorded in each task information. At this time, it is assumed that seven secondary tasks 22... 22 (hereinafter referred to as T1 to T7) are in an executable state. Specifically, as shown in FIG. 3, task T1 is in the ready queue with priority 1, task T2 is in the ready queue with priority 3, and task T3 is task T4 in task 5 with priority 5. , And task T6, task T7 is connected to a ready queue of priority 6 respectively. It is assumed that no task is connected to the ready queue with priority 3. As a result of releasing all task execution rights of the tasks, all of the CPUs 1, 2, and 3 are in the CPU idle state.

まず、OS21は、これらのCPUアイドル状態のCPU1,CPU2,CPU3のうち、CPU1にタスクを割り当てるために、レディキューテーブルを優先度の高いレディキューから順に検索する。この検索の結果、図6に示すように、優先度1のレディキューにタスクT1が接続されているので、OS21は、優先度1のレディキューの先頭のタスクT1をCPUlに割り当てる。つまり、タスクT1がCPU1によって実行されることとなる。   First, the OS 21 searches the ready queue table in order from the ready queue having the highest priority in order to assign a task to the CPU 1 among the CPUs 1, CPU2, and CPU3 in the CPU idle state. As a result of this search, as shown in FIG. 6, since the task T1 is connected to the priority 1 ready queue, the OS 21 assigns the task T1 at the head of the priority 1 ready queue to the CPU 1. That is, the task T1 is executed by the CPU1.

次に、OS21は、CPU2にタスクを割り当てるため、優先度1のレディキューの先頭から2番目にタスクが接続されているかを検索するが、タスクが接続されていないので、次いで、優先度2のレディキューを検索する。この検索の結果、優先度2のレディキューにはタスクが接続されていので、OS21は、優先度2のレディキューの先頭のタスクT2をCPU2に割り当てる。つまり、タスクT2がCPU2によって実行されることとなる。   Next, in order to assign a task to the CPU 2, the OS 21 searches whether the task is connected second from the top of the ready queue with priority 1, but since the task is not connected, Search for a ready queue. As a result of this search, since the task is connected to the ready queue with the priority 2, the OS 21 assigns the top task T 2 of the ready queue with the priority 2 to the CPU 2. That is, the task T2 is executed by the CPU2.

次に、OS21は、CPU3にタスクを割り当てるため、優先度2のレディキューの先頭から2番目にタスクが接続されているかを検索すると、タスクT3が接続されているので、OS21は、優先度2のレディキューの先頭から2番目のタスクT3をCPU3に割り当てる。つまり、タスクT3がCPU3によって実行されることとなる。   Next, since the OS 21 assigns a task to the CPU 3, when it is searched whether the task is connected second from the head of the ready queue with priority 2, the task T3 is connected. The second task T3 from the top of the ready queue is assigned to the CPU 3. That is, the task T3 is executed by the CPU 3.

そして、これにより、CPU1,2,3の全てにタスクが割り当てられ、実行状態となったため、OS21は、スケジューリングを終了する。   As a result, the task is assigned to all of the CPUs 1, 2, and 3 and the execution state is entered, so the OS 21 ends the scheduling.

なお、タスク実行権が解放されていたタスクについては、該解放されたときの状態から再開されることとなる。   Note that a task whose task execution right has been released is resumed from the state when it was released.

ここで、上記のように割り当てられて現在実行中の例えばタスクT1が、OS21にメモリ12に格納されているタスクT8の起動を要求し、該タスクT8がOS21によって優先度1のレディキューに接続されるときには、所定のスケジューリング条件が成立し、現在実行中のタスクT1,T2,T3のタスク実行権が解放されると共に、実行中のタスクT1,T2,T3のタスク実行権解放時の状態が各タスクT1,T2,T3毎に各タスク情報に記録され、CPU1,2,3の全てがCPUアイドル状態となって、スケジューリングが実行される。そして、この場合、前述したのと同様にレディキューテーブルが検索され、図7に示すように、まず、CPU1にタスクT1が割り当てられ、次いで、CPU2にタスクT8が割り当てられ、次いで、CPU3にタスクT2が割り当てられることとなる。なお、この場合、タスクT1,T2については、タスク実行権が解放されたときの実行状態から再開される。   Here, for example, task T1, which is allocated as described above and is currently being executed, requests activation of task T8 stored in memory 12 by OS 21, and task T8 is connected to the ready queue of priority 1 by OS 21. When a predetermined scheduling condition is satisfied, the task execution right of the currently executing tasks T1, T2, and T3 is released, and the task execution right release state of the currently executing tasks T1, T2, and T3 is Each task T1, T2, T3 is recorded in each task information, and the CPUs 1, 2, 3 are all in the CPU idle state, and scheduling is executed. In this case, the ready queue table is searched in the same manner as described above, and as shown in FIG. 7, first, task T1 is assigned to CPU1, then task T8 is assigned to CPU2, and then task 3 is assigned to CPU3. T2 will be allocated. In this case, the tasks T1 and T2 are resumed from the execution state when the task execution right is released.

そして、例えば、上記のように割り当てられて現在実行中の例えばタスクT1の実行が終了し、タスクT1がOS21にタスクの実行終了の宣言をし、該OS21によりレディキューからタスクT1が削除されるときには、所定のスケジューリング条件が成立し、現在実行中のタスクT2,T3のタスク実行権が解放されると共に、該実行中のタスクT2,T3のタスク実行権解放時の状態が各タスクT2,T3毎に各タスク情報に記録され、スケジューリングが実行される。そして、この場合、前述したのと同様にレディキューテーブルが検索され、図8に示すように、まず、CPU1にタスクT8が割り当てられ、次いで、CPU2にタスクT2が割り当てられ、次いで、CPU3にタスクT3が割り当てられることとなる。なお、この場合、タスクT2,T3については、タスク実行権が解放されたときの実行状態から再開される。   Then, for example, the execution of task T1, which is allocated as described above and is currently being executed, is terminated, task T1 declares the task execution end to OS 21, and task OS T1 is deleted from the ready queue by OS 21. Sometimes, a predetermined scheduling condition is satisfied, the task execution right of the currently executing tasks T2 and T3 is released, and the task execution right release state of the currently executing tasks T2 and T3 is the respective tasks T2 and T3. Every time, it is recorded in each task information, and scheduling is executed. In this case, the ready queue table is searched in the same manner as described above, and as shown in FIG. 8, first, task T8 is assigned to CPU1, then task T2 is assigned to CPU2, and then task 3 is assigned to CPU3. T3 will be assigned. In this case, the tasks T2 and T3 are resumed from the execution state when the task execution right is released.

以上のように、第1の実施の形態に係る組込みシステムによれば、実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行すべきタスクが即座にCPU1,2,3の全てに割り当てられて実行されることとなり、複数のCPU1,2,3を有する組込みコンピュータにおいても優先度の高いタスクのリアルタイム処理が確実に確保される。   As described above, according to the embedded system according to the first embodiment, when a task having a lower priority than the priority of the task to be executed is being executed, the task to be executed is immediately executed by the CPU 1. Therefore, even in an embedded computer having a plurality of CPUs 1, 2, and 3, real-time processing of a task with high priority is reliably ensured.

また、複数のCPU1,2,3で実行中の複数のタスクのいずれかについて実行が終了したときには、このタスクの実行が完了したCPUに即座にタスクが割り当てられて実行されることとなり、タスク処理が終了したCPUにいつまでもタスクが割り当てられない状態が生じることがない。   Further, when the execution of any of the plurality of tasks being executed by the plurality of CPUs 1, 2, and 3 is completed, the task is immediately assigned to the CPU that has completed the execution of the task, and is executed. There is no case where a task is not assigned to the CPU for which the process has been completed.

つまり、複数のCPU1,2,3にタスクが適切に動的分散されて、各CPUの負荷のばらつきが少なくなると共に、優先度の高いタスクの迅速な処理が確保される。   In other words, the tasks are appropriately dynamically distributed to the plurality of CPUs 1, 2, 3 to reduce the variation in the load on each CPU and to ensure quick processing of tasks with high priority.

また、全CPU1,2,3にタスクが割り当て直されることとなるから、これらのCPU1,2,3に、確実に、処理の優先順位が最も高いタスクから順に割り当てられることとなる。   In addition, since tasks are reassigned to all the CPUs 1, 2, 3, the CPUs 1, 2, 3 are surely assigned in order from the task having the highest processing priority.

次に、本発明の第2の実施の形態について説明する。   Next, a second embodiment of the present invention will be described.

この第2の実施の形態に係る組込みシステムは、第1の実施の形態に係る組込みシステムにおいて、優先度毎のレディキューに、該優先度のレディキューに接続されたタスクを処理するCPUを関連付けしたものであり、以下、図9〜図16を用いて説明する。   In the embedded system according to the second embodiment, in the embedded system according to the first embodiment, a CPU that processes a task connected to the ready queue having the priority is associated with the ready queue for each priority. This will be described below with reference to FIGS.

図9に示すように、この第2の実施の形態の組込みシステムを構成する組込みコンピュータ31は、複数のCPU41−1,CPU41−2,CPU41−3,…CPU41−n(図1のCPUB…Bに相当。以下、CPU1,CPU2,CPU3,…CPUnという)と、単一の共有メモリ42(図1の記憶装置Cに相当)と、これらを接続する共有バス43とを有する。   As shown in FIG. 9, the embedded computer 31 constituting the embedded system of the second embodiment includes a plurality of CPUs 41-1, CPU 41-2, CPU 41-3,..., CPU 41-n (CPUB. (Hereinafter referred to as “CPU1, CPU2, CPU3,... CPUn”), a single shared memory 42 (corresponding to the storage device C in FIG. 1), and a shared bus 43 for connecting them.

CPU1及びCPU2は、他のCPUが有する機能に加え、それぞれ、描画信号処理や音声処理等に適した特定の機能(これらの処理は一例である)を有する。   The CPU 1 and CPU 2 have specific functions suitable for drawing signal processing, audio processing, and the like in addition to the functions of other CPUs (these processes are examples).

共有メモリ42は、ROM及びRAMからなる。該共有メモリ42には、請求項1から請求項3に記載の組込みコンピュータ制御プログラムを構成して、組込みコンピュータ1を図1に記載の各手段として機能させるリアルタイムオペレーティングシステム51(以下、OS51という)と、複数のタスク52…52(図1のタスクF…Fに相当)と、該OS51に関する種々のパラメータや一時データ等からなるOSデータ53とが格納されている。   The shared memory 42 includes a ROM and a RAM. In the shared memory 42, a real-time operating system 51 (hereinafter referred to as OS 51) that configures the embedded computer control program according to claims 1 to 3 and causes the embedded computer 1 to function as each means described in FIG. And a plurality of tasks 52... 52 (corresponding to tasks F... F in FIG. 1) and OS data 53 including various parameters and temporary data related to the OS 51 are stored.

OS51は、上記共有メモリ42からCPU1〜CPUn上にそれぞれ読み込まれて実行される。換言すれば、共有メモリ42上に格納されているOS51は1つであるが、各CPU1〜CPUn上で並行して実行され、各CPU上で実行されるOS51により当該各CPU上でのタスク52の実行が制御されることとなる。なお、このOS51の機能の詳細については後述する。   The OS 51 is read from the shared memory 42 and executed on the CPU 1 to CPU n. In other words, there is one OS 51 stored on the shared memory 42, but the task 52 on each CPU is executed by the OS 51 that is executed in parallel on each CPU 1 to CPUn and executed on each CPU. Execution is controlled. Details of the function of the OS 51 will be described later.

OSデータ53は、上記複数のCPUでそれぞれ実行されるOS51で共有のOS共有データ53aと、上記複数のCPU上でそれぞれ実行されるOS51毎に固有の非共有データ53bとからなる。OS共有データ53aには、複数のレディキュー(図1のレディキューD…Dに相当、図10参照)を管理するレディキューテーブル(図11参照)が含まれている。なお、その詳細については後述する。   The OS data 53 includes OS shared data 53a shared by the OS 51 executed by the plurality of CPUs, and non-shared data 53b unique to each OS 51 executed on the plurality of CPUs. The OS shared data 53a includes a ready queue table (see FIG. 11) for managing a plurality of ready queues (corresponding to the ready queues D to D in FIG. 1, see FIG. 10). Details thereof will be described later.

OS51は、CPU1〜CPUnがタスク52…52を実行しているときにはCPU実行状態と判定し、タスク52…52を実行していないときはCPUアイドル状態(特許請求の範囲に記載のタスク非実行状態)と判定する。   The OS 51 determines the CPU execution state when the CPUs 1 to CPUn are executing the tasks 52... 52, and the CPU idle state (the task non-execution state described in the claims) when the tasks 52. ).

タスク52は、OS51によって、実行状態、実行可能状態、待ち状態、休止状態のうちのいずれかの状態に制御される。ここで、実行状態とは、タスク52がOS51によりCPU1〜CPUnのうちのいずれかのCPUに割り当てられて実行中の状態を意味し、実行可能状態とは、タスク52の実行準備は整っているが、そのタスク52よりも優先順位の高いタスク52が実行中であるためそのタスク52を実行できない状態を意味し、待ち状態とは、起動はされたがタスク52の実行条件が整わないため実行できない状態を意味し、休止状態とは、タスク52が起動されていない状態をいう。   The task 52 is controlled by the OS 51 to one of an execution state, an executable state, a wait state, and a hibernation state. Here, the execution state means a state in which the task 52 is assigned to one of the CPUs 1 to CPUn by the OS 51 and is being executed, and the executable state is ready for execution of the task 52. However, the task 52 having a higher priority than the task 52 is being executed, and means that the task 52 cannot be executed. The wait state is executed because the execution condition of the task 52 is not established although it has been activated. This means a state where the task cannot be performed, and the hibernation state refers to a state where the task 52 is not activated.

上記タスク52…52の、例えば上記実行状態等の情報、タスク優先度等の情報を含むタスク管理情報(図1のタスク管理情報H…Hに相当)、は、OS51によって、例えばOS51の起動時にタスク52…52の全てに対して作成され、上記メモリ42上のOS共有データ53aの一部として記憶される。   Task management information (equivalent to the task management information H... H in FIG. 1) of the tasks 52. Created for all tasks 52... 52 and stored as a part of the OS shared data 53 a on the memory 42.

また、タスク52…52の実行の優先度は、OS51によって、タスク重要性、緊急性、サイズ等に基づいて、例えばOS51の起動時にタスク52…52毎に設定され、上記タスク管理情報の一つの情報として上記メモリ42上に記憶される。なお、この優先度は、タスク52…52がOS51に対して要求することにより、または、OS51によって、起動後に変更してもよい。   Further, the priority of execution of the tasks 52... 52 is set by the OS 51 for each task 52... 52 when the OS 51 is started, based on task importance, urgency, size, and the like. Information is stored on the memory 42 as information. This priority may be changed after the task 52... 52 requests the OS 51 or by the OS 51 after activation.

図10は、優先度毎に設けられたレディキューの一例を示す説明図であり、図11は、このような優先度毎のレディキューの状態を管理するレディキューテーブルの構成を示す。このレディキューテーブルは、各レディキュー毎に、当該優先度のレディキューに接続されたタスクの次に接続されたタスクのタスク情報(タスク管理情報H…Hに相当に相当。タスクコントロールブロック)を格納している領域の上記メモリ42上における先頭アドレス情報と、1つ前に接続されたタスクのタスク情報を格納している領域の先頭アドレス情報とからなるタスク管理情報格納領域情報と、その優先度のタスクを実行可能なCPUの属性情報とを格納しており、OS51の起動時に共有メモリ42上のOS共有データ43aの一部として作成される。換言すれば、OS21の起動時に、異なる優先度を持つレディキューが複数作成されることとなる。また、各レディキューに、上記複数のCPU1〜CPUnのうちのいずれのCPUが当該優先度のレディキューに存在するタスクを実行すべきかの属性が関連付けられていることとなる。   FIG. 10 is an explanatory diagram showing an example of a ready queue provided for each priority, and FIG. 11 shows a configuration of a ready queue table that manages the status of the ready queue for each priority. This ready queue table stores task information (corresponding to task management information H... H, corresponding to task management block) of a task connected next to the task connected to the ready queue of the priority for each ready queue. Task management information storage area information consisting of the start address information of the storage area on the memory 42 and the start address information of the area storing the task information of the task connected immediately before, and its priority Attribute information of a CPU that can execute a task at a time, and is created as part of the OS shared data 43a on the shared memory 42 when the OS 51 is activated. In other words, when the OS 21 is activated, a plurality of ready queues having different priorities are created. Further, each ready queue is associated with an attribute indicating which of the plurality of CPUs 1 to CPUn should execute a task existing in the ready queue of the priority.

なお、図10は7つのタスク管理情報格納領域情報が格納されている状態を示したが、OS51の起動時にはタスク管理情報格納領域情報は格納されておらず、例えば、タスク52の実行条件が成立したときに、OS51によって、上記複数のレディキューのうちの、当該タスク52の優先度と同一優先度のレディキューの最後尾に格納され、タスク52の実行が終了したときに、この実行が終了したタスク52に係るタスク管理情報格納領域情報がレディキューから削除される。   FIG. 10 shows a state in which seven pieces of task management information storage area information are stored, but no task management information storage area information is stored when the OS 51 is started, and for example, the execution condition of the task 52 is satisfied. Is stored at the tail of the ready queue having the same priority as that of the task 52 among the plurality of ready queues, and the execution ends when the execution of the task 52 is completed. The task management information storage area information related to the task 52 is deleted from the ready queue.

この第2の実施の形態に係るレディキューのCPU属性情報を格納する領域は、図12に示すように、32ビットのビットフィールドからなる。ビットフィールド上の各ビットは固有の意味を有する。例えば、1ビット目から31ビット目のいずれかのビットを1とすることは、そのビットに対応したCPUの指定を意味し、32ビット目を1とすることはCPU指定なし、すなわちいずれのCPUにも割り当て可能であることを意味する。なお、1ビット目から31ビット目までのビットについては複数のビットを1とすること(論理和指定)を可能とする。換言すれば複数のCPUの指定を可能とする。   The area for storing the CPU attribute information of the ready queue according to the second embodiment is composed of a 32-bit bit field as shown in FIG. Each bit on the bit field has a unique meaning. For example, setting any bit from the first bit to the 31st bit to 1 means designation of the CPU corresponding to that bit, and setting the 32nd bit to 1 means no CPU designation, that is, any CPU Can also be assigned. In addition, regarding the bits from the first bit to the 31st bit, a plurality of bits can be set to 1 (logical sum designation). In other words, a plurality of CPUs can be specified.

ここで、本実施の形態に係るOS51は、スケジューリング方式として、CPU属性付イベントドリブン型タスク優先度順スケジューリング方式を採用している。このCPU属性付きイベントドリブン型タスク優先度順スケジューリング方式は、前述した図10に示すように、イベントドリブン型タスク優先度順スケジューリング方式の優先度毎のレディキューに、該当レディキューに接続されたタスクを実行するCPUの属性を付与することにより、特定のCPUで特定のタスクを処理できるようにしたものである。なお、CPU属性に基づく制御が追加されている点を除きイベントドリブン型タスク優先度順スケジューリングと基本制御は共通であるため、次に、第1の実施の形態で説明した上記所定のスケジューリング条件が成立したときに行われるこのリアルタイムOS51によるスケジューリングについて、図13のフローチャートを用いて具体的に説明する。   Here, the OS 51 according to the present embodiment employs an event-driven task priority order scheduling system with a CPU attribute as a scheduling system. As shown in FIG. 10 described above, the event-driven task priority order scheduling method with a CPU attribute is a task connected to the corresponding ready queue in the ready queue for each priority of the event-driven task priority order scheduling method. By assigning the attribute of the CPU that executes the process, the specific CPU can process a specific task. Since event-driven task priority order scheduling and basic control are common except that control based on CPU attributes is added, the predetermined scheduling condition described in the first embodiment is the following. Scheduling by the real-time OS 51 performed when established will be specifically described with reference to the flowchart of FIG.

まず、ステップS21で、対象のCPUのCPU番号cとして1を設定する。   First, in step S21, 1 is set as the CPU number c of the target CPU.

なお、CPU番号とは、上記CPU1〜CPUnの添字1〜nのことを意味する。次いで、ステップS22で、スケジューリング対象のレディキューの優先度kとして0を設定すると共に、ステップS23で、kに1を加算した後、ステップS24で、kが所定値m以下か否かを判定し、その判定がYESのとき、すなわち、kが所定値m以下のときは、さらに、ステップS25で、優先度kのレディキューのCPU属性が、タスクを割り当てようとしているCPUと一致しているか、又はCPU属性がCPU指定なしかを判定すると共に、このステップS25の判定がYESのときは、さらに、ステップS26で、優先度kのレディキューにタスクが接続されているか否かを判定する。   The CPU number means the subscripts 1 to n of the CPUs 1 to CPUn. Next, in step S22, 0 is set as the priority k of the ready queue to be scheduled, and in step S23, 1 is added to k. Then, in step S24, it is determined whether or not k is a predetermined value m or less. When the determination is YES, that is, when k is equal to or less than the predetermined value m, in step S25, whether the CPU attribute of the ready queue with the priority k matches the CPU to which the task is to be assigned, Alternatively, it is determined whether or not the CPU attribute is CPU designation. If the determination in step S25 is YES, it is further determined in step S26 whether or not a task is connected to the ready queue having the priority k.

そして、上記ステップS25の判定がNOのとき、すなわち、優先度kのレディキューのCPU属性が、タスクを割り当てようとしているCPUと一致せず、CPU属性がCPU指定なしでもないとき、または、ステップS26の判定がNOのとき、すなわち、優先度kのレディキューにタスクが接続されていないときは、ステップS23に戻り、以後の処理を繰り返す。ここで、ステップS24の所定値mは、OS51が設定する優先度の最大値である。つまり、kが所定値mより大きくなったときは、全レディキューの検索が終了したわけであり、スケジューリングを終了する。   When the determination in step S25 is NO, that is, when the CPU attribute of the ready queue having the priority k does not match the CPU to which the task is to be assigned and the CPU attribute is not CPU designation, or When the determination in S26 is NO, that is, when no task is connected to the ready queue having the priority k, the process returns to step S23 and the subsequent processing is repeated. Here, the predetermined value m in step S24 is the maximum priority set by the OS 51. That is, when k becomes larger than the predetermined value m, the search for all ready queues is completed, and the scheduling is terminated.

一方、上記ステップS26の判定がYESのとき、すなわち、優先度kのレディキューにタスクが接続されているときは、ステップS27で、タスク順位pとして1を設定する。ここで、このタスク順位pは、優先度kのレディキュー上において対象タスクが先頭タスクから何番目に位置するかを示す値である。次いで、ステップ28で、この先頭からp番目のタスクがいずれかのCPUに割り当て済か否かを判定する。   On the other hand, when the determination in step S26 is YES, that is, when a task is connected to the ready queue having the priority k, 1 is set as the task order p in step S27. Here, the task order p is a value indicating the position of the target task from the top task on the ready queue having the priority k. Next, at step 28, it is determined whether or not the p-th task from the top has been assigned to any CPU.

そして、このステップS28の判定がYESのとき、すなわち、p番目のタスクが割り当て済のときは、ステップS29で、タスク順位pの値に1を加算すると共に、ステップS30で、タスク順位pが優先度kのレディキューに接続されたタスクの数よりも大きいか否かを判定する。そして、このステップS30の判定がYESのとき、すなわち、タスク順位pが優先度kのレディキューに接続されたタスクの数よりも大きく、優先度kのレディキューにタスク順位pのタスクが接続されていないときは、ステップS23に戻って以後の処理を繰り返し、NOのときは、ステップS28に戻って以後の処理を繰り返す。   When the determination in step S28 is YES, that is, when the p-th task has been assigned, 1 is added to the value of the task order p in step S29, and the task order p is given priority in step S30. It is determined whether or not it is larger than the number of tasks connected to the ready queue of degree k. When the determination in step S30 is YES, that is, the task rank p is larger than the number of tasks connected to the ready queue having the priority k, and the task rank p is connected to the ready queue having the priority k. If not, the process returns to step S23 and the subsequent processes are repeated. If NO, the process returns to step S28 and the subsequent processes are repeated.

一方、上記ステップS28の判定がNOのとき、すなわち、タスク順位pのタスクが割り当て済でないときは、ステップS31で、優先度kのレディキューにおける先頭からp番目のタスクを、CPU番号cのCPUに割り当てる。   On the other hand, when the determination in step S28 is NO, that is, when the task with the task rank p has not been assigned, in step S31, the p-th task from the head in the ready queue with priority k is assigned to the CPU with CPU number c. Assign to.

次いで、ステップS32では、CPU番号cに1を加算すると共に、ステップS33で、CPU番号cがCPU数nを超えたか否かを判定し、NOのとき、すなわち超えていないときは、このCPU番号cのCPUについてタスクを割り当てるために、ステップS22以後の処理を繰り返す。一方、このステップS33の判定がYESのとき、すなわち、CPU番号cがCPU数nを超えたときは、全てのCPUにタスクが割り当てられたわけであり、スケジューリングを終了する。   Next, in step S32, 1 is added to the CPU number c, and in step S33, it is determined whether or not the CPU number c has exceeded the CPU number n. If NO, that is, if it has not exceeded, this CPU number. In order to assign a task to the CPU of c, the processing after step S22 is repeated. On the other hand, when the determination in step S33 is YES, that is, when the CPU number c exceeds the CPU number n, the task is assigned to all the CPUs, and the scheduling ends.

次に、図14〜図16を用いて、上記所定のスケジューリング条件が成立したときに行われる本OS51によるスケジューリングの一例を説明する。なお、この説明に際しては、組込みコンピュータ31は、図9において、n=3の場合、すなわち、3つのCPU1,CPU2,CPU3を有し、CPU1、CPU2はそれぞれ異なる特定の機能を有するものとする。また、優先度1〜5の5つのレディキューを有するものとする。また、優先度1及び優先度5のレディキューのCPU属性は、全CPU(CPU指定なし)とされ、優先度2のレディキューのCPU属性は、CPU1指定とされ、優先度3及び優先度4のレディキューのCPU属性は、CPU2指定とされているものとする。   Next, an example of scheduling by the OS 51 performed when the predetermined scheduling condition is satisfied will be described with reference to FIGS. In this description, it is assumed that the embedded computer 31 in FIG. 9 has n = 3, that is, three CPUs 1, CPU 2, and CPU 3, and CPU 1 and CPU 2 have different specific functions. It is assumed that there are five ready queues with priorities 1 to 5. In addition, the CPU attributes of the ready queues with the priority 1 and the priority 5 are all CPUs (no CPU designation), the CPU attributes of the ready queue with the priority 2 are the CPU 1 designation, the priority 3 and the priority 4 It is assumed that the CPU attribute of the ready queue is designated as CPU2.

まず、上記所定のスケジューリング条件が成立すると、CPU1,2,3で実行中のタスクのタスク実行権が全て解放されると共に、実行中の各タスクのタスク実行権解放時の状態が各タスク毎に各タスク情報に記録される。なお、このとき、7つのセカンダリタスク52…52(以下、タスクT1〜T7という)が実行可能状態になったものとする。具体的には、図14に示すように、優先度1のレディキューにタスクT1が、優先度2のレディキューにタスクT2、及びタスクT3が、優先度4のレディキューにタスクT4、タスクT5、及びタスクT6が、優先度5のレディキューにタスクT7がそれぞれ接続されているものとする。優先度3のレディキューにはタスクは接続されていないものとする。また、タスクの実行権が全て解放された結果、CPU1,2,3の全てがCPUアイドル状態となっている。   First, when the predetermined scheduling condition is satisfied, all task execution rights of the tasks being executed by the CPUs 1, 2, and 3 are released, and the state at the time of task execution right release of each task being executed is set for each task. Recorded in each task information. At this time, it is assumed that seven secondary tasks 52... 52 (hereinafter referred to as tasks T1 to T7) are in an executable state. Specifically, as shown in FIG. 14, task T1 is in the ready queue with priority 1, task T2 is in the ready queue with priority 2, and task T3 is task T4 in task 4 with priority 4. , And task T6, task T7 is connected to a ready queue of priority 5. It is assumed that no task is connected to the ready queue with priority 3. Further, as a result of releasing all task execution rights, all of the CPUs 1, 2, and 3 are in the CPU idle state.

次に、OS51は、これらのCPUアイドル状態のCPU1,CPU2,CPU3のうち、まずCPU1にタスクを割り当てるために、レディキューテーブルを優先度の高いレディキューから順に検索する。この検索の結果、図14に示すように、優先度1のレディキューはCPU属性が全CPU(CPU指定なし)で、かつ該レディキューにはタスクT1が接続されているので、OS51は、優先度1のレディキューの先頭のタスクT1をCPUlに割り当てる。つまり、タスクT1がCPU1によって実行されることとなる。ここで、優先度1のレディキューのCPU属性が全CPUとされているのは、緊急を要する様々なタスクを即座に処理できるようにすることを目的としている。   Next, the OS 51 searches the ready queue table in order from the ready queue with the highest priority in order to assign a task to the CPU 1 among the CPUs 1, CPU2, and CPU3 in the CPU idle state. As a result of this search, as shown in FIG. 14, the ready queue with priority 1 has the CPU attribute of all CPUs (no CPU designation), and the task T1 is connected to the ready queue. The first task T1 in the ready queue of degree 1 is assigned to CPU1. That is, the task T1 is executed by the CPU1. Here, the CPU attribute of the ready queue with priority 1 is set to all CPUs for the purpose of enabling immediate processing of various tasks requiring urgency.

次に、OS51は、CPU2にタスクを割り当てるため、レディキューテーブルを優先度の高いレディキューから順に検索する。この検索の結果、優先度1のレディキューはCPU属性が全CPU(CPU指定なし)であるが、優先度1のレディキューに接続されているタスクT1がCPU1に割り当てられたため他に割り当てるべきタスクが存在せず、優先度2のレディキューはCPU属性がCPU1指定でCPU属性が一致せず、優先度3のレディキューはCPU属性がCPU2指定でCPU属性が一致するがタスクが存在せず、優先度4のレディキューはCPU属性がCPU2指定でCPU属性が一致し、かつタスクT4,T5,T6が接続されているので、OS51は、優先度4のレディキューの先頭のタスクT4をCPU2に割り当てる。つまり、タスクT4がCPU2によって実行されることとなる。   Next, the OS 51 searches the ready queue table in order from the ready queue with the highest priority in order to assign tasks to the CPU 2. As a result of this search, the priority 1 ready queue has the CPU attribute of all CPUs (no CPU designation), but since the task T1 connected to the priority 1 ready queue is assigned to the CPU 1, other tasks to be assigned. The priority 2 ready queue has the CPU attribute specified by CPU1 and the CPU attribute does not match, and the priority 3 ready queue has the CPU attribute specified by CPU2 and the CPU attribute matches but the task does not exist. Since the ready queue of priority 4 has the CPU attribute specified by CPU 2 and the CPU attributes match, and tasks T4, T5, and T6 are connected, the OS 51 transfers the task T4 at the head of the ready queue of priority 4 to the CPU 2. assign. That is, the task T4 is executed by the CPU2.

次に、OS51は、CPU3にタスクを割り当てるため、レディキューテーブルを優先度の高いレディキューから順に検索する。この結果、優先度1のレディキューはCPU属性が全CPU(CPU指定なし)であるが、優先度1のレディキューに接続されているタスクT1がCPU1に割り当てられたため他に割り当てるべきタスクが存在せず、優先度2のレディキューはCPU属性がCPU1指定でCPU属性が一致せず、優先度3のレディキューはCPU属性がCPU2指定でCPU属性が一致せず、優先度4のレディキューはCPU属性がCPU2指定でCPU属性が一致せず、優先度5のレディキューはCPU属性が全CPUでかつタスクT7が存在するので、OS51は、優先度5のレディキューの先頭のタスクT7をCPU3に割り当てる。つまり、タスクT7がCPU3によって実行されることとなる。   Next, in order to assign a task to the CPU 3, the OS 51 searches the ready queue table in order from the ready queue with the highest priority. As a result, the ready queue with priority 1 has the CPU attribute of all CPUs (no CPU designation), but task T1 connected to the ready queue with priority 1 has been assigned to CPU 1, so there are other tasks to be assigned. The priority 2 ready queue has the CPU attribute specified by CPU 1 and the CPU attribute does not match. The priority 3 ready queue has the CPU attribute specified by CPU 2 and the CPU attribute does not match. Since the CPU attribute is specified by CPU2 and the CPU attribute does not match, and the ready queue with priority 5 is the CPU attribute of all CPUs and task T7 exists, the OS 51 assigns the task T7 at the head of the ready queue with priority 5 to CPU3. Assign to. That is, the task T7 is executed by the CPU 3.

そして、これにより、CPU1,2,3の全てにタスクが割り当てられ、実行状態となったため、セカンダリOS51は、スケジューリングを終了する。   As a result, the task is assigned to all of the CPUs 1, 2, and 3 and the execution state is reached, so the secondary OS 51 ends the scheduling.

なお、タスク実行権が解放されていたタスクについては、該解放されたときの状態から再開されることとなる。   Note that a task whose task execution right has been released is resumed from the state when it was released.

ここで、上記のように割り当てられて現在実行中の例えばタスクT1が、OS51にメモリ42に格納されているタスクT8の起動を要求し、該タスクT8がOS51によって優先度1のレディキューに接続されるときには、所定のスケジューリング条件が成立し、現在実行中のタスクT1,T4,T7のタスク実行権が解放されると共に、実行中のタスクT1,T4,T7のタスク実行権解放時の状態が各タスクT1,T4,T7毎に各タスク情報に記録され、CPU1,2,3の全てがCPUアイドル状態となって、スケジューリングが実行される。そして、この場合、前述したのと同様にレディキューテーブルが検索され、図15に示すように、まず、CPU1にタスクT1が割り当てられ、次いで、CPU2にタスクT8が割り当てられ、次いで、CPU3にタスクT7が割り当てられることとなる。なお、この場合、タスクT1,T3については、タスク実行権が解放されたときの状態から再開される。   Here, for example, task T1, which is allocated as described above and is currently being executed, requests activation of task T8 stored in memory 42 by OS 51, and task T8 is connected to the ready queue of priority 1 by OS 51. When a predetermined scheduling condition is satisfied, the task execution right of the currently executing tasks T1, T4, T7 is released, and the task execution right release state of the currently executing tasks T1, T4, T7 is Each task T1, T4, and T7 is recorded in each task information, and the CPUs 1, 2, and 3 are all in the CPU idle state, and scheduling is executed. In this case, the ready queue table is searched in the same manner as described above. As shown in FIG. 15, first, task T1 is assigned to CPU1, then task T8 is assigned to CPU2, and then task 3 is assigned to CPU3. T7 will be assigned. In this case, the tasks T1 and T3 are resumed from the state when the task execution right is released.

そして、例えば、上記のように割り当てられて現在実行中の例えばタスクT1の実行が完了し、タスクT1がOS51にタスクの実行終了の宣言をし、該OS51によりレディキューからタスクT1が削除されるときには、所定のスケジューリング条件が成立し、現在実行中のタスクT8,T7のタスク実行権が解放されると共に、該実行中のタスクT8,T7のタスク実行権解放時の状態が各タスクT8,T7毎に各タスク情報に記録され、スケジューリングが実行される。そして、この場合、前述したのと同様にレディキューテーブルが検索され、図16に示すように、まず、CPU1にタスクT8が割り当てられ、次いで、CPU2にタスクT4が割り当てられ、次いで、CPU3にタスクT7が割り当てられることとなる。なお、この場合、タスクT4,T7については、タスク実行権が解放されたときの状態から再開される。   Then, for example, the execution of task T1, for example, that is allocated and executed as described above is completed, task T1 declares the task execution end to OS 51, and task 51 is deleted from the ready queue by OS 51. Sometimes, a predetermined scheduling condition is satisfied, the task execution right of the currently executing tasks T8 and T7 is released, and the task execution right release state of the currently executing tasks T8 and T7 is the respective tasks T8 and T7. Every time, it is recorded in each task information, and scheduling is executed. In this case, the ready queue table is searched in the same manner as described above, and as shown in FIG. 16, first, task T8 is assigned to CPU1, then task T4 is assigned to CPU2, and then task 3 is assigned to CPU3. T7 will be assigned. In this case, the tasks T4 and T7 are resumed from the state when the task execution right is released.

ここで、優先度2のレディキューに接続されているタスクは、CPU1のみが有する特定の機能を利用しないと処理できないタスク(特定タスク)、またはCPU1のみが有する特定の機能を利用して処理することにより他のCPUで処理するよりも処理の迅速化が図れるタスク(特定タスク)である。そのため、CPU1の特定機能を利用する上記特定タスクは、CPU指定なしのレディキューには接続せず、CPU属性がCPU1指定の上記優先度2のレディキュー(特定レディキュー)に接続するようにしている。なお、CPU1の特定機能を利用する特定タスクであっても、例えば、該優先度2の特定レディキューにタスクが多数存在し、他のCPUでも処理可能であるときは、タスクの優先度を変更して他の優先度のレディキューに接続するようにしてもよい。   Here, a task connected to the ready queue with priority 2 is processed using a task (specific task) that cannot be processed without using a specific function that only CPU 1 has, or a specific function that only CPU 1 has. This is a task (specific task) that can speed up the process rather than being processed by another CPU. For this reason, the specific task that uses the specific function of the CPU 1 is not connected to the ready queue without the CPU designation, and is connected to the ready queue (specific ready queue) with the CPU attribute of the priority 2 specified above. Yes. Note that even if a specific task uses the specific function of the CPU 1, for example, when there are many tasks in the specific ready queue with the priority 2 and other CPUs can process the task, the priority of the task is changed. Then, it may be connected to a ready queue of another priority.

また、優先度3,4のレディキューに接続されているタスクは、CPU2のみが有する特定の機能を利用しないと処理できないタスク、またはCPU2のみが有する特定の機能を利用して処理することにより他のCPUで処理するよりも処理の迅速化が図れるタスクである。そのため、CPU2の特定機能を利用する上記特定のタスクは、CPU指定なしのレディキューには接続せず、CPU属性がCPU2指定の優先度3のレディキュー(特定レディキュー)または優先度4のレディキュー(特定レディキュー)に接続するようにしている。なお、CPU2の特定機能を利用する特定のタスクであっても、例えば、該優先度3,4のレディキューにタスクが多数あり、他のCPUでも処理可能であるときは、タスクの優先度を変更して他の優先度のレディキューに接続するようにしてもよい。   In addition, tasks connected to the ready queues with priority levels 3 and 4 can be processed only by using a specific function that only the CPU 2 has, or can be processed by using a specific function that only the CPU 2 has. This is a task that can speed up the processing rather than the processing by the CPU. Therefore, the specific task using the specific function of the CPU 2 is not connected to the ready queue without the CPU designation, and the CPU attribute is the ready queue with the priority 3 designated by the CPU 2 (specific ready queue) or the ready queue with the priority 4. Connect to a queue (specific ready queue). Note that even if a specific task uses a specific function of the CPU 2, for example, when there are many tasks in the ready queues with the priorities 3 and 4, and other CPUs can process them, the task priority is set. It may be changed and connected to a ready queue of another priority.

以上のように 第2の実施の形態に係る組込みシステムによれば、第1の実施の形態で説明した作用・効果に加え、特定タスクの処理は特定CPUでしかできないような場合に、特定タスクが、当該タスクを処理することができないCPUに割り当てられることがない。また、特定タスクの処理は特定CPU以外のCPUでもできるが特定CPUで処理すればよりタスク処理速度の向上が望めるような場合に、当該特定タスクを当該タスクの実行に適した特定CPUによって処理することができ、この結果、特定タスクの処理速度の向上等が図れる。   As described above, according to the embedded system according to the second embodiment, in addition to the operations and effects described in the first embodiment, the specific task can be processed only when the specific CPU can process the specific task. Is not assigned to a CPU that cannot process the task. Further, the specific task can be processed by a CPU other than the specific CPU, but if the specific CPU can improve the task processing speed, the specific task is processed by the specific CPU suitable for executing the task. As a result, the processing speed of the specific task can be improved.

なお、特定レディキューより優先度が高いレディキューにタスクが存在する場合に、特定CPUのアイドル状態が検出されたときは、当該優先度が高いレディキューのタスクを特定CPUに割り当てるようにしてもよいし、特定レディキューに存在するタスクを、優先度が高いレディキューに存在するタスクに優先して特定CPUに割り当てるようにしてもよい。また、特定レディキューには特定タスクのみ接続するようにしてもよいし、特定タスク以外のタスクも接続するようにしてもよい。   When a task exists in a ready queue having a higher priority than the specific ready queue and an idle state of the specific CPU is detected, the task of the ready queue having the higher priority may be assigned to the specific CPU. Alternatively, a task existing in a specific ready queue may be assigned to a specific CPU in preference to a task existing in a ready queue having a high priority. Further, only a specific task may be connected to the specific ready queue, or a task other than the specific task may be connected.

次に、本発明の第3の実施の形態について説明する。   Next, a third embodiment of the present invention will be described.

この第3の実施の形態に係る組込みシステムは、第2の実施の形態に係る組込みシステムにおいて、外部割込み等を処理する専用CPUを新たに設けると共に、第2の実施の形態に係る複数のCPU上で実行されるリアルタイムオペレーティングシステムとは別に、専用CPU上で実行されるリアルタイムオペレーティングシステムを設けたものであり、以下図17〜図18を用いて説明する。   In the embedded system according to the third embodiment, in the embedded system according to the second embodiment, a dedicated CPU for processing an external interrupt or the like is newly provided, and a plurality of CPUs according to the second embodiment are provided. In addition to the real-time operating system executed above, a real-time operating system executed on a dedicated CPU is provided, and will be described below with reference to FIGS.

図17に示すように、この組込みコンピュータ61は1つのプライマリCPU70(以下、M−CPUという)と、複数のセカンダリCPU71−1,71−2,71−3〜71−n(以下、S−CPU1,S−CPU2,S−CPU3〜S−CPUnという)と、単一の共有メモリ72と、これらを接続する共有バス73とを有する。   As shown in FIG. 17, this embedded computer 61 includes one primary CPU 70 (hereinafter referred to as M-CPU) and a plurality of secondary CPUs 71-1, 71-2, 71-3 to 71-n (hereinafter referred to as S-CPU1). , S-CPU2, S-CPU3 to S-CPUn), a single shared memory 72, and a shared bus 73 for connecting them.

S−CPU1及びS−CPU2は、他のS−CPUが有する機能に加え、それぞれ、描画信号処理や音声処理等に適した特定の機能(これらの処理は一例である)を有する。また、M−CPUは、S−CPUが有しない外部信号処理に係る特定の機能(例えば、組込みコンピュータ61の外部機器からの割り込み信号受信機能等の信号処理機能)を有する。つまり、外部機器に係る信号処理はS−CPUでなく、M−CPUで行われる。   Each of the S-CPU 1 and S-CPU 2 has specific functions suitable for drawing signal processing, audio processing, and the like in addition to the functions of other S-CPUs (these processes are examples). Further, the M-CPU has a specific function related to external signal processing that the S-CPU does not have (for example, a signal processing function such as a function of receiving an interrupt signal from an external device of the embedded computer 61). That is, signal processing related to the external device is performed by the M-CPU instead of the S-CPU.

共有メモリ72は、ROM及びRAMからなる。該共有メモリ72には、請求項1〜請求項4に記載の組込みコンピュータ制御プログラムを構成して、組込みコンピュータ61を図1に記載の各手段等として機能させるリアルタイムオペレーティングシステム81(以下、OS81という)と、複数のタスク82a…82a,82b…82bと、該OS81に関する種々のパラメータや一時データ等からなるOSデータ83とが格納されている。   The shared memory 72 includes a ROM and a RAM. In the shared memory 72, a real-time operating system 81 (hereinafter referred to as an OS 81) that configures the embedded computer control program according to claims 1 to 4 and causes the embedded computer 61 to function as each means shown in FIG. ), A plurality of tasks 82a... 82a, 82b... 82b, and OS data 83 including various parameters and temporary data related to the OS 81.

OS81は、プライマリOS81aと、セカンダリOS81bとからなる。プライマリOS81aは、上記共有メモリ72からM−CPU上に読み込まれて実行され、セカンダリOS81bは、上記共有メモリ72からS−CPU1〜S−CPUn上にそれぞれ読み込まれて実行される。換言すれば、共有メモリ72上に格納されているセカンダリOS81bは1つであるが、各S−CPU1〜S−CPUn上でセカンダリOSが並行して実行されることとなる。なお、プライマリOS81aは、レディキューの構成、スケジューリング方式が、第1の実施の形態に係るOS21と同一とされ、セカンダリOS81bは、レディキューの構成、スケジューリング方式が、第2の実施の形態に係るOS51と同一とされている。そのため、以後、OS81a,81bの説明にあたっては、これらのOS81a,81b間の制御を主に説明する。   The OS 81 includes a primary OS 81a and a secondary OS 81b. The primary OS 81a is read from the shared memory 72 and executed on the M-CPU, and the secondary OS 81b is read from the shared memory 72 and executed on the S-CPU1 to S-CPUn. In other words, although there is one secondary OS 81b stored on the shared memory 72, the secondary OS is executed in parallel on each of the S-CPU1 to S-CPUn. The primary OS 81a has the same ready queue configuration and scheduling method as the OS 21 according to the first embodiment, and the secondary OS 81b has the ready queue configuration and scheduling method according to the second embodiment. It is the same as OS51. Therefore, hereinafter, in describing the OSs 81a and 81b, the control between the OSs 81a and 81b will be mainly described.

OSデータ83は、プライマリOS81a固有のプライマリOSデータ83aと、上記複数のS−CPU上で実行されるセカンダリOS81bで共有のセカンダリOS共有データ83bと、上記複数のS−CPU上で実行されるセカンダリOS81b毎に固有のセカンダリOS非共有データ83cとからなる。マスタOSデータ83aには、複数のレディキュー(前述の図3と同様のもの)を管理するレディキューテーブル(前述の図4と同様のもの)が含まれている。また、スレーブOS共有データ83aには、複数のレディキュー(前述の図10と同様のもの)を管理するレディキューテーブル(前述の図11と同様のもの)が含まれている。なお、前述のようにプライマリOS81a用のレディキュー及びレディキューテーブルの構成は第1の実施の形態に係るレディキューと同構成とされ、セカンダリOS81b用のレディキューは第2の実施の形態に係るレディキュー及びレディキューテーブルと同構成とされており、その詳細な説明は省略する。なお、セカンダリOS81b用のレディキューのCPU属性については、図10、図11においてCPUをS−CPUと読み替えればよい。   The OS data 83 includes primary OS data 83a unique to the primary OS 81a, secondary OS shared data 83b shared by the secondary OS 81b executed on the plurality of S-CPUs, and secondary executed on the plurality of S-CPUs. It consists of secondary OS non-shared data 83c unique to each OS 81b. The master OS data 83a includes a ready queue table (similar to FIG. 4 described above) for managing a plurality of ready queues (similar to FIG. 3 described above). Further, the slave OS shared data 83a includes a ready queue table (similar to FIG. 11 described above) for managing a plurality of ready queues (similar to FIG. 10 described above). As described above, the configuration of the ready queue and the ready queue table for the primary OS 81a is the same as that of the ready queue according to the first embodiment, and the ready queue for the secondary OS 81b is related to the second embodiment. The configuration is the same as the ready queue and the ready queue table, and a detailed description thereof is omitted. Note that the CPU attribute of the ready queue for the secondary OS 81b may be read as S-CPU in FIGS.

複数のプライマリタスク82a…82aは、プライマリOS81aが処理するタスクであり、複数のセカンダリタスク82b…82bは、セカンダリOS81bが処理するタスクである。プライマリタスク82aは、セカンダリOS81bに対してセカンダリタスク82bの実行制御のための各種要求を行うためのタスクであってプライマリOS81a上でのみ実行される。セカンダリタスク82bは、それ以外のタスクであってセカンダリOS81b上でのみ実行される。   The plurality of primary tasks 82a ... 82a are tasks processed by the primary OS 81a, and the plurality of secondary tasks 82b ... 82b are tasks processed by the secondary OS 81b. The primary task 82a is a task for making various requests for execution control of the secondary task 82b to the secondary OS 81b, and is executed only on the primary OS 81a. The secondary task 82b is other tasks and is executed only on the secondary OS 81b.

プライマリOS81aは、キーやスイッチ等からの外部割込みの処理、及び各S−CPU上のセカンダリOS81bの状態(実行状態であるかアイドル状態であるか)を管理、把握すると共に、この把握した状態に基づいてセカンダリタスク82bの実行制御を行う。具体的には、各S−CPU上のセカンダリOS81b用の初期セカンダリタスク82bの登録及び実行要求、並びにセカンダリタスク82bの起動要求及び停止要求をセカンダリOS81bに対して行う。なお、プライマリOS81aは、セカンダリOS81bに対するこれらの要求を、プライマリタスク82aを介して行う。セカンダリOS81bは、プライマリOS81aからの上記各種要求に応じて、セカンダリタスク82bを実行する。   The primary OS 81a manages and grasps the processing of external interrupts from keys, switches, etc., and the state (execution state or idle state) of the secondary OS 81b on each S-CPU. Based on this, execution control of the secondary task 82b is performed. Specifically, a registration and execution request for the initial secondary task 82b for the secondary OS 81b on each S-CPU and a request for starting and stopping the secondary task 82b are made to the secondary OS 81b. The primary OS 81a makes these requests to the secondary OS 81b via the primary task 82a. The secondary OS 81b executes the secondary task 82b in response to the various requests from the primary OS 81a.

各OS81a,81bは、CPUがタスクを実行しているときにはCPU実行状態と判定し、タスクを実行していないときはCPUアイドル状態(特許請求の範囲に記載のタスク非実行状態)と判定する。   Each of the OSs 81a and 81b determines that the CPU is in a CPU execution state when the CPU is executing a task, and determines that the CPU is in an idle state (a task non-execution state described in claims) when the task is not being executed.

プライマリタスク82a及びセカンダリタスク82bは、OS81a,81bによって、実行状態、実行可能状態、待ち状態、休止状態のうちのいずれかの状態に制御される。   The primary task 82a and the secondary task 82b are controlled by the OSs 81a and 81b to any one of an execution state, an executable state, a waiting state, and a hibernation state.

S−CPU上で実行中のセカンダリOS81bは、M−CPU上で実行中のプライマリタスク82aまたはM−CPU上で実行中の割込み処理から、セカンダリタスク82bの起動、停止、または待ち状態の解除の要求を受けたときは、S−CPU1〜S−CPUn上で実行中のタスクのタスク実行権を全て解放させて、スケジューリングを行う。   The secondary OS 81b being executed on the S-CPU can start, stop, or release the waiting state from the primary task 82a being executed on the M-CPU or the interrupt processing being executed on the M-CPU. When the request is received, scheduling is performed by releasing all task execution rights of the tasks being executed on the S-CPU1 to S-CPUn.

また、S−CPU上で実行中のセカンダリOS81bは、あるS−CPU上で実行中のセカンダリタスク82bまたはS−CPU上で実行中の割込み処理から、他のセカンダリタスク82bの起動、停止、または待ち状態の解除の要求を受けたとき、及びこの実行中のセカンダリタスク82bが待ち状態となるときは、S−CPU1〜S−CPUn上で実行中のタスクのタスク実行権を全て解放させて、スケジューリングを行う。   Further, the secondary OS 81b being executed on the S-CPU may start, stop, or stop another secondary task 82b from the secondary task 82b being executed on a certain S-CPU or the interrupt processing being executed on the S-CPU. When a request for releasing the waiting state is received and when the secondary task 82b being executed enters a waiting state, all task execution rights of the tasks being executed on the S-CPU1 to S-CPUn are released, Perform scheduling.

なお、前述のように、プライマリOS81aのスケジューリング方式及びレディキューの構成は、第1の実施の形態に係るOS21と同一とされ、セカンダリOS81bのスケジューリング方式及びレディキューの構成は、第2の実施の形態に係るOS51と同一とされているため、プライマリOS81aのスケジューリングについては図5のフローチャートを参照すればよく、セカンダリOS81bのスケジューリングについては図13のフローチャートを参照すればよい。なお、プライマリOS81aによりスケジューリングされるのは、M−CPUだけであり、CPU番号cが1でスケジューリング終了となる。また、セカンダリOS81bによりスケジューリングされるのは、S−CPU1〜S−CPUnであり、図13のCPUをS−CPUと読み替えればよい。   As described above, the scheduling method and the ready queue configuration of the primary OS 81a are the same as those of the OS 21 according to the first embodiment, and the scheduling method and the ready queue configuration of the secondary OS 81b are the same as those in the second embodiment. Since it is the same as the OS 51 according to the embodiment, the flowchart of FIG. 5 may be referred to for the scheduling of the primary OS 81a, and the flowchart of FIG. 13 may be referred to for the scheduling of the secondary OS 81b. Note that only the M-CPU is scheduled by the primary OS 81a. When the CPU number c is 1, the scheduling ends. Moreover, what is scheduled by the secondary OS 81b is S-CPU1 to S-CPUn, and the CPU in FIG. 13 may be read as S-CPU.

なお、セカンダリOS81bは、このスケジューリング中にプライマリタスク82aがセカンダリタスク82bの状態変化要求を出すのを防止するため、プライマリOS81aに対して、M−CPU上で実行中のタスクおよび割込み処理の一時停止の要求を出す。   In order to prevent the primary task 82a from issuing a state change request for the secondary task 82b during the scheduling, the secondary OS 81b temporarily suspends the task being executed on the M-CPU and interrupt processing to the primary OS 81a. Make a request.

スケジューリングを行うために各OS81a,82aからレディキュー等の各OSの共有データを操作するとき等には、OS81a,81b間の排他制御として、プライマリOS81aによるセカンダリOS81bの停止制御、並びにセカンダリOS81bによるプライマリOS81a及び他セカンダリOS81bの停止制御が行われる。プライマリOS81aによるセカンダリOS81bの停止制御は、セカンダリOS81bによるプライマリOS81a及び他セカンダリOS81bの停止制御よりも実行優先順位が高くされている。   When operating shared data of each OS such as a ready queue from each OS 81a, 82a for scheduling, etc., as the exclusive control between the OS 81a, 81b, the stop control of the secondary OS 81b by the primary OS 81a and the primary by the secondary OS 81b Stop control of the OS 81a and the other secondary OS 81b is performed. The stop control of the secondary OS 81b by the primary OS 81a has higher execution priority than the stop control of the primary OS 81a and the other secondary OS 81b by the secondary OS 81b.

この排他制御用として、リアルタイムOS81は、プライマリOS81a及び各セカンダリOS81bから参照可能なセカンダリOS共有データ83bに、排他制御要求用のフラグを格納する。具体的には、S−CPU数分(セカンダリOS81b数分)のプライマリOS用セカンダリ停止要求フラグと、これと同数のプライマリOS用セカンダリ停止応答フラグとを格納し、プライマリOS81aは、これらのフラグを用いてセカンダリOS81b上で実行中のタスクの停止制御を行う。また、S−CPU毎に(S−CPU上の各セカンダリOS81b毎に)、S−CPU数分(セカンダリOS81b数分)のセカンダリOS用セカンダリ停止要求フラグと、これと同数のセカンダリOS用セカンダリ停止応答フラグとを有し、セカンダリOS81bは、これらのフラグを用いてプライマリOS81aおよび他セカンダリOS81bの停止制御を行う。   For this exclusive control, the real-time OS 81 stores a flag for exclusive control request in the secondary OS shared data 83b that can be referenced from the primary OS 81a and each secondary OS 81b. Specifically, primary OS secondary stop request flags for the number of S-CPUs (for the number of secondary OS 81b) and the same number of secondary OS secondary stop response flags are stored, and the primary OS 81a sets these flags. And stop control of the task being executed on the secondary OS 81b. In addition, for each S-CPU (for each secondary OS 81b on the S-CPU), secondary OS secondary stop request flags for the number of S-CPUs (for the number of secondary OSs 81b) and the secondary stop for secondary OSs of the same number. The secondary OS 81b performs stop control of the primary OS 81a and the other secondary OS 81b using these flags.

次に、OS81による制御の具体例について説明する。なお、この説明に際しては、組込みコンピュータ61は、図17において、n=3の場合、すなわち、1つのM−CPU、及び3つのS−CPU,S−CPU2,S−CPU3を有するものとする。   Next, a specific example of control by the OS 81 will be described. In this description, it is assumed that the embedded computer 61 has n = 3 in FIG. 17, that is, one M-CPU and three S-CPUs, S-CPU2 and S-CPU3.

まず、図18を用いて、この組込みコンピュータ61の電源が投入された後の各OS81a,81bの起動及びタスクの処理について説明する。   First, with reference to FIG. 18, the activation of each of the OSs 81a and 81b and the task processing after the built-in computer 61 is turned on will be described.

組込みコンピュータ61の電源が投入された場合、M−CPU、及びS−CPU1,S−CPU2,S−CPU3は、まず、共有メモリ72のリセットベクタの命令及びデータを読み込む。この結果、M−CPU上ではプライマリOS81aが、S−CPU1,S−CPU2,S−CPU3上ではセカンダリOS81bがそれぞれ同時に起動する。   When the power of the embedded computer 61 is turned on, the M-CPU, S-CPU1, S-CPU2, and S-CPU3 first read the reset vector instruction and data in the shared memory 72. As a result, the primary OS 81a is simultaneously started on the M-CPU, and the secondary OS 81b is simultaneously started on the S-CPU1, S-CPU2, and S-CPU3.

そして、この起動時に、プライマリOS81aは、初期起動タスクとしてプライマリタスク82bを静的に生成してプライマリOS81a用のレディキューに接続し、スケジューリングを行う。そして、このスケジューリングの結果、プライマリOS81aによりM−CPUにこのプライマリタスク82bが割り当てられ、M−CPU上で初期起動タスクとしてのプライマリタスク82bが実行されることとなる。ここで、この初期起動タスクは、S−CPU1,S−CPU2,S−CPU3上で実行すべき初期起動タスクとしてのセカンダリタスク82b…82b(図18では、タスクA,B,Cと記載)を生成し、この生成されたセカンダリタスク82b…82b(タスクA,B,C)の起動要求を、各S−CPU1,S−CPU2,S−CPU3上で実行されるセカンダリOS81bに出力する。   At the time of activation, the primary OS 81a statically generates a primary task 82b as an initial activation task, connects to the ready queue for the primary OS 81a, and performs scheduling. As a result of this scheduling, this primary task 82b is assigned to the M-CPU by the primary OS 81a, and the primary task 82b as the initial activation task is executed on the M-CPU. Here, as this initial activation task, secondary tasks 82b... 82b (described as tasks A, B, and C in FIG. 18) as initial activation tasks to be executed on the S-CPU1, S-CPU2, and S-CPU3. The activation request of the generated secondary tasks 82b... 82b (tasks A, B, and C) is output to the secondary OS 81b executed on each S-CPU1, S-CPU2, and S-CPU3.

一方、各S−CPU上のセカンダリOS81bは、起動後すぐにアイドル状態に移行する。そして、上記プライマリタスク82aからのセカンダリタスク82b(タスクA,B,C)の起動要求を待ち、起動要求を受けたときに、順次、セカンダリタスク82b…82b(タスクA,B,C)を起動する。起動の際に、どのS−CPUがどのセカンダリタスク82b…82b(タスクA,B,C)を実行するかについては、セカンダリOS81bがスケジューリングを行なって決定する。   On the other hand, the secondary OS 81b on each S-CPU shifts to an idle state immediately after startup. Then, the secondary task 82b (tasks A, B, C) waits for the activation request from the primary task 82a, and when the activation request is received, the secondary tasks 82b ... 82b (tasks A, B, C) are activated sequentially. To do. The secondary OS 81b performs scheduling to determine which S-CPU executes which secondary task 82b ... 82b (tasks A, B, C) at the time of activation.

なお、上記所定のスケジューリング条件が成立したときに行われる本リアルタイムOS81によるスケジューリングの作用は、プライマリOS81aの場合、基本的に第1の実施の形態に係るOS21と同様であるが、CPUがM−CPU1つであることから、タスクが接続されたレディキューのうちの最も優先度の高いレディキューの先頭に接続されたタスクが実行されることとなる。つまり、先頭のタスクの実行が終了すると、先頭から2番目に接続されたタスク、もしくはそれよりも低い優先度のうち最も高い優先度のレディキューの先頭に接続されているタスクが実行されることとなる。例えば、図3のようにレディキューにタスクが接続されているものとすると、まずタスクT1が実行され、このタスクT1の実行が終了すると、次に、タスクT2が実行され、このタスクT2の実行が終了すると、次にタスクT3が実行されというように、1つのM−CPUで順次実行されることとなる。   Note that the scheduling operation performed by the real-time OS 81 performed when the predetermined scheduling condition is satisfied is basically the same as that of the OS 21 according to the first embodiment in the case of the primary OS 81a. Since there is one CPU, the task connected to the head of the ready queue with the highest priority among the ready queues to which the task is connected is executed. In other words, when execution of the first task ends, the task connected second from the top or the task connected to the head of the ready queue with the highest priority among lower priority is executed. It becomes. For example, assuming that a task is connected to the ready queue as shown in FIG. 3, the task T1 is executed first, and when the execution of the task T1 is completed, the task T2 is executed next, and the execution of the task T2 is executed. When the process is completed, the task T3 is executed next, so that it is sequentially executed by one M-CPU.

一方、セカンダリOS81bの場合、その作用は第2の実施の形態と同様となるため、その説明は省略する。   On the other hand, since the operation of the secondary OS 81b is the same as that of the second embodiment, the description thereof is omitted.

その場合に、本第3の実施の形態によれば、例えば、M−CPUが外部からの割り込み信号を受信したときに、該割り込み信号が例えばセカンダリタスク82bの起動に関するものであれば、これに関する割り込みハンドラが起動され、該割り込みハンドラからプライマリOS81aにセカンダリタスク82bの起動要求を行うプライマリタスク82aの起動要求が行われる。そして、プライマリOS81aによって起動されて実行状態となったプライマリタスク82aが、セカンダリOS81bに上記セカンダリタスク82bの起動要求を行い、この結果、このセカンダリタスク82bがセカンダリOS82bによって起動されて実行されることとなる。   In this case, according to the third embodiment, for example, when the M-CPU receives an interrupt signal from the outside, if the interrupt signal relates to the activation of the secondary task 82b, for example, The interrupt handler is activated, and the activation request of the primary task 82a for making the activation request of the secondary task 82b to the primary OS 81a is made from the interrupt handler. Then, the primary task 82a activated by the primary OS 81a and in the execution state makes a request for starting the secondary task 82b to the secondary OS 81b. As a result, the secondary task 82b is activated and executed by the secondary OS 82b. Become.

つまり、外部割込みを伴う処理が専用に確保されたM−CPUで迅速に実行されると共に、セカンダリタスクの実行制御等組込みシステム全体に係る処理がやはり専用に確保されたM−CPUで迅速に実行され、この結果、組込みシステム全体のタスク処理が迅速に行われることとなる。また、S−CPUに外部割込みに伴うタスクを処理するための機能を設ける必要がない。   In other words, processing involving an external interrupt is quickly executed by the M-CPU secured exclusively, and processing related to the entire embedded system, such as secondary task execution control, is also quickly executed by the M-CPU secured exclusively. As a result, task processing of the entire embedded system is performed quickly. Further, it is not necessary to provide a function for processing a task associated with an external interrupt in the S-CPU.

以上のように、第3の実施の形態に係る組込みシステムによれば、上記第1及び第2の実施の形態で説明した作用・効果に加え、リアルタイムOS81には、複数のS−CPU1,2,3及びメモリ72を含む第1の部分を請求項1から請求項3のいずれかに記載の各手段として機能させるセカンダリOS81b(第1の制御部)に加えて、外部割り込み処理機能を有するM−CPU(専用CPU)及びメモリ72を含む第2の部分を、複数のセカンダリタスク82b(第1の複数のタスク)の起動、停止をセカンダリOS81bに要求する複数のプライマリタスク82a(第2の複数のタスク)を制御する手段として機能させるプライマリOS81a(第2の制御部)が備えられているから、M−CPUで外部割込み処理が処理されるようになり、他の複数のS−CPU1,2,3の外部割込み処理負荷が解消される。また、プライマリOS81aでセカンダリOS81bを状況に応じて制御することができる。また、プライマリOS81aはセカンダリOS81bとはほぼ同じ構成であるから、M−CPUで外部割込み処理を行う仕組みを容易に構築することができると共に、プライマリOS81aでセカンダリOS81bをそれぞれの機能にあわせて最適化することができる。   As described above, according to the embedded system according to the third embodiment, in addition to the operations and effects described in the first and second embodiments, the real-time OS 81 includes a plurality of S-CPUs 1 and 2. , 3 and a memory 72 having an external interrupt processing function in addition to the secondary OS 81b (first control unit) that allows the first part including the memory 72 to function as each unit according to any one of claims 1 to 3. -The second part including the CPU (dedicated CPU) and the memory 72 is divided into a plurality of primary tasks 82a (second plurality of tasks) that request the secondary OS 81b to start and stop a plurality of secondary tasks 82b (first plurality of tasks). Since the primary OS 81a (second control unit) that functions as a means for controlling the task is controlled, an external interrupt process is processed by the M-CPU. Becomes, the external interrupt processing load of the other plurality of S-CPU1,2,3 is eliminated. Further, the secondary OS 81b can be controlled by the primary OS 81a according to the situation. Further, since the primary OS 81a has almost the same configuration as the secondary OS 81b, it is possible to easily construct a mechanism for performing external interrupt processing by the M-CPU, and the primary OS 81a optimizes the secondary OS 81b according to each function. can do.

本発明は、複数のCPUを有する組込みシステムに広く適用することができる。   The present invention can be widely applied to embedded systems having a plurality of CPUs.

本発明の実施の形態に係る組込みシステムのブロック図である。1 is a block diagram of an embedded system according to an embodiment of the present invention. 本発明の第1の実施の形態に係る組込みシステムのハードウェア構成図である。It is a hardware block diagram of the embedded system which concerns on the 1st Embodiment of this invention. 同組込みシステムを機能させるリアルタイムオペレーティングシステムのレディキューの説明図である。It is explanatory drawing of the ready queue of the real-time operating system which functions the same embedded system. 同オペレーティングシステムのレディキューテーブルの構成図である。It is a block diagram of the ready queue table of the same operating system. 同オペレーティングシステムによるタスクスケジューリングのフローチャートの一例である。It is an example of the flowchart of the task scheduling by the operating system. 同オペレーティングシステムによるタスクスケジューリングの作用の説明図である(その1)。It is explanatory drawing of the effect | action of the task scheduling by the operating system (the 1). 同オペレーティングシステムによるタスクスケジューリングの作用の説明図である(その2)。It is explanatory drawing of the effect | action of the task scheduling by the operating system (the 2). 同オペレーティングシステムによるタスクスケジューリングの作用の説明図である(その3)。It is explanatory drawing of the effect | action of the task scheduling by the operating system (the 3). 本発明の第2の実施の形態に係る組込みシステムのハードウェア構成図である。It is a hardware block diagram of the embedded system which concerns on the 2nd Embodiment of this invention. 同組込みシステムを機能させるリアルタイムオペレーティングシステムのレディキューの説明図である。It is explanatory drawing of the ready queue of the real-time operating system which functions the same embedded system. 同オペレーティングシステムのレディキューテーブルの構成図である。It is a block diagram of the ready queue table of the same operating system. 同オペレーティングシステムのレディキューテーブルのCPU属性指定の説明図である。It is explanatory drawing of CPU attribute designation | designated of the ready queue table of the same operating system. 同オペレーティングシステムによるタスクスケジューリングのフローチャートの一例である。It is an example of the flowchart of the task scheduling by the operating system. 同オペレーティングシステムによるタスクスケジューリングの作用の説明図である(その1)。It is explanatory drawing of the effect | action of the task scheduling by the operating system (the 1). 同オペレーティングシステムによるタスクスケジューリングの作用の説明図である(その2)。It is explanatory drawing of the effect | action of the task scheduling by the operating system (the 2). 同オペレーティングシステムによるタスクスケジューリングの作用の説明図である(その3)。It is explanatory drawing of the effect | action of the task scheduling by the operating system (the 3). 本発明の第3の実施の形態に係る組込みシステムのハードウェア構成図である。It is a hardware block diagram of the embedded system which concerns on the 3rd Embodiment of this invention. 同オペレーティングシステムが適用された組込みシステムの起動時の作用の説明図である。It is explanatory drawing of the effect | action at the time of starting of the embedded system to which the same operating system was applied.

符号の説明Explanation of symbols

1,31,61 組込みコンピュータ
11−1〜11−n,41−1〜41−n,70,71−1〜71−n CPU
12,42,72 共有メモリ(第1記憶装置、第2記憶装置、第3記憶装置、第4記憶装置、第5記憶装置、第6記憶装置)
21,51,81 リアルタイムオペレーティングシステム(制御プログラム)
22,52,82 タスク
70 プライマリCPU
71−1〜71−n セカンダリCPU
81a プライマリOS(第2の制御部)
81b セカンダリOS(第1の制御部)
1, 31, 61 Embedded computers 11-1 to 11-n, 41-1 to 41-n, 70, 71-1 to 71-n CPU
12, 42, 72 Shared memory (first storage device, second storage device, third storage device, fourth storage device, fifth storage device, sixth storage device)
21, 51, 81 Real-time operating system (control program)
22, 52, 82 Task 70 Primary CPU
71-1 to 71-n Secondary CPU
81a Primary OS (second control unit)
81b Secondary OS (first control unit)

Claims (9)

複数のCPUと、該複数のCPUで共用の第1、第2、第3記憶装置とを有する組込みコンピュータを制御するプログラムであって、コンピュータを、上記第1記憶装置上に、上記各CPUで共用とされて異なる優先度が設定された複数のレディキューを作成するレディキュー作成手段、上記第2記憶装置に記憶されている複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定するタスク優先度設定手段、上記第3記憶装置上に、上記複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成するタスク管理情報作成手段、該タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第3記憶装置上における格納領域の情報を、上記レディキュー作成手段で作成された複数のレディキューのうちの、上記タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納するタスク管理情報格納領域情報格納手段、上記複数のCPUで実行中のタスクのうちのいずれかのタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除するタスク管理情報格納領域情報削除手段、上記タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中の全タスクのタスク実行権を解放させて全CPUを一時タスク非実行状態とさせるタスク実行権解放手段、該タスク実行権解放手段で全タスクのタスク実行権が解放されるときに、この解放される各タスクの状態を当該各タスクのタスク管理情報に記録するタスク実行権解放時状態記録手段、上記タスク実行権解放手段でタスク非実行状態とされた各CPUに、上記複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューに格納されたタスク情報格納領域情報に係るタスクを、該レディキューの先頭側から順に割り当てるタスク割り当て手段、該タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させるタスク実行手段として機能させることを特徴とする組込みコンピュータ制御プログラム。 A program for controlling an embedded computer having a plurality of CPUs and first, second, and third storage devices shared by the plurality of CPUs, the computer being connected to each of the CPUs on the first storage device A ready queue creating means for creating a plurality of ready queues that are shared and set with different priorities, and sets a priority of at least a task to be executed among a plurality of tasks stored in the second storage device Task priority setting means, task management information creating means for creating task management information of at least a task to be executed among the plurality of tasks on the third storage device, execution created by the task management information creating means A plurality of ready queues created by the ready queue creating means are used to store storage area information on the third storage device for task management information of tasks to be processed. One of the task management information storage area information storage means stored at the tail of the ready queue having the same priority as the priority set by the task priority setting means, and the tasks being executed by the plurality of CPUs. When the execution of the task is completed, the task management information storage area information deletion means for deleting the task management information storage area information related to the task for which execution has been completed from the ready queue, executed by the task information storage area information storage means When task information storage area information related to a task to be stored is stored at the end of the ready queue corresponding to the priority of the task, a task having a lower priority than the priority of the task to be executed is being executed. When there is, task execution right releasing means for releasing the task execution right of all the tasks being executed and causing all CPUs to be in a temporary task non-execution state, When the task execution right of all tasks is released by the task execution right releasing means, the task execution right release state recording means for recording the state of each released task in the task management information of each task, the task execution The task information stored in the ready queue having the highest priority among the tasks related to the task management information storage area information stored in the plurality of ready queues is stored in each CPU that has been set to the task non-execution state by the authority release means. Task allocation means for allocating tasks related to area information in order from the head of the ready queue, and causing the CPU to which tasks are allocated by the task allocation means to execute the task based on the task management information storage area information of the task An embedded computer control program which functions as a task execution means. コンピュータをタスク実行権解放手段として機能させるときに、タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるとき、または実行が終了したタスクに係るタスク管理情報格納領域情報がタスク管理情報格納領域情報削除手段によってレディキューから削除されるときに、実行中の全タスクのタスク実行権を解放させて全CPUを一時タスク非実行状態とさせることを特徴とする請求項1に記載の組込みコンピュータ制御プログラム。 When the computer functions as the task execution right releasing means, task information storage area information relating to a task to be executed by the task information storage area information storage means is stored at the tail of the ready queue corresponding to the priority of the task. In some cases, when a task having a lower priority than the priority of the task to be executed is being executed, or task management information storage area information related to the task that has been executed is read by the task management information storage area information deletion means. The embedded computer control program according to claim 1, wherein when the task is deleted from the queue, the task execution right of all the tasks being executed is released to make all the CPUs non-executable. 複数のCPUのうちに特定の機能を有する特定CPUが備えられている場合において、コンピュータをレディキュー作成手段として機能させるときに、上記特定CPUに関連付けた特定のレディキューを作成するように機能させ、タスク管理情報格納領域情報格納手段として機能させるときに、上記特定の機能を利用する特定タスクのタスク管理情報格納領域情報については上記特定のレディキューに格納するように機能させ、タスク割り当て手段として機能させるときに、特定のレディキューに接続された特定タスクを、該特定CPUに割り当てるように機能させることを特徴とする請求項1または請求項2に記載の組込みコンピュータ制御プログラム。 In the case where a specific CPU having a specific function is provided among a plurality of CPUs, when the computer functions as a ready queue creating means, it functions to create a specific ready queue associated with the specific CPU. When functioning as task management information storage area information storage means, the task management information storage area information of a specific task that uses the specific function is functioned to be stored in the specific ready queue, 3. The embedded computer control program according to claim 1, wherein when the program is caused to function, the program is caused to function so that a specific task connected to a specific ready queue is assigned to the specific CPU. 複数のCPU及び第1、第2、第3記憶装置に加え、外部割り込み処理機能を有する専用CPU及び第4、第5、第6記憶装置が備えられた組込みコンピュータにおいて、コンピュータにおける上記複数のCPU及び第1、第2、第3記憶装置を含む第1の部分を請求項1から請求項3のいずれかに記載の各手段として機能させる第1の制御部と、専用CPU及び第4、第5、第6記憶装置を含む第2の部分を、第1の複数のタスクの実行制御に係る要求を第1の制御部に対して行う第2の複数のタスクを制御する手段として機能させる第2の制御部とからなり、第2の制御部は、コンピュータの第2の部分を、上記第4記憶装置上に専用CPUで共用とされて異なる優先度が設定された第2の複数のレディキューを作成する第2レディキュー作成手段、上記第5記憶装置に記憶されている、第1の複数のタスクを実行制御する第2の複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定する第2タスク優先度設定手段、上記第6記憶装置上に、上記第2の複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成する第2タスク管理情報作成手段、該第2タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第6記憶装置上における格納領域の情報を、上記第2レディキュー作成手段で作成された第2の複数のレディキューのうちの、上記第2タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納する第2タスク管理情報格納領域情報格納手段、上記専用CPUで実行中のタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除する第2タスク管理情報格納領域情報削除手段、上記第2タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中のタスクのタスク実行権を解放させてCPUを一時タスク非実行状態とさせる第2タスク実行権解放手段、該第2タスク実行権解放手段でタスクの実行権が解放されるときに、この解放されるタスクの状態を当該タスクのタスク管理情報に記録する第2タスク実行権解放時状態記録手段、上記第2タスク実行権解放手段でタスク非実行状態とされたCPUに、上記第2の複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューの先頭に格納されたタスク情報格納領域情報に係るタスクを割り当てる第2タスク割り当て手段、該第2タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させる第2タスク実行手段として機能させることを特徴とする請求項1から請求項3のいずれかに記載の組込みコンピュータ制御プログラム。 In a built-in computer provided with a dedicated CPU having an external interrupt processing function and fourth, fifth and sixth storage devices in addition to a plurality of CPUs and first, second and third storage devices, the plurality of CPUs in the computer And a first control unit that causes the first part including the first, second, and third storage devices to function as each unit according to any one of claims 1 to 3, a dedicated CPU, and a fourth, 5. The second part including the sixth storage device functions as means for controlling the second plurality of tasks for making a request for execution control of the first plurality of tasks to the first control unit. The second control unit includes a second plurality of ready units in which different priority levels are set by sharing the second part of the computer with the dedicated CPU on the fourth storage device. Second ready curriculum that creates a queue A second task priority setting for setting a priority of at least a task to be executed among a plurality of second tasks for controlling execution of the first plurality of tasks stored in the fifth storage device; Means for creating task management information of at least a task to be executed out of the second plurality of tasks on the sixth storage device, created by the second task management information creating means The information on the storage area of the sixth storage device for the task management information of the task to be executed is used as the second task of the second plurality of ready queues created by the second ready queue creating means. The second task management information storage area information storage means for storing at the tail of the ready queue having the same priority as the priority set by the priority setting means, the task being executed by the dedicated CPU being executed The second task management information storage area information deletion means for deleting the task management information storage area information relating to the task whose execution has been completed from the ready queue, and the second task information storage area information storage means. When task information storage area information related to a task is stored at the end of the ready queue corresponding to the priority of the task, a task having a lower priority than the priority of the task to be executed is being executed Is a second task execution right releasing means for releasing the task execution right of the task being executed to put the CPU into a temporary task non-execution state, and when the task execution right is released by the second task execution right releasing means The second task execution right release state recording means for recording the state of the released task in the task management information of the task, and the second task execution right release means The task information stored in the head of the ready queue with high priority among the tasks related to the task management information storage area information stored in the second plurality of ready queues in the task non-executed state Second task assigning means for assigning a task related to area information, and second task executing means for causing the CPU assigned the task by the second task assigning means to execute the task based on the task management information storage area information of the task The embedded computer control program according to any one of claims 1 to 3, wherein the embedded computer control program is functioned as: 請求項1から請求項4のいずれかに記載の組込みコンピュータ制御プログラムを記録したコンピュータ読み取り可能な記録媒体。 A computer-readable recording medium on which the embedded computer control program according to any one of claims 1 to 4 is recorded. 複数のCPUと、該複数のCPUで共用の第1、第2、第3記憶装置と、上記第1記憶装置上に、上記各CPUで共用とされて異なる優先度が設定された複数のレディキューを作成するレディキュー作成手段と、上記第2記憶装置に記憶されている複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定するタスク優先度設定手段と、上記第3記憶装置上に、上記複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成するタスク管理情報作成手段と、該タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第3記憶装置上における格納領域の情報を、上記レディキュー作成手段で作成された複数のレディキューのうちの、上記タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納するタスク管理情報格納領域情報格納手段と、上記複数のCPUで実行中のタスクのうちのいずれかタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除するタスク管理情報格納領域情報削除手段と、上記タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中の全タスクの実行権を解放させて全CPUを一時タスク非実行状態とさせるタスク実行権解放手段と、該タスク実行権解放手段で全タスクの実行権が解放されるときに、この解放される各タスクの状態を当該各タスクのタスク管理情報に記録するタスク実行権解放時状態記録手段と、上記タスク実行権解放手段でタスク非実行状態とされた各CPUに、上記複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューに格納されたタスク情報格納領域情報に係るタスクを、該レディキューの先頭側から順に割り当てるタスク割り当て手段と、該タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させるタスク実行手段とを有することを特徴とする組込みシステム。 A plurality of CPUs, first, second, and third storage devices shared by the plurality of CPUs, and a plurality of readys that are shared by the CPUs and have different priorities set on the first storage device A ready queue creating means for creating a queue, a task priority setting means for setting the priority of at least a task to be executed among the plurality of tasks stored in the second storage device, and the third storage device In addition, task management information creation means for creating task management information of at least a task to be executed among the plurality of tasks, and the third of the task management information of the task to be executed created by the task management information creation means. The storage area information on the storage device has the same priority as the priority set by the task priority setting means among the plurality of ready queues created by the ready queue creation means. Task management information storage area information storage means stored at the tail end of the ready queue and a task related to the task that has been executed when execution of any of the tasks being executed by the plurality of CPUs is completed Task management information storage area information deletion means for deleting management information storage area information from the ready queue, and task information storage area information relating to a task to be executed by the task information storage area information storage means corresponds to the priority of the task. When the task is stored at the end of the ready queue and a task having a lower priority than the priority of the task to be executed is being executed, the right to execute all the tasks being executed is released and all CPUs are released. The task execution right release means for setting the temporary task non-execution state, and when the right to execute all tasks is released by the task execution right release means, the release is performed. The task execution right release state recording means for recording the state of each task to be recorded in the task management information of each task, and the CPUs in the task non-execution state by the task execution right release means, in the plurality of ready queues Task assignment means for sequentially assigning tasks related to task information storage area information stored in a ready queue having a high priority, among tasks related to stored task management information storage area information, from the head side of the ready queue; An embedded system, comprising: a task execution unit that causes a CPU to which a task is allocated by the task allocation unit to execute the task based on task management information storage area information of the task. タスク実行権解放手段は、タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるとき、または実行が終了したタスクに係るタスク管理情報格納領域情報がタスク管理情報格納領域情報削除手段によってレディキューから削除されるときに、実行中の全タスクのタスク実行権を解放させて全CPUを一時タスク非実行状態とさせることを特徴とする請求項6に記載の組込みシステム。 The task execution right releasing means executes the task information storage area information when the task information storage area information relating to the task to be executed by the task information storage area information storage means is stored at the tail of the ready queue corresponding to the priority of the task. When a task whose priority is lower than the priority of the task to be executed is being executed, or the task management information storage area information related to the task that has been executed is deleted from the ready queue by the task management information storage area information deletion means 7. The embedded system according to claim 6, wherein the task execution right of all the tasks being executed is released, and all the CPUs are set in a temporary task non-execution state. 複数のCPUのうちに特定の機能を有する特定CPUが備えられている場合において、レディキュー作成手段は、上記特定CPUに関連付けた特定のレディキューを作成し、タスク管理情報格納領域情報格納手段は、上記特定の機能を利用する特定タスクのタスク管理情報格納領域情報については上記特定のレディキューに格納し、タスク割り当て手段は、特定のレディキューに接続された特定タスクを、該特定CPUに割り当てることを特徴とする請求項6または請求項7に記載の組込みシステム。 When a specific CPU having a specific function is provided among the plurality of CPUs, the ready queue creation means creates a specific ready queue associated with the specific CPU, and the task management information storage area information storage means The task management information storage area information of the specific task that uses the specific function is stored in the specific ready queue, and the task assigning unit allocates the specific task connected to the specific ready queue to the specific CPU. The embedded system according to claim 6 or 7, characterized in that 複数のCPU及び第1、第2、第3記憶装置に加え、外部割り込み処理機能を有する専用CPU及び第4、第5、第6記憶装置が備えられており、かつ、請求項6から請求項8のいずれかに記載の各手段を含む第1の制御部は、上記複数のCPU及び第1、第2、第3記憶装置を含む第1の部分を制御し、上記専用CPU及び第4、第5、第6記憶装置を含む第2の部分を、第1の複数のタスクの実行制御に係る要求を第1の制御部に行う第2の複数のタスクを制御する手段として機能させる第2の制御部は、上記第4記憶装置上に、専用CPUで共用とされて異なる優先度が設定された第2の複数のレディキューを作成する第2レディキュー作成手段と、上記第5記憶装置に記憶されている、第1の複数のタスクを実行制御する第2の複数のタスクのうちの少なくとも実行すべきタスクの優先度を設定する第2タスク優先度設定手段と、上記第6記憶装置上に、上記第2の複数のタスクのうちの少なくとも実行すべきタスクのタスク管理情報を作成する第2タスク管理情報作成手段と、該第2タスク管理情報作成手段で作成された実行すべきタスクのタスク管理情報の上記第6記憶装置上における格納領域の情報を、上記第2レディキュー作成手段で作成された第2の複数のレディキューのうちの、上記第2タスク優先度設定手段で設定された優先度と同一優先度のレディキューの最後尾に格納する第2タスク管理情報格納領域情報格納手段と、上記専用CPUで実行中のタスクの実行が終了したときに、この実行が終了したタスクに係るタスク管理情報格納領域情報をレディキューから削除するタスク第2管理情報格納領域情報削除手段と、上記第2タスク情報格納領域情報格納手段によって実行すべきタスクに係るタスク情報格納領域情報が該タスクの優先度に対応するレディキューの最後尾に格納される場合において、該実行すべきタスクの優先度よりも優先度が低いタスクが実行中であるときは、実行中のタスクのタスク実行権を解放させてCPUを一時タスク非実行状態とさせる第2タスク実行権解放手段と、該第2タスク実行権解放手段でタスクのタスク実行権が解放されるときに、この解放されるタスクの状態を当該タスクのタスク管理情報に記録する第2タスク実行権解放時状態記録手段と、上記第2タスク実行権解放手段でタスク非実行状態とされたCPUに、上記第2の複数のレディキューに格納されたタスク管理情報格納領域情報に係るタスクのうちの、優先度の高いレディキューの先頭に格納されたタスク情報格納領域情報に係るタスクを割り当てる第2タスク割り当て手段と、該第2タスク割り当て手段でタスクを割り当てたCPUに、当該タスクを、当該タスクのタスク管理情報格納領域情報に基づいて実行させる第2タスク実行手段とを有することを特徴とする請求項6から請求項8のいずれかに記載の組込みシステム。

In addition to a plurality of CPUs and first, second, and third storage devices, a dedicated CPU having an external interrupt processing function and fourth, fifth, and sixth storage devices are provided, and claims 6 to 6. A first control unit including each means according to any one of 8 controls the first part including the plurality of CPUs and the first, second, and third storage devices, and the dedicated CPU and the fourth, A second part that includes the fifth and sixth storage devices and functions as means for controlling a second plurality of tasks that requests the first control unit to execute a request for execution control of the first plurality of tasks. The control unit includes a second ready queue creating means for creating a second plurality of ready queues that are shared by the dedicated CPU and set with different priorities on the fourth storage device, and the fifth storage device. And a second plurality of execution controls of the first plurality of tasks Second task priority setting means for setting the priority of at least a task to be executed among the tasks, and task management of at least the task to be executed among the plurality of second tasks on the sixth storage device Second task management information creating means for creating information, and storage area information on the sixth storage device for the task management information of the task to be executed created by the second task management information creating means. The second task management stored at the tail of the ready queue having the same priority as the priority set by the second task priority setting means among the second plurality of ready queues created by the ready queue creation means When the execution of the task being executed by the information storage area information storage means and the dedicated CPU is completed, the task management information storage area information relating to the task for which the execution has been completed is readied. The task second management information storage area information deletion means to be deleted from the task, and the task information storage area information relating to the task to be executed by the second task information storage area information storage means, the ready queue corresponding to the priority of the task When stored at the end, if a task with a lower priority than the priority of the task to be executed is being executed, the task execution right of the task being executed is released and the CPU is not executed temporarily When the task execution right of the task is released by the second task execution right releasing means to be released and the second task execution right releasing means is released, the state of the released task is recorded in the task management information of the task Stored in the second plurality of ready queues in the second task execution right release state recording means and the CPU that has been in the task non-execution state by the second task execution right release means. Second task allocating means for allocating a task related to task information storage area information stored at the head of the ready queue having a higher priority among the tasks related to the task management information storage area information, and the second task allocating means 9. The second task execution means for causing the CPU to which the task is assigned to execute the task based on the task management information storage area information of the task, according to any one of claims 6 to 8. The described embedded system.

JP2004143253A 2004-05-13 2004-05-13 Embedded computer control program, recording medium recording the program, and embedded system Expired - Fee Related JP3893136B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004143253A JP3893136B2 (en) 2004-05-13 2004-05-13 Embedded computer control program, recording medium recording the program, and embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004143253A JP3893136B2 (en) 2004-05-13 2004-05-13 Embedded computer control program, recording medium recording the program, and embedded system

Publications (2)

Publication Number Publication Date
JP2005327007A true JP2005327007A (en) 2005-11-24
JP3893136B2 JP3893136B2 (en) 2007-03-14

Family

ID=35473331

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004143253A Expired - Fee Related JP3893136B2 (en) 2004-05-13 2004-05-13 Embedded computer control program, recording medium recording the program, and embedded system

Country Status (1)

Country Link
JP (1) JP3893136B2 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007156976A (en) * 2005-12-07 2007-06-21 Hitachi Kokusai Electric Inc Information processing system
WO2007081022A1 (en) * 2006-01-16 2007-07-19 Seiko Epson Corporation Multi-processor system abd program for causing computer to execute multi-processor system control method
JP2010160597A (en) * 2009-01-07 2010-07-22 Nec Corp System, method and program for controlling process execution
WO2010095358A1 (en) * 2009-02-18 2010-08-26 日本電気株式会社 Task allocation device, task allocation method, and recording medium storing task allocation program
JP2011186619A (en) * 2010-03-05 2011-09-22 Canon Inc Processing device, processing allocation method, and program
JP2021174367A (en) * 2020-04-28 2021-11-01 株式会社デンソー Real-time arithmetic processing device
US20230342192A1 (en) * 2022-04-21 2023-10-26 Microsoft Technology Licensing, Llc Distributed, decentralized traffic control for worker processes in limited-coordination environments
JP2024541019A (en) * 2021-10-25 2024-11-06 上海▲けい▼朗智能科技有限公司 Robot scheduling method, device, electronic device, and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102915254B (en) * 2011-08-02 2018-04-06 中兴通讯股份有限公司 task management method and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007156976A (en) * 2005-12-07 2007-06-21 Hitachi Kokusai Electric Inc Information processing system
US7979861B2 (en) 2006-01-16 2011-07-12 Seiko Epson Corporation Multi-processor system and program for causing computer to execute controlling method of multi-processor system
WO2007081022A1 (en) * 2006-01-16 2007-07-19 Seiko Epson Corporation Multi-processor system abd program for causing computer to execute multi-processor system control method
JP2010160597A (en) * 2009-01-07 2010-07-22 Nec Corp System, method and program for controlling process execution
JP5545288B2 (en) * 2009-02-18 2014-07-09 日本電気株式会社 Task allocation device, task allocation method, and task allocation program
WO2010095358A1 (en) * 2009-02-18 2010-08-26 日本電気株式会社 Task allocation device, task allocation method, and recording medium storing task allocation program
US8897372B2 (en) 2009-02-18 2014-11-25 Nec Corporation Task allocation device, task allocation method, and storage medium storing task allocation program
JP2011186619A (en) * 2010-03-05 2011-09-22 Canon Inc Processing device, processing allocation method, and program
JP2021174367A (en) * 2020-04-28 2021-11-01 株式会社デンソー Real-time arithmetic processing device
JP7322797B2 (en) 2020-04-28 2023-08-08 株式会社デンソー Real-time processor
JP2024541019A (en) * 2021-10-25 2024-11-06 上海▲けい▼朗智能科技有限公司 Robot scheduling method, device, electronic device, and storage medium
JP7728974B2 (en) 2021-10-25 2025-08-25 上海▲けい▼朗智能科技有限公司 Robot scheduling method, device, electronic device, and storage medium
US20230342192A1 (en) * 2022-04-21 2023-10-26 Microsoft Technology Licensing, Llc Distributed, decentralized traffic control for worker processes in limited-coordination environments
US12498969B2 (en) * 2022-04-21 2025-12-16 Microsoft Technology Licensing, Llc. Distributed, decentralized traffic control for worker processes in limited-coordination environments

Also Published As

Publication number Publication date
JP3893136B2 (en) 2007-03-14

Similar Documents

Publication Publication Date Title
EP3425502A1 (en) Task scheduling method and device
JP4345630B2 (en) Information processing apparatus, interrupt processing control method, and computer program
JP2009265963A (en) Information processing system and task execution control method
US9588808B2 (en) Multi-core system performing packet processing with context switching
JP2013506179A (en) Execution management system combining instruction threads and management method
WO2017070900A1 (en) Method and apparatus for processing task in a multi-core digital signal processing system
CN101310257A (en) Multiprocessor system and program for causing computer to execute control method of multiprocessor system
JP2010529533A (en) System including a plurality of processors and method of operating the same
JP2022509170A (en) Ligamentous laxity-aware type dynamic priority change in the processor
WO2018084024A1 (en) Vehicle control device
CN100419688C (en) Interrupt control device and control method
JP3893136B2 (en) Embedded computer control program, recording medium recording the program, and embedded system
JP2009223842A (en) Virtual machine control program and virtual machine system
JP2006099332A (en) Information processing apparatus, process control method, and computer program
US20030018682A1 (en) Computer system and computer-readable record medium
US7590990B2 (en) Computer system
US20130247065A1 (en) Apparatus and method for executing multi-operating systems
US9372724B2 (en) System and method for conditional task switching during ordering scope transitions
WO2020008757A1 (en) Method of accessing device in virtualized environment
KR20070090649A (en) Apparatus and method for providing cooperative scheduling in a multicore system
JP2008225641A (en) Computer system, interrupt control method and program
WO2023231768A1 (en) Multi-core processor and related inter-core communication method
JP7054688B2 (en) Synchronous control system and synchronous control method
JP2013041361A (en) Resource arbitration system and resource arbitration method
JP4017005B2 (en) Arithmetic unit

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060418

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060515

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061208

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20101215

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111215

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121215

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121215

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20141215

Year of fee payment: 8

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20141215

Year of fee payment: 8

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees