JP2003067199A - Application program - Google Patents

Application program

Info

Publication number
JP2003067199A
JP2003067199A JP2001257213A JP2001257213A JP2003067199A JP 2003067199 A JP2003067199 A JP 2003067199A JP 2001257213 A JP2001257213 A JP 2001257213A JP 2001257213 A JP2001257213 A JP 2001257213A JP 2003067199 A JP2003067199 A JP 2003067199A
Authority
JP
Japan
Prior art keywords
task
execution right
right message
tasks
function
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
JP2001257213A
Other languages
Japanese (ja)
Inventor
Hiroki Taniguchi
裕樹 谷口
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.)
Toyo Communication Equipment Co Ltd
Original Assignee
Toyo Communication Equipment 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 Toyo Communication Equipment Co Ltd filed Critical Toyo Communication Equipment Co Ltd
Priority to JP2001257213A priority Critical patent/JP2003067199A/en
Publication of JP2003067199A publication Critical patent/JP2003067199A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an application program capable of developing a program without being limited by a task switching function of OS. SOLUTION: This application program is provided with a plurality of tasks 100, 102, 104 and a task switching function 106. An execution right message is transmitted and received to and from the tasks 100, 102, 104, and only the task receiving the execution right message executes the processing. The task completing the processing selects the next task to be executed in cooperation with the task switching function 106 to transmit an execution right message, and is in the standby state until it next receives the execution right message.

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、複数のタスクを含
むアプリケーションプログラムに関する。 【0002】 【従来の技術】従来より、OS(Operation System)上
では、例えばブラウザを介してデータをダウンロードし
ながらワードプロセッサで文章を作成するというよう
に、複数のタスクを同時に実行することが可能である。
このような場合には、CPUは、図4に示したように、
例えばワードプロセッサ(図ではワープロと略す)、メ
ール、表計算、ブラウザといった順に、シリアルに各タ
スクを処理するのが一般的である。これらのタスクの切
替(割り当て)は、OSによって行われる。 【0003】図5は、タスク切替の基本概念を説明する
ための図である。OS500は、タスク504,50
6,508,510を管理するためのタスク管理テーブ
ル502を有しており、このタスク管理テーブル502
に従って、一つのタスク(図5の例ではタスク506)
に実行権を付与する。又、OS500は、タスク506
の処理が完了したのち、タスク506に実行中止を命
じ、次いで、タスク管理テーブル502に従って、他の
タスク(図5の例ではタスク508)に実行権を付与す
る。このようにしてマルチタスクが実現されている。 【0004】 【発明が解決しようとする課題】ところで、このような
OSによるタスク切替には、以下のような問題がある。
すなわち、OSのタスク切替機能は、OSの種類毎に異
なり、アプリケーション開発者が自由にタスク切替を行
うことを制限しているOSも存在する。そのため、アプ
リケーション開発者は、同じアプリケーションプログラ
ムであっても、OSの種類毎に別々にプログラム開発を
行う必要がある。 【0005】又、複数のタスクが連携して1つの処理を
実行するような場合、OSのタスク切替機能にタスク切
替を任せてしまうと、所定の機能が実現できない場合が
ある。例えば、通信装置(携帯電話など)に組み込まれ
る通信プロトコル制御プログラムでは、通信プロトコル
制御プログラムを複数のタスクにより実現した場合、各
タスクの実行順と実行時間を厳密に管理することが好ま
しい。このような厳密な実行順・実行時間の管理を行う
ためにはリアルタイムOS(リアルタイムLINUX
(R)等)と呼ばれるOSを用いることになる。しか
し、このリアルタイムOSにも様々な種類があり、CP
Uなどのハードウェアの条件や実現したい機能との関係
で、OSの使い分けが必要となる。ところが、OSによ
ってタスク切替機能が全く異なるため、全く同じ通信プ
ロトコルを実現する場合でも、OS別に異なるプログラ
ムを開発しなければならない。又、ハードウェアの制限
からリアルタイムOSのような高度なOSを採用できな
い場合もあり、このようなときはプログラミングが極め
て煩雑となっていた。 【0006】従って本発明は、OSのタスク切替機能に
制約されずにプログラム開発を行うことを可能にするア
プリケーションプログラムを提供することを目的とす
る。 【0007】 【課題を解決するための手段】上記目的を達成するた
め、本発明のアプリケーションプログラムは、それぞれ
所定の処理を実行するための複数のタスクと、前記複数
のタスクの切替のためのタスク切替部と、を備えたアプ
リケーションプログラムであって、前記複数のタスクの
間で実行権メッセージの送受信を行うと共に、前記実行
権メッセージを受信したタスクのみが処理を実行し、前
記処理を所定時間実行した後又は前記処理を完了した後
に、前記タスク切替部と協働して次に実行すべきタスク
を選択して当該タスクに前記実行権メッセージを送信
し、そののち実行権メッセージを受信するまで待機状態
となることを特徴とする。 【0008】このようにすれば、タスク間の実行権メッ
セージの送受信を介して各タスクが順次処理を実行する
ことができるので、OSのタスク切替機能に依存せずに
タスクの切替を行うことができる。 【0009】 【発明の実施の形態】以下、図示した一実施形態に基い
て本発明を詳細に説明する。図1は、本実施の形態に係
るアプリケーションプログラムの基本構造を示す図であ
る。本実施の形態に係るアプリケーションプログラム
は、磁気記録媒体などの記録媒体(図示せず)に記録さ
れている。このアプリケーションプログラムは、コンピ
ュータにおいてOS130上で実行されるものであり、
それぞれ所定の処理を行うための親タスク100、子タ
スク102及び子タスク104を備えている。このアプ
リケーションプログラムは、更に、タスク100,10
2,104の切替を行うためのタスク切替機能106を
有している。このタスク切替機能106は、各タスク1
00,102,104を管理するための、メモリ等のリ
ソース内に構築されたタスク管理テーブル108を有し
ている。本実施の形態では、各タスク100,102,
104の間で、一つのタスクに実行権を付与するための
実行権メッセージが送受信されるようになっている。 【0010】各タスク100,102,104は、実行
権メッセージ受信機能110、処理機能112、スケジ
ューリング機能114及び実行権メッセージ送信機能1
16を有している。実行権メッセージ受信機能110
は、他のタスクから送信された実行権メッセージを受信
する機能である。処理機能112は、タスク自らの処理
を実行する機能であり、実行権メッセージ受信機能11
0における実行権メッセージの受信により処理の実行が
可能になる。すなわち、実行権メッセージにより実行権
を付与されたタスクのみが処理を実行し、その他のタス
クは実行権メッセージ受信待ちで停止しているようにな
っている。スケジューリング機能114は、タスク管理
テーブル108に登録されているタスクの中から任意の
スケジュールアルゴリズム(例えば、ラウンドロビン)
に基づき、次に実行すべきタスクを決定するものであ
る。実行権メッセージ送信機能116は、スケジューリ
ング機能114により決定されたタスクに、実行権メッ
セージを送信する機能である。尚、実行権メッセージ受
信機能110及び実行権メッセージ送信機能116によ
る実効権メッセージの送受信は、共有メモリ等を経由し
て行う。 【0011】一例として、例えばOSとしてUNIX
(R)を利用する場合には、タスク管理テーブル108
ではプロセスIDを管理するようにし、実行権メッセー
ジ受信機能110及び送信機能116はメッセージキュ
ー、FIFO及び共有メモリなどを介して実行権メッセ
ージの送受信を行う。 【0012】次に、本実施の形態に係るアプリケーショ
ンプログラムにおけるタスクの切替について、図2を参
照して説明する。図2に示した例では、現在、親タスク
100に実行権が付与されているため、この実行権を付
与された親タスク100が処理を実行する。親タスク1
00は、処理を完了した後(又は、処理を所定時間だけ
実行した後)、スケジューリング機能114により、O
S130を介してタスク管理テーブル108にアクセス
し、所定のスケジュールアルゴリズムを実行して次に実
行すべきタスク(例えば子タスク102)を決定し、タ
スク管理テーブル108を更新する。次いで、親タスク
100は、実行権メッセージ送信機能116により、O
S130のメッセンジャーキューを利用して、タスク管
理テーブル108により決定された子タスク102に実
行権メッセージ120を送信する。実行権メッセージ1
20を送信した親タスク100は、次に実行権メッセー
ジ120を受信するまで待機状態となる。尚、スケジュ
ーリング機能114により再ぴ自ら(親タスク100)
に実行権が付与される場合、実行権メッセージは送信せ
ずに、自らの処理を実行する。子タスク102は、OS
130を介して実行権メッセージ120を受信すると、
自らの処理を実行する。このプロセスを繰り返すことに
より、各タスク100,102,104の切替が行われ
る。 【0013】尚、OS130は、アプリケーションプロ
グラムとは別にタスク切替を行っている。そのため、各
タスク100,102,104は、図3に模式的に示し
たように、他のタスクから送信された実行権メッセージ
120により実行権を付与された状態で、更に、OS1
30から実行権を付与されているときに、自らの処理を
実行するようになっている。尚、図3では、子タスク1
02は「子1」又は「子タスク1」と表示し、子タスク
104は「子2」と表示している。 【0014】以上説明したように、本実施の形態によれ
ば、実行権メッセージを受信したタスクのみが処理を実
行し、実行後にタスク管理テーブルに従って実行権メッ
セージが送信するようにしたので、OSのタスク切替機
能に依存せず、アプリケーションのレベルでタスクの切
替を行うことが可能になる。これにより、アプリケーシ
ョン開発者は、OSのタスク切替機能に制約されずにプ
ログラム開発を行うことができる。 【0015】以上、本発明の一実施形態を図面に沿って
説明した。しかしながら本発明は前記実施形態に示した
事項に限定されず、特許請求の範囲の記載に基いてその
変更、改良等が可能であることは明らかである。 【0016】 【発明の効果】以上の如く本発明によれば、タスク間の
実行権メッセージの送受信を介して各タスクが順次処理
を実行することができるので、OSのタスク切替機能に
依存せずにタスクの切替を行うことができる。これによ
り、OSのタスク切替機能に制約されずにプログラム開
発を行うことが可能になる。
Description: BACKGROUND OF THE INVENTION [0001] 1. Field of the Invention [0002] The present invention relates to an application program including a plurality of tasks. 2. Description of the Related Art Conventionally, a plurality of tasks can be simultaneously executed on an OS (Operation System), for example, by creating a sentence with a word processor while downloading data via a browser. is there.
In such a case, the CPU, as shown in FIG.
For example, each task is generally processed serially in the order of a word processor (abbreviated as word processor in the figure), mail, spreadsheet, browser, and the like. Switching (assignment) of these tasks is performed by the OS. FIG. 5 is a diagram for explaining the basic concept of task switching. The OS 500 performs tasks 504 and 50
6, 508 and 510 for managing the task management table 502.
, One task (task 506 in the example of FIG. 5)
Grant execution rights to. Also, the OS 500 executes the task 506
Is completed, the task 506 is instructed to stop execution, and then, according to the task management table 502, an execution right is given to another task (task 508 in the example of FIG. 5). Multitasking is thus realized. [0004] Task switching by the OS has the following problems.
That is, the task switching function of the OS differs for each type of OS, and there is also an OS that restricts an application developer from freely switching tasks. Therefore, even if the application program is the same, it is necessary for the application developer to develop the program separately for each type of OS. In a case where a plurality of tasks cooperate to execute one process, if the task switching function of the OS leaves task switching, a predetermined function may not be realized. For example, in a communication protocol control program incorporated in a communication device (such as a mobile phone), when the communication protocol control program is implemented by a plurality of tasks, it is preferable to strictly manage the execution order and execution time of each task. In order to manage such a strict execution order and execution time, a real-time OS (real-time LINUX
(R) etc.) will be used. However, there are various types of this real-time OS, and CP
Depending on the conditions of hardware such as U and the functions to be realized, it is necessary to use the OS properly. However, since the task switching function is completely different depending on the OS, different programs must be developed for each OS even when the same communication protocol is realized. In some cases, an advanced OS such as a real-time OS cannot be adopted due to hardware limitations. In such a case, programming becomes extremely complicated. Accordingly, it is an object of the present invention to provide an application program which enables program development without being restricted by the task switching function of the OS. [0007] In order to achieve the above object, an application program of the present invention comprises a plurality of tasks for executing predetermined processing and a task for switching between the plurality of tasks. A switching unit for transmitting and receiving an execution right message between the plurality of tasks, and executing only the task that has received the execution right message, and executing the processing for a predetermined time. After performing or completing the process, in cooperation with the task switching unit, selects a task to be executed next, transmits the execution right message to the task, and then waits until the execution right message is received. State. [0010] According to this configuration, each task can sequentially execute processing through transmission and reception of an execution right message between tasks, so that task switching can be performed without depending on the task switching function of the OS. it can. The present invention will be described below in detail based on one embodiment shown in the drawings. FIG. 1 is a diagram showing a basic structure of an application program according to the present embodiment. The application program according to the present embodiment is recorded on a recording medium (not shown) such as a magnetic recording medium. This application program is executed on the OS 130 in the computer,
The system includes a parent task 100, a child task 102, and a child task 104 for performing predetermined processing. The application program further includes tasks 100 and 10
It has a task switching function 106 for switching between 2 and 104. This task switching function 106
It has a task management table 108 constructed in a resource such as a memory for managing 00, 102 and 104. In the present embodiment, each task 100, 102,
An execution right message for giving an execution right to one task is transmitted and received between 104. Each of the tasks 100, 102, and 104 includes an execution right message reception function 110, a processing function 112, a scheduling function 114, and an execution right message transmission function 1.
16. Execution right message receiving function 110
Is a function for receiving an execution right message transmitted from another task. The processing function 112 is a function for executing the processing of the task itself.
The execution of the process becomes possible by receiving the execution right message at 0. That is, only the task to which the execution right is given by the execution right message executes the process, and the other tasks are stopped waiting to receive the execution right message. The scheduling function 114 selects an arbitrary scheduling algorithm (for example, round robin) from the tasks registered in the task management table 108.
The task to be executed next is determined based on the The execution right message transmission function 116 is a function of transmitting an execution right message to the task determined by the scheduling function 114. The transmission and reception of the effective right message by the execution right message receiving function 110 and the execution right message transmitting function 116 are performed via a shared memory or the like. As an example, for example, UNIX as an OS
When (R) is used, the task management table 108
Then, the process ID is managed, and the execution right message receiving function 110 and the transmission function 116 transmit and receive the execution right message via a message queue, a FIFO, and a shared memory. Next, switching of tasks in the application program according to the present embodiment will be described with reference to FIG. In the example shown in FIG. 2, since the execution right is currently given to the parent task 100, the parent task 100 given this execution right executes the processing. Parent task 1
After the processing is completed (or after the processing is executed for a predetermined time), the scheduling function 114
The task management table 108 is accessed via S130, a predetermined schedule algorithm is executed to determine a task to be executed next (for example, the child task 102), and the task management table 108 is updated. Next, the parent task 100 sends the execution right message
The execution right message 120 is transmitted to the child task 102 determined by the task management table 108 using the messenger queue of S130. Execution right message 1
The parent task 100 that has transmitted 20 enters a standby state until the next execution right message 120 is received. Note that the scheduling function 114 re-executes itself (parent task 100).
When the execution right is given to the user, the device executes its own process without transmitting the execution right message. The child task 102 is the OS
Upon receiving the execution right message 120 via 130,
Perform your own processing. By repeating this process, the tasks 100, 102, and 104 are switched. The OS 130 performs task switching separately from the application program. Therefore, as shown schematically in FIG. 3, each of the tasks 100, 102, and 104 has the execution right given by the execution right message 120 transmitted from another task, and furthermore, the OS 1
When the execution right is granted from 30, the own processing is executed. Note that in FIG.
02 is displayed as “child 1” or “child task 1”, and the child task 104 is displayed as “child 2”. As described above, according to the present embodiment, only the task that has received the execution right message executes the process, and after execution, transmits the execution right message in accordance with the task management table. Task switching can be performed at the application level without depending on the task switching function. This allows the application developer to develop a program without being restricted by the task switching function of the OS. The embodiment of the present invention has been described with reference to the drawings. However, it is apparent that the present invention is not limited to the matters described in the above-described embodiment, and that changes, improvements, and the like can be made based on the description in the claims. As described above, according to the present invention, each task can sequentially execute processing through transmission / reception of an execution right message between tasks, and thus does not depend on the task switching function of the OS. Can switch tasks. This makes it possible to develop a program without being restricted by the task switching function of the OS.

