JPH0378034A - Program parallel execution device - Google Patents

Program parallel execution device

Info

Publication number
JPH0378034A
JPH0378034A JP21466789A JP21466789A JPH0378034A JP H0378034 A JPH0378034 A JP H0378034A JP 21466789 A JP21466789 A JP 21466789A JP 21466789 A JP21466789 A JP 21466789A JP H0378034 A JPH0378034 A JP H0378034A
Authority
JP
Japan
Prior art keywords
task
program
executed
stack
control table
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
JP21466789A
Other languages
Japanese (ja)
Inventor
Yoshinori Takahashi
義則 高橋
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to JP21466789A priority Critical patent/JPH0378034A/en
Publication of JPH0378034A publication Critical patent/JPH0378034A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To facilitate the parallel processing of a single-task operating system by saving registers in the dedicated area of a task when a program being executed is interrupted at a request from the task. CONSTITUTION:When the program being executed is interrupted at the request from the task 1, all registers of a task control table except the stack pointer 14 of the task 1 are saved in the stack area. Then the pointer register is saved in the stack pointer of another task of the control table. At this time, when the task 1 waits for an event, the corresponding task status 13 of the control table is disabled and necessary data are set to various other data 15. When the task 1 is executed, the pointer 14 of the control table is reloaded in a register and then other registers in the stack area are reloaded. Consequently, the parallel processing of the single-task operating system is facilitated.

Description

【発明の詳細な説明】[Detailed description of the invention]

