JP2003084990A - General communication method between task - Google Patents

General communication method between task

Info

Publication number
JP2003084990A
JP2003084990A JP2001276720A JP2001276720A JP2003084990A JP 2003084990 A JP2003084990 A JP 2003084990A JP 2001276720 A JP2001276720 A JP 2001276720A JP 2001276720 A JP2001276720 A JP 2001276720A JP 2003084990 A JP2003084990 A JP 2003084990A
Authority
JP
Japan
Prior art keywords
communication
task
inter
heap memory
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2001276720A
Other languages
Japanese (ja)
Inventor
Masaaki Saito
雅昭 斎藤
Kazunori Takahashi
和紀 高橋
Masahiro Ishikawa
正浩 石川
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.)
Chuo Electronics Co Ltd
Original Assignee
Chuo Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chuo Electronics Co Ltd filed Critical Chuo Electronics Co Ltd
Priority to JP2001276720A priority Critical patent/JP2003084990A/en
Publication of JP2003084990A publication Critical patent/JP2003084990A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To improve portability and reliability by reducing a labor for designing inter-task communication, providing a flexible synchronized control design and a strict heap memory control, and standardizing inter-task communication procedures in the development of a computer system using a built-in OS or a general purpose OS. SOLUTION: The inter-task communication and an interface are designed as an integrated one, (1) the inter-task communication is materialized by a message or a message address communication function alone, (2) the synchronized control is commanded by a transmission side and a receiver side synchronously responds thereto using the message or the message address communication function according to the command, and (3) the heap memory control is commanded by the transmission side by acquisition and release (return).

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、組み込み型OSや
汎用OSを用いたコンピュータシステム開発において重
要な要素であるタスク間通信の設計に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to inter-task communication design, which is an important element in computer system development using an embedded OS or a general-purpose OS.

【0002】[0002]

【従来の技術】リアルタイムOSに代表される組み込み
型OSや、Windows(登録商標),Unix(登
録商標)などの汎用OSを用いたコンピュータシステム
開発においては、タスク間通信の設計が重要な要素とな
っており、調査・検討しなければならない課題は、OS
が提供する通信機能と同期制御方法および資源の管理機
能に要約される。
2. Description of the Related Art In a computer system development using a built-in OS typified by a real-time OS and a general-purpose OS such as Windows (registered trademark) and Unix (registered trademark), designing communication between tasks is an important element. The issue that must be investigated / considered is OS
It is summarized in the communication function, synchronization control method and resource management function provided by.

【0003】[0003]

【発明が解決しようとする課題】これまではOS変更の
都度、新たなOSが提供するマクロ機能などを使用し
て、タスク間の通信方法、および上述した課題である制
御方法等の設計やインターフェースを再設計していた。
このため、再設計に要する労力やタスクの移植に係る影
響などにより、OSの変更に伴う膨大な作業が発生して
いた。
In the past, every time the OS was changed, the macro function provided by the new OS was used, and the communication method between tasks, and the design and interface of the control method, which is the above-mentioned problem, were used. Had been redesigned.
Therefore, due to the labor required for redesign, the effect of porting tasks, and the like, a huge amount of work has been required to change the OS.

【0004】[0004]

【課題を解決するための手段】本発明は、上述した課題
を解決するためになされたものであって、タスク間通信
の要求仕様をつきつめて検討すると、OSが提供する多
種多様なマクロにも係らず、真に必要な機能は極く限ら
れており、かつ、その種の機能は殆どのOSが提供して
いる。従って、同一の高級言語を用いることを前提とし
たうえで、使用する機能を極力絞り込み、必要充分な機
能だけを用いてタスク間通信方法やインターフェースを
構成すれば、それを実現するユーザマクロ(又は関数)
のみの書き換えによって、移植が容易に行えることにな
る。一方、組み込み型OSやリアルタイム・マルチタス
クシステムにおけるタスク間通信では、クリティカルな
タイミングや厳しいメモリ資源などの技術的制約があ
り、この問題を勘案して設計する必要がある。特に、同
期制御と動的メモリ(ヒープメモリ)管理は必須とされ
る機能である。これらタスク間通信に求められる機能を
要約すると、次の3点にまとめられる。 各種OSが提供する一般的な通信機能のみを使用して
実現する。 同期通信の制御(同期の要・不要、同期方法および動
的制御)を行う。 ヒープメモリ管理(管理の要・不要、および動的制
御)を行う。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems. When the requirements specifications for inter-task communication are examined and examined, various macros provided by the OS are also found. Regardless, the truly required functions are extremely limited, and most kinds of OS provide such functions. Therefore, on the premise that the same high-level language is used, if the functions to be used are narrowed down as much as possible and the inter-task communication method or interface is configured using only necessary and sufficient functions, the user macro (or function)
Only by rewriting, will porting be easier. On the other hand, in inter-task communication in an embedded OS or a real-time multi-task system, there are technical constraints such as critical timing and severe memory resources, and it is necessary to design in consideration of this problem. In particular, synchronous control and dynamic memory (heap memory) management are essential functions. The functions required for inter-task communication can be summarized into the following three points. It is realized using only general communication functions provided by various OSs. Controls synchronous communication (whether or not synchronization is required, synchronization method and dynamic control). Performs heap memory management (whether management is required or not, and dynamic control).