【図面の簡単な説明】 【図1】本発明の一実施の形態に係るアプリケーション
プログラムの構造を示す図である。 【図2】図1に示したアプリケーションプログラムにお
けるタスクの切替方法を模式的に示した図である。 【図3】各タスクが実行する処理を模式的に示した図で
ある。 【図4】CPUが実行するシリアル処理を模式的に示し
た図である。 【図5】OSによるタスクの切替を模式的に示した図で
ある。 【符号の説明】 100 親タスク 102,104 子タスク 106 タスク切替機能 108 タスク管理テーブル 110 実行権メッセージ受信機能 112 処理機能 114 スケジューリング機能 116 実行権メッセージ送信機能 120 実行権メッセージ
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram showing a structure of an application program according to one embodiment of the present invention. FIG. 2 is a diagram schematically illustrating a task switching method in the application program illustrated in FIG. 1; FIG. 3 is a diagram schematically illustrating a process executed by each task. FIG. 4 is a diagram schematically illustrating a serial process executed by a CPU; FIG. 5 is a diagram schematically illustrating task switching by an OS. [Description of Signs] 100 Parent task 102, 104 Child task 106 Task switching function 108 Task management table 110 Execution right message reception function 112 Processing function 114 Scheduling function 116 Execution right message transmission function 120 Execution right message