[発明の技術分野J この発明は一般的にシングルタスクO3(オペレーティ
ングシステム)といわれているプログラムのもとで実行
するコンピュータ装置にお1)で、するものである、ま
た、本方式によるマルチタスクO8の構築に関するもの
である。 [発明の背景] 現在シングルタスクO8が広汎に使用されているが、そ
こで作成されるプログラムはその名の通り、直列に実行
されるものである。また、見かけは並列であるが一方は
他方が終了するまで実行できないものである。さらに、
本O8を用いて並行的に動作させるものもあるが、ジョ
ブ単位での切り替わりであり、限定されたイベントしか
取り扱えない、これらは何れも、本発明のようにリアル
タイムモニタの思想を組み込み、全イベントを有機的に
組み合わせ並行に、かつ効率よくプログラムを動作させ
るものではない。 また、本発明より動車的なリアルタイム性を備えたモニ
タプログラムは数多くあるが独自の環境下に入るなど、
リアルタイム性をそれほど必要としないプログラム開発
には使いにくいものである。 [発明の目的] それ故、この発明の目的は、ユーザの使いなれたシング
ルタスクOSコンピュータ装置内で、それほどリアルタ
イム性を必要としないが並行動作をさせたいときに、簡
単に並行処理−マルチタスク処理−を構成できる装置を
提供することにある。 [発明の構成および効果] 本発明は従来のリアルタイム型モニタの基本機能−プロ
グラムの中断、イベントの検出、タスクスケジュール、
プログラムの実行再開など−を有しているが、そのイベ
ントの検出をシングルタスクO8下でも可能なように走
査ループとしたものである。 実行中のプログラムの中断は、本モニタに関する部分に
ついてはタスクからの要求にもとづいて行われ、そのタ
スクの状態、つまりレジスターをそのタスクの専用エリ
アに退避することにより行われる。再開はそのタスクの
専用エリアのデータを復元することにより行う、タスク
の最初の実行開始はタスクの開始点を中断点とみなして
行うのが簡単である。イベントの検出はデータが入力さ
れたか、又出力されたかなど、各イベントに対応した調
査を全イベントについて走査ループで調べて、タスクが
次の処理を再開するための条件が発生していれば、その
タスクを実行可能状態とする。 タスクスケジュールはタスクの管理テーブルを調べて、
実行可能であるタスクを選択する。実行可能のタスクが
いくつかある時は通常優先レベルの高いものを選択する
。 また、あるタスクの処理が長くなる場合はタスクからの
要求により、あるいはある一定時間の処理をした後に、
本タスクの実行を中断して、池の優先度の高いタスクの
処理を行わせることが出来る。 さらに、緊急を要するときは従来のリアルタイム方式、
つまり、割り込み発生でイベントを検出して、割り込み
処理で問題となる資源の排他制御を行った後に、処理が
可能であれば、その割り込み処理を行うことによりリア
ルタイムでの応答も可能となる。なお、排他制御を必要
としないときは、リアルタイム方式と同様に直ちに応答
が出来る。 また、これにプログラムのローディング機能とジョブス
ケジュール機能を付加すればマルチジョブ・マルチタス
クのシステムが構成できる。 効果としては (1)  簡単にシングルタスクO8下で並行処理が構
築できる。並行処理により効率のよいプログラムとなる
。また、並行処理でないと使いものにならないときもあ
る。 (2) 通常の割り込み処理はシングルタスクO8が管
理しているので並行処理にともなうプログラムバグが発
生しにくい。 (3) 使いなれたO5環境下なので、プログラム開発
の向上がはかれる。
[Technical Field of the Invention J This invention is directed to a computer device running under a program generally referred to as a single-task O3 (operating system). Concerning the construction of O8. [Background of the Invention] Currently, single task O8 is widely used, and as the name suggests, the programs created there are executed in series. Also, although they appear to be parallel, one cannot be executed until the other finishes. moreover,
There are some that use this O8 to operate in parallel, but they are switched on a job-by-job basis and can only handle limited events. It is not possible to organically combine and run a program in parallel and efficiently. In addition, there are many monitor programs that have more dynamic real-time performance than the present invention, but they operate under unique environments.
It is difficult to use for program development that does not require real-time performance. [Object of the Invention] Therefore, an object of the present invention is to easily implement parallel processing-multitasking when a user wants to perform parallel operations even though real-time performance is not required in a single-task OS computer device that is familiar to the user. The object of the present invention is to provide a device that can configure processing. [Configuration and Effects of the Invention] The present invention provides basic functions of conventional real-time monitors - program interruption, event detection, task scheduling,
Although the system has functions such as resuming program execution, a scanning loop is used to detect the event even under a single task O8. The portion of the program that is being executed is interrupted based on a request from a task, and is done by saving the state of the task, that is, the register, to an area dedicated to that task. Resuming is performed by restoring the data in the dedicated area for that task. It is easy to start executing a task for the first time by regarding the start point of the task as the interruption point. Event detection involves checking for each event, such as whether data has been input or output, using a scanning loop for all events, and if a condition has occurred for the task to resume the next process. Make the task executable. To schedule a task, check the task management table and
Select tasks that are executable. When there are several tasks that can be executed, the one with the highest priority level is usually selected. Also, if the processing of a certain task takes a long time, either by request from the task or after processing for a certain period of time,
Execution of this task can be interrupted to allow processing of tasks with higher priority in the pond. Furthermore, when an emergency is required, the conventional real-time method,
In other words, after detecting an event when an interrupt occurs and performing exclusive control of the resources that are problematic in interrupt processing, if processing is possible, it is possible to respond in real time by processing the interrupt. Note that when exclusive control is not required, an immediate response can be made as in the real-time method. Additionally, by adding a program loading function and a job scheduling function to this, a multi-job/multi-tasking system can be configured. The effects are (1) Parallel processing can be easily constructed under single task O8. Parallel processing makes the program more efficient. Also, there are times when it is useless without parallel processing. (2) Since normal interrupt processing is managed by the single task O8, program bugs associated with parallel processing are less likely to occur. (3) Since it is in the familiar O5 environment, program development can be improved.

【実施例の説明】[Explanation of Examples]

この発明の一実施例を図面に基づいて説明する。 説明は、まず第3図、4図のデータから行い、その後第
1図、2図のプログラムについて行う、ここでは、並行
処理を行うプログラムをすべてタスクと記述している。 第3図はタスク管理テーブルであり、1つのタスクにつ
いてタスクステータス13とスタックポインタ14及び
その他各種データ15があり、タスク単位に用意されて
いる。ここではn個のタスクがあるものとする。なお本
チーグルは優先レベルの高いものから順番に並べられて
いる。タスクステータス13はタスクの実行の可否の状
態を記憶している。′0′は実行不可をあられし、′1
′は実行可とする。スタックポインタ14はタスクの中
断が発生したとき、レジスタ値をスタックにしまいこん
だ後のスタックポインタの値を保存したものである。そ
の池各種データ15はタスクがタイムアツプ侍で中断し
たときのタイムカウント値、入出力完了待の時の入出カ
イベントとタスクの対応データやタスクの実行経過時間
などがある。 第4図はスタックであり、各タスクに個別に割り当てら
れている0個数はタスク数と同様にn個である。なおこ
の図ではスタックの成長方向は上方としてしする。既使
用エリア18は中断が発生する直前までタスクで使用さ
れていたエリアである。 レジスタ退避エリア17は中断が発生したときに同タス
クのスタックポインタを除く全レジスタを退避するエリ
アである。未使用エリア16は、スタックの残りの未使
用エリアである。 第1図と第2図はプログラムのフローチャートである。 第1図の処理1.2は次に実行すべきタスクを選択する
部分である。ここでは、タスク管理テーブルのタスク1
からタスクnまで順にタスクステータスを調べて、実行
可であれば処理8へ分岐する。すべて実行不可であれば
処理3へ移る。 処理3〜7がイベントを走査により検出して対応するイ
ベントの処理を行う部分である。イベント数はm個ある
ものとする。イベント1(1≦1≦m)に対して、イベ
ント1の発生処理ではタスクj(1≦j≦n)を実行可
とする処理を含んでいる。実行可とはすなわち該当タス
クのタスク管理テーブルのタスクステータス1を′1′
にすることである。タスクjの選択は明示的に行うこと
もできるし、中断処理11で間接的に示されることもあ
る。この情報はその他各種データ15に記憶されている
。処理7は、イベントの発生処理でタスクを実行可とし
た場合は処理1へ分岐し、そうでないときは再び走査を
行うために処理3へ分岐するための判断を行う部分であ
る。処理8はタスクの中断点からの再開部分である。実
行に移すタスクのタスク管理テーブルのスタックポイン
タ値をスタックポインタレジスタに復旧した後、スタッ
クエリアから他のレジスタをプログラムカウンタを最後
にして復旧する。この時点でタスクの実行が再開される
。 第2図は中断をした時のフローチャートである。 処理9ではスタックポインタを除く全レジスタをスタッ
クエリアに退避する。再開にあわせて、プログラムカウ
ンタを最初に退避しておく。処理10ではこの時点のス
タックポインタレジスタをタスク管理テーブルの対応す
るタスクのスタックポインタ2へ退避する。処理11の
中断処理はタスクからの要求によりさまざまであるが、
時間待ち、入出力待ちや他のタスクの起動などがある。 このとき、該当タスクがイベント待になるときは、対応
するタスク管理テーブルのタスクステータス1を′o′
にする。そして、必要なデータをその池各種データ3に
セットする。この後、処理12により、第1図の処理を
行うことになる。
An embodiment of the present invention will be described based on the drawings. The explanation will first be given to the data shown in FIGS. 3 and 4, and then to the programs shown in FIGS. 1 and 2. Here, all programs that perform parallel processing are described as tasks. FIG. 3 is a task management table, in which there is a task status 13, a stack pointer 14, and various other data 15 for one task, which are prepared for each task. Here, it is assumed that there are n tasks. The Cheagles are arranged in descending order of priority level. The task status 13 stores the status of whether a task can be executed. '0' means not executable, '1'
' is executable. The stack pointer 14 stores the value of the stack pointer after the register value is stored in the stack when a task is interrupted. The various data 15 include a time count value when a task is interrupted due to a time-up, correspondence data between an input/output event and a task when waiting for input/output completion, and elapsed execution time of the task. FIG. 4 shows a stack, and the number of 0s individually assigned to each task is n, which is the same as the number of tasks. In this figure, the growth direction of the stack is assumed to be upward. The used area 18 is an area that was used by a task immediately before the interruption occurred. The register save area 17 is an area where all registers except the stack pointer of the task are saved when an interruption occurs. Unused area 16 is the remaining unused area of the stack. 1 and 2 are flowcharts of the program. Process 1.2 in FIG. 1 is the part that selects the task to be executed next. Here, task 1 of the task management table
The task status is checked in order from task n to task n, and if the task is executable, the process branches to process 8. If all cannot be executed, the process moves to process 3. Processes 3 to 7 are parts for detecting events by scanning and processing the corresponding events. It is assumed that the number of events is m. For event 1 (1≦1≦m), the event 1 generation process includes a process of making task j (1≦j≦n) executable. Executable means that task status 1 in the task management table of the relevant task is '1'.
It is to do so. The selection of task j can be done explicitly, or it can be indicated indirectly in the interruption process 11. This information is stored in other various data 15. Process 7 is a part that makes a decision to branch to process 1 if the task is executable in the event generation process, and to branch to process 3 if not to perform scanning again. Process 8 is the part where the task is restarted from the interruption point. After restoring the stack pointer value of the task management table of the task to be executed to the stack pointer register, other registers are restored from the stack area starting with the program counter. At this point, task execution resumes. FIG. 2 is a flowchart when the process is interrupted. In process 9, all registers except the stack pointer are saved to the stack area. When restarting, first save the program counter. In process 10, the stack pointer register at this point is saved to the stack pointer 2 of the corresponding task in the task management table. The interruption process in process 11 varies depending on the request from the task.
These include waiting for time, waiting for input/output, and starting other tasks. At this time, when the corresponding task is waiting for an event, the task status 1 of the corresponding task management table is set to 'o'.
Make it. Then, the necessary data is set in the pond various data 3. Thereafter, in process 12, the process shown in FIG. 1 is performed.

【図面の簡単な説明】 第1図は実行可能タスクの選択、イベントを検出するた
めの走査部及び実行の再開部分のフローチャートである
。 第2図は中断するときのフローチャートである。 第3図はタスク管理テーブルである。 第4図はスタックエリアの構成を示したものである。 「
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flowchart of the selection of executable tasks, the scanning section for detecting events, and the resumption of execution section. FIG. 2 is a flowchart when interrupting. FIG. 3 is a task management table. FIG. 4 shows the configuration of the stack area. "

Claims (1)

【特許請求の範囲】 コンピュータ装置において、 実行中のプログラムを中断する手段、 コンピュータ装置の内部または外部から自動的または手
動により発生するイベントを走査により検出する手段、 検出したイベントから、対応するプログラムを実行可能
とする手段、 次に実行すべきプログラムを選択する手段、中断したプ
ログラムの中断点からの実行再開手段とを備えて、プロ
グラムの並行実行を行うことを特徴とするプログラム並
行実行装置。
[Claims] In a computer device, means for interrupting a program being executed; means for detecting, by scanning, an event that occurs automatically or manually from inside or outside the computer device; and a means for detecting a corresponding program from the detected event. What is claimed is: 1. A program parallel execution device that executes programs in parallel, comprising means for making the program executable, means for selecting a program to be executed next, and means for resuming execution of the interrupted program from the point of interruption.
JP21466789A 1989-08-21 1989-08-21 Program parallel execution device Pending JPH0378034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21466789A JPH0378034A (en) 1989-08-21 1989-08-21 Program parallel execution device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21466789A JPH0378034A (en) 1989-08-21 1989-08-21 Program parallel execution device

Publications (1)

Publication Number Publication Date
JPH0378034A true JPH0378034A (en) 1991-04-03

Family

ID=16659574

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21466789A Pending JPH0378034A (en) 1989-08-21 1989-08-21 Program parallel execution device

Country Status (1)

Country Link
JP (1) JPH0378034A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6968552B2 (en) 2000-12-20 2005-11-22 Denso Corporation Processor unit for executing event process in real time in response to occurrence of event
JP2006155225A (en) * 2004-11-29 2006-06-15 Kyocera Corp Cellular phone terminal, method of managing task, and computer program thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6968552B2 (en) 2000-12-20 2005-11-22 Denso Corporation Processor unit for executing event process in real time in response to occurrence of event
JP2006155225A (en) * 2004-11-29 2006-06-15 Kyocera Corp Cellular phone terminal, method of managing task, and computer program thereof
JP4606857B2 (en) * 2004-11-29 2011-01-05 京セラ株式会社 Mobile phone terminal, task management method and computer program therefor

Similar Documents

Publication Publication Date Title
US6330583B1 (en) Computer network of interactive multitasking computers for parallel processing of network subtasks concurrently with local tasks
EP2431876B1 (en) Method and device for exception handling in embedded system
EP1031924B1 (en) Computer executing multiple operating system
US8327368B2 (en) Managing execution of mixed workloads in a simultaneous multi-threaded (SMT) enabled system
KR950009688B1 (en) Battery operated computer operable under a plurality of operating systems
US5257372A (en) Methods for efficient distribution of parallel tasks to slave processes in a multiprocessing system
US6324684B1 (en) Processor having real-time execution control for debug functions without a debug monitor
US20010034751A1 (en) Real-time OS simulator
JPH06250853A (en) Management method and system for process scheduling
JPH07311749A (en) Multiprocessor system and kernel substituting method
JP2002014841A (en) Debugger kernel system
JPH0378034A (en) Program parallel execution device
JP5678347B2 (en) IT system configuration method, computer program thereof, and IT system
US20100107169A1 (en) Periodical task execution apparatus, periodical task execution method, and storage medium
JPH08272755A (en) Process switching device
JPH11184828A (en) Test system for multiprocessor system
JPH064318A (en) Error detecting system
JPH06149615A (en) Event recording system
JPH05165652A (en) Task switching control method
JP2001229038A (en) Multi-operating computer system
JP3022398B2 (en) Virtual computer system
JP2003337711A (en) Information processor and method
KR100455623B1 (en) Method for Processing of Endless Loop Task in Multi Tasking Operating System
JP3075359B2 (en) Program debugging start processing method
JPH05324416A (en) System error history saving system