【0005】上述した要求仕様を満たすために、以下の
要件でタスク間通信とインターフェース(以下、本I/
Fという)を一体のものとして設計し、タスク間の汎用
通信方法を実現する。 タスク間通信は、メッセージ又はメッセージアドレス
通信機能のみで実現する。 同期制御は送信側が指示するものとし、受信側はこの
指示に従って同期応答をメッセージ又はメッセージアド
レス通信機能を用いて行う。本I/Fはこの同期通信の
応答先、および要・不要を指示する制御情報を含んでお
り、これにより同期の要・不要、同期方法および動的制
御を実現する。 ヒープメモリ管理は送信側が指示するものとし、取得
と解放(返却)によって行う。本I/Fはこのヒープメ
モリ情報、および解放の要・不要を指示する制御情報を
含んでおり、これによりヒープメモリ管理の要・不要、
および動的制御を実現する。
In order to meet the above-mentioned required specifications, communication between tasks and an interface (hereinafter referred to as I / O
(Referred to as F) is designed as a single unit to realize a general-purpose communication method between tasks. Inter-task communication is realized only by a message or message address communication function. It is assumed that the sender controls the synchronization control, and the receiver uses the message or message address communication function to send a synchronization response in accordance with the instruction. This I / F includes a response destination of this synchronous communication and control information for instructing the necessity / unnecessity of the synchronization, and thereby realizes the necessity / unnecessity of the synchronization, the synchronization method, and the dynamic control. Heap memory management shall be instructed by the sender and shall be performed by acquisition and release (return). This I / F includes this heap memory information and control information for instructing the necessity / unnecessity of the release, whereby the necessity / unnecessity of the heap memory management,
And realize dynamic control.

【0006】[0006]

【発明の実施の形態】以下、本発明に係るタスク間にお
ける汎用通信方法の実施例を、図面を参照しながら説明
する。図1は同期制御を伴うタスク間通信例、図2は同
期制御を伴わないタスク間通信例を示し、図3は同期制
御とメモリ管理を伴わないハンドラ→タスク間通信例、
図4は受信要求を行うタスク間通信例を示す。また、タ
スク間汎用通信インターフェース例を表1に示す。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of a general communication method between tasks according to the present invention will be described below with reference to the drawings. FIG. 1 shows an example of inter-task communication with synchronization control, FIG. 2 shows an example of inter-task communication without synchronization control, and FIG. 3 shows an example of handler-to-task communication without synchronization control and memory management.
FIG. 4 shows an example of inter-task communication for making a reception request. Table 1 shows an example of a general-purpose communication interface between tasks.

【0007】[0007]

【表1】 [Table 1]

【0008】図1は同期制御を伴うタスク間通信例であ
って、同期制御は送信側が指示するものとし、受信側は
この指示に従って同期応答をメッセージ又はメッセージ
アドレス機能を用いて行うように構成してあり、処理の
流れは〜に示す通りである。また、図2は同期制御
を伴わないタスク間通信例であって、処理の流れは〜
に示す通りである。
FIG. 1 shows an example of inter-task communication with synchronization control. It is assumed that the transmission side instructs the synchronization control, and the reception side is configured to perform a synchronization response using the message or message address function in accordance with this instruction. The processing flow is as shown in. Further, FIG. 2 is an example of communication between tasks without synchronous control, and the flow of processing is
As shown in.

【0009】本I/Fはタスク間通信ばかりでなく、ハ
ンドラ→タスク間通信にも採用可能であって、同期制御
とメモリ管理を伴わないハンドラ→タスク間通信例は図
3に示す通りであり、処理の流れは〜に示す通りで
ある。また、受信要求を行うタスク間通信例は図4に示
す通りであり、処理の流れを〜に示す。
This I / F can be adopted not only for inter-task communication but also for handler-> inter-task communication. An example of handler-> inter-task communication without synchronous control and memory management is as shown in FIG. The processing flow is as shown in. Further, an example of communication between tasks for making a reception request is as shown in FIG. 4, and the flow of processing is shown in.

【0010】[0010]

【発明の効果】以上説明したように、本発明に係るタス
ク間における汎用通信方法によると、下記に示すような
効果があることが判る。 柔軟な同期制御設計 同期制御は、リアルタイム・マルチタスクシステムの設
計においてはクリティカルな問題であり、往々にして制
作・試験途中での設計変更が生じる部分であるが、本発
明によるI/Fを採用することにより、この部分の仕様
変更が容易に行えるようになる。例えば、当初同期応答
なしで送信側タスクと受信側タスクを設計したと仮定し
たとき、これを同期応答待ちに仕様変更する場合は、送
信側タスクが本I/Fの同期用メールボックスIDを設
定するだけで、手順・仕様の変更が実現できるからであ
る。また、同期応答を待つメールボックスを送信側タス
クの通常のメールボックスに設定すれば、同期応答待ち
と通常の事象待ちの論理和でタスクが起動されることに
なる。一方、同期応答を待つメールボックスを送信側タ
スクの同期用のメールボックスに設定すると、厳密な同
期制御が行えることになる。さらに、同期制御の動的制
御は、送信側のタスクが同期応答を待つメールボックス
を指定するか否かをその時点で判断し、必要に応じて同
期制御の要・不要を選択することで実現する。 厳密なヒープメモリ管理 これまでヒープメモリ管理は、設計時にその都度タスク
間でどのように取得/解放するかを決定し、それに従っ
て作成していたが、ヒープメモリの解放もれ(メモリリ
ーク)や多重解放などの誤りが絶えなかった。本I/F
を採用することによりヒープメモリ解放の手順が厳密化
され、その処理をライブラリ化して解放手順を共通化す
ることにより、信頼性を高めることが可能である。また
逆に、ヒープメモリ管理を指定しないことで、ヒープメ
モリ以外(静的メモリ)を使用することもできる。さら
に、ヒープメモリ管理の動的制御は、送信側のタスクが
メモリ管理の方法をその時点で判断し、必要に応じてメ
モリ管理の要・不要を選択することで実現する。 タスク間通信手順の標準化 ,で述べた通り、これまでのタスク間通信の設計に
あたっては、その都度(通信,I/F)マクロの選定、
同期制御の方法、ヒープメモリの制御方法などを予め取
り決める必要があったが、本I/Fを採用することで汎
用性を確保しながらタスク間通信を標準化することがで
きる。 ハンドラ→タスク間通信にも採用可能 本I/Fはタスク間通信ばかりでなく、ハンドラ→タス
ク間通信にも採用することが可能である。このことによ
り、タスク側にとってはマルチイベント(論理和)によ
る起動がハンドラによっても行えることになる。なお、
ここでハンドラとは、割込処理一般のことを言う。 移植性の高さと再利用性の高さ 近年プログラム開発はコンパイラを用いて行われること
が通常となっている。C言語を例に説明すると、C言語
のデータ構造記述方法の一つに「構造体(struct)」が
ある。この「構造体」で本I/Fを記述すると、アプリ
ケーションプログラムやライブラリから扱われる各項目
の並ぶ順序やデータの型や大きさは変更を必要としな
い。従って、設計者は基本的な項目を網羅している限
り、柔軟にI/F構造を設計でき、このことは、移植性
の高さと再利用性の高さを示している。 高信頼性と高生産性 で述べたことは、採用実績を蓄積することで使用実績
のある高信頼性のライブラリ/モジュールを作り上げる
ことに他ならず、このことは、多くのタスクの再利用を
容易にし、プログラミングの生産性を高めることにな
る。
As described above, according to the general-purpose communication method between tasks according to the present invention, it is understood that the following effects can be obtained. Flexible Synchronous Control Design Synchronous control is a critical issue in the design of real-time multitasking systems, and it is a part where design changes often occur during production and testing, but the I / F according to the present invention is adopted. By doing so, the specification of this part can be easily changed. For example, assuming that the sending side task and the receiving side task were originally designed without a synchronous response, if the specification is changed to wait for a synchronous response, the transmitting side task sets the mailbox ID for synchronization of this I / F. This is because the procedure / specification can be changed simply by performing. If a mailbox waiting for a synchronous response is set as the normal mailbox of the sending task, the task will be activated by the logical sum of the synchronous response wait and the normal event wait. On the other hand, if a mailbox that waits for a synchronization response is set as the synchronization mailbox for the sending task, strict synchronization control can be performed. In addition, the dynamic control of the synchronous control is realized by determining whether the task on the sending side specifies the mailbox waiting for the synchronous response at that time and selecting whether the synchronous control is necessary or not as necessary. To do. Strict heap memory management In the past, heap memory management decided how to acquire / release between tasks each time it was designed, and created according to it, but heap memory release (memory leak) and Errors such as multiple release were incessant. Book I / F
The procedure of releasing the heap memory becomes stricter by adopting, and the reliability can be improved by making the processing into a library and making the releasing procedure common. Conversely, by not specifying heap memory management, it is possible to use other than heap memory (static memory). Further, the dynamic control of the heap memory management is realized by the task on the transmission side judging the method of memory management at that time and selecting the necessity / unnecessity of the memory management as necessary. As mentioned in the standardization of inter-task communication procedure, when designing inter-task communication so far, each time (communication, I / F) macro selection,
Although it was necessary to negotiate in advance the method of synchronous control, the method of controlling heap memory, etc., by adopting this I / F, it is possible to standardize intertask communication while ensuring versatility. This interface can be used not only for inter-task communication but also for handler-to-task communication. As a result, on the task side, activation by multi-event (logical sum) can also be performed by the handler. In addition,
Here, the handler means general interrupt processing. High portability and high reusability In recent years, it has become common for program development to be performed using a compiler. Taking the C language as an example, there is a "struct" as one of the data structure description methods of the C language. When this I / F is described by this "structure", the order in which the items handled by the application program and the library are arranged, the type and size of the data do not need to be changed. Therefore, the designer can flexibly design the I / F structure as long as the basic items are covered, which shows high portability and high reusability. High reliability and high productivity is nothing but to build a highly reliable library / module that has a proven track record of use by accumulating a track record of adoption, which means that many tasks can be reused. It will facilitate and increase programming productivity.

【図面の簡単な説明】[Brief description of drawings]

【図1】同期制御を伴うタスク間通信例。FIG. 1 shows an example of inter-task communication with synchronous control.

【図2】同期制御を伴わないタスク間通信例。FIG. 2 is an example of communication between tasks without synchronous control.

【図3】同期制御とメモリ管理を伴わないハンドラ→タ
スク間通信例。
FIG. 3 shows an example of communication between a handler and a task without synchronous control and memory management.

【図4】受信要求を行うタスク間通信例。FIG. 4 is an example of communication between tasks that makes a reception request.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 石川 正浩 東京都八王子市元本郷町1丁目9番9号 中央電子株式会社内 Fターム(参考) 5B098 AA03 GA04 GC16 GD03 GD14   ─────────────────────────────────────────────────── ─── Continued front page    (72) Inventor Masahiro Ishikawa             1-9-9 Motomoto-cho, Hachioji-shi, Tokyo             Chuo Electronics Co., Ltd. F term (reference) 5B098 AA03 GA04 GC16 GD03 GD14

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 各種OSが提供するメッセージ又はメッ
セージアドレス通信機能のみを用いてタスク間通信を実
現すると共に、タスク間通信とインターフェースとを一
体のものとして設計し、同期通信の制御とヒープメモリ
管理とを行うようにしたことを特徴とするタスク間にお
ける汎用通信方法。
1. The inter-task communication is realized by using only the message or message address communication function provided by various OSs, and the inter-task communication and the interface are integrally designed to control the synchronous communication and the heap memory management. A general-purpose communication method between tasks, characterized in that
【請求項2】 同期通信の制御は送信側が指示するもの
とし、受信側は前記メッセージ又はメッセージアドレス
通信機能を用いて前記送信側からの指示に従って同期応
答を行うと共に、 同期通信の応答先および要・不要を指示する制御情報を
含むインターフェースにより、同期の要・不要、同期方
法および動的制御を実現するようにしたことを特徴とす
る請求項1に記載のタスク間における汎用通信方法。
2. The synchronous communication is controlled by the transmitting side, and the receiving side uses the message or message address communication function to make a synchronous response in accordance with the instruction from the transmitting side, and a synchronous communication response destination and a necessary point. The general-purpose communication method between tasks according to claim 1, wherein the necessity / non-necessity of synchronization, the synchronization method, and the dynamic control are realized by the interface including the control information indicating the unnecessary.
【請求項3】 ヒープメモリの管理は送信側が指示する
ものとし、取得と解放(返却)の指示によってヒープメ
モリ管理を行うと共に、 ヒープメモリ情報、および解放の要・不要を指示する制
御情報を含むインターフェースにより、ヒープメモリ管
理の要・不要、および動的制御を実現するようにしたこ
とを特徴とする請求項1に記載のタスク間における汎用
通信方法。
3. Heap memory management shall be instructed by the transmitting side, and heap memory management is performed by acquisition and release (return) instructions, and heap memory information and control information instructing whether release is necessary or not are also included. The general-purpose communication method between tasks according to claim 1, wherein heap memory management is required / not required and dynamic control is realized by an interface.
JP2001276720A 2001-09-12 2001-09-12 General communication method between task Pending JP2003084990A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001276720A JP2003084990A (en) 2001-09-12 2001-09-12 General communication method between task

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001276720A JP2003084990A (en) 2001-09-12 2001-09-12 General communication method between task

Publications (1)

Publication Number Publication Date
JP2003084990A true JP2003084990A (en) 2003-03-20

Family

ID=19101379

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001276720A Pending JP2003084990A (en) 2001-09-12 2001-09-12 General communication method between task

Country Status (1)

Country Link
JP (1) JP2003084990A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018106472A (en) * 2016-12-27 2018-07-05 日立オートモティブシステムズ株式会社 Control device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018106472A (en) * 2016-12-27 2018-07-05 日立オートモティブシステムズ株式会社 Control device
WO2018123707A1 (en) * 2016-12-27 2018-07-05 日立オートモティブシステムズ株式会社 Control device

Similar Documents

Publication Publication Date Title
US5903752A (en) Method and apparatus for embedding a real-time multi-tasking kernel in a non-real-time operating system
US5721922A (en) Embedding a real-time multi-tasking kernel in a non-real-time operating system
US20030086300A1 (en) FPGA coprocessing system
EP0490595B1 (en) Method for operating time critical processes in a window system environment
US6324684B1 (en) Processor having real-time execution control for debug functions without a debug monitor
US20050229184A1 (en) Inter-processor communication system in parallel processing system by OS for single processors and program thereof
US20010034751A1 (en) Real-time OS simulator
Gallmeister et al. Early experience with POSIX 1003.4 and POSIX 1003.4 a
JP3938343B2 (en) Task management system, program, and control method
JPH1021094A (en) Real-time control system
Bruyninckx Real-time and embedded guide
Skjellum et al. A thread taxonomy for MPI
JP2003084990A (en) General communication method between task
Sarolahti Real-time application interface
CN115617407A (en) Hardware driving method of embedded operating system
US7043565B1 (en) System and method for transferring data over an external transmission medium
EP0796466B1 (en) An improved method and apparatus for embedding a real-time multi-tasking kernel in a non-real-time operating system
Bulusu Asymmetric multiprocessing real time operating system on multicore platforms
Yao et al. System architecture and operating systems
Harbour Real-time POSIX: an overview
Dorst Using LabVIEW to create multithreaded VIs for maximum performance and reliability
JP2004094800A (en) Program simulation device and its method
Tsubota et al. MR3210 based on ITRON2 specification realtime os
Alkassar et al. Proving the correctness of client/server software
JP3547011B6 (en) Method and apparatus for performing time-critical processes in a window system environment

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050118

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050517

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050630

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20050726

A912 Removal of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A912

Effective date: 20050930