Claims (1)

【特許請求の範囲】 【請求項1】 それぞれ所定の処理を実行するための複
数のタスクと、 前記複数のタスクの切替のためのタスク切替部と、を備
えたアプリケーションプログラムであって、 前記複数のタスクの間で実行権メッセージの送受信を行
うと共に、 前記実行権メッセージを受信したタスクのみが処理を実
行し、当該処理を所定時間実行した後又は当該処理を完
了した後に、前記タスク切替部と協働して次に実行すべ
きタスクを選択して当該タスクに前記実行権メッセージ
を送信し、実行権メッセージを受信するまで待機状態と
なることを特徴とするアプリケーションプログラム。
Claims 1. An application program comprising: a plurality of tasks for executing predetermined processes; and a task switching unit for switching the plurality of tasks. While performing the transmission and reception of the execution right message between the tasks, only the task that has received the execution right message executes the process, after performing the process for a predetermined time or after completing the process, the task switching unit and An application program which cooperates to select a next task to be executed, transmits the execution right message to the task, and waits until the execution right message is received.
JP2001257213A 2001-08-28 2001-08-28 Application program Pending JP2003067199A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001257213A JP2003067199A (en) 2001-08-28 2001-08-28 Application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001257213A JP2003067199A (en) 2001-08-28 2001-08-28 Application program

Publications (1)

Publication Number Publication Date
JP2003067199A true JP2003067199A (en) 2003-03-07

Family

ID=19084914

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001257213A Pending JP2003067199A (en) 2001-08-28 2001-08-28 Application program

Country Status (1)

Country Link
JP (1) JP2003067199A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007518169A (en) * 2004-01-14 2007-07-05 インターナショナル・ビジネス・マシーンズ・コーポレーション Maintaining application behavior within a sub-optimal grid environment
US8275881B2 (en) 2004-01-13 2012-09-25 International Business Machines Corporation Managing escalating resource needs within a grid environment
US8346591B2 (en) 2005-01-12 2013-01-01 International Business Machines Corporation Automating responses by grid providers to bid requests indicating criteria for a grid job
US8387058B2 (en) 2004-01-13 2013-02-26 International Business Machines Corporation Minimizing complex decisions to allocate additional resources to a job submitted to a grid environment
US8396757B2 (en) 2005-01-12 2013-03-12 International Business Machines Corporation Estimating future grid job costs by classifying grid jobs and storing results of processing grid job microcosms
US8583650B2 (en) 2005-01-06 2013-11-12 International Business Machines Corporation Automated management of software images for efficient resource node building within a grid environment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8275881B2 (en) 2004-01-13 2012-09-25 International Business Machines Corporation Managing escalating resource needs within a grid environment
US8387058B2 (en) 2004-01-13 2013-02-26 International Business Machines Corporation Minimizing complex decisions to allocate additional resources to a job submitted to a grid environment
JP2007518169A (en) * 2004-01-14 2007-07-05 インターナショナル・ビジネス・マシーンズ・コーポレーション Maintaining application behavior within a sub-optimal grid environment
US8136118B2 (en) 2004-01-14 2012-03-13 International Business Machines Corporation Maintaining application operations within a suboptimal grid environment
US8583650B2 (en) 2005-01-06 2013-11-12 International Business Machines Corporation Automated management of software images for efficient resource node building within a grid environment
US8346591B2 (en) 2005-01-12 2013-01-01 International Business Machines Corporation Automating responses by grid providers to bid requests indicating criteria for a grid job
US8396757B2 (en) 2005-01-12 2013-03-12 International Business Machines Corporation Estimating future grid job costs by classifying grid jobs and storing results of processing grid job microcosms

Similar Documents

Publication Publication Date Title
US9244816B2 (en) Application testing using sandboxes
US6272517B1 (en) Method and apparatus for sharing a time quantum
US5247671A (en) Scalable schedules for serial communications controller in data processing systems
JP5516398B2 (en) Multiprocessor system and method for sharing device between OS of multiprocessor system
JP2007519103A (en) Resource management in multiprocessor systems
US10908963B2 (en) Deterministic real time business application processing in a service-oriented architecture
US20010034751A1 (en) Real-time OS simulator
JP2005513644A (en) Method and system for performing operating system functions and electronic device
CN110413384B (en) Delay task processing method and device, storage medium and electronic equipment
CN107797848B (en) Process scheduling method and device and host equipment
US20090228895A1 (en) Method and system for polling network controllers
US5715474A (en) Simultaneous control of radio frequency modem in a multi-tasking system using a single session manager program with separate command queue for each application program
JP2009278641A (en) Data channel resource optimization for device in network
JP2011044165A (en) Scheduling of request in system
JP2004310298A (en) Information processing system, information processor, session management method, and program
US6795873B1 (en) Method and apparatus for a scheduling driver to implement a protocol utilizing time estimates for use with a device that does not generate interrupts
CN111147571A (en) Distributed task scheduling method, device, system, storage medium and electronic equipment
JP2003067199A (en) Application program
JPH10333925A (en) Autonomous agent architecture
CN112448977A (en) System, method, apparatus and computer readable medium for assigning tasks
US7418717B1 (en) Smart card framework
TWI815098B (en) Web request processing method, device, electronic device, and computer-readable recording medium with stored program
US7320044B1 (en) System, method, and computer program product for interrupt scheduling in processing communication
WO2022195826A1 (en) Intra-server delay control device, intra-server delay control method, and program
Labrosse Operating systems

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070402