JPH07120302B2 - Task debug method - Google Patents
Task debug methodInfo
- Publication number
- JPH07120302B2 JPH07120302B2 JP1123712A JP12371289A JPH07120302B2 JP H07120302 B2 JPH07120302 B2 JP H07120302B2 JP 1123712 A JP1123712 A JP 1123712A JP 12371289 A JP12371289 A JP 12371289A JP H07120302 B2 JPH07120302 B2 JP H07120302B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- state
- tasks
- control block
- debugger
- 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.)
- Expired - Fee Related
Links
Landscapes
- Debugging And Monitoring (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、多重プログラミング用オペレーティング・シ
ステムに関し、特にタスクデバッグ方式に関する。TECHNICAL FIELD The present invention relates to an operating system for multiple programming, and more particularly to a task debug system.
情報処理装置においてその情報の処理は、通常プログラ
ムによって行われる。プログラムは、情報を逐次に処理
する。しかし、一般にプログラムは全ての処理が互いに
関連しあい、逐次に処理される必要があるわけではな
い。プログラムを各処理ごとのモジュールに分割し、そ
れぞれを並行動作させて処理を行えば、処理速度は向上
する。The processing of the information in the information processing device is usually performed by a program. The program processes the information serially. However, in general, a program does not need to be sequentially processed because all processes are related to each other. The processing speed can be improved by dividing the program into modules for each processing and operating them in parallel.
このような考え方を「並行プログラミング」といい、各
処理に対応するプログラム・モジュールを「タスク」と
いう。これらのタスクは、オペレーティング・システム
(以下、OSと記す)によって管理される。OSは、タスク
の状態などを考慮してタスクを選択しCPUを割当ててゆ
く。タスクはそれぞれ並行して動作し、互いに同期をと
りデータを通信しながら処理を行ってゆく。Such an idea is called "concurrent programming", and program modules corresponding to each process are called "tasks". These tasks are managed by the operating system (hereinafter referred to as OS). The OS selects the task in consideration of the task status and allocates the CPU. The tasks operate in parallel and perform processing while synchronizing with each other and communicating data.
いま、次のようなOSを考える。Now consider the following OS.
OSのもとで動作するタスクは、第9図に示した状態遷移
を行うものとする。各状態は、次のような意味をもって
いる。It is assumed that the task operating under the OS performs the state transition shown in FIG. Each state has the following meanings.
・run…OSによってCPUが割当てられている状態。・ Run: CPU is allocated by OS.
・ready…全ての条件がそろい、処理の実行が可能な状
態。-Ready ... A condition in which all conditions are met and processing can be executed.
・wait…条件が成立するのを待っている状態。-Wait ... Waiting for the condition to be met.
OSは、タスクを第3図に示すようなタスク・コントロー
ル・ブロック(TCB:Task Control Block)によって管理
する。タスク・コントロール・ブロックには、OSがタス
クを管理する上で必要な、優先順位、タスクの状態など
の情報が格納されている。このタスク・コントロール・
ブロックは、第4図に示したように互いにリンクされて
いる。OSは、このリンクの先端と、最後のタスクのタス
ク・コントロール・ブロック・アドレスを持っている。
タスク・コントロール・ブロックは、自分の前と後のタ
スク・コントロール・ブロック・アドレスを持ってお
り、順番にたどってゆくことが可能である。リンクの先
頭のタスク・コントロール・ブロックには自分より前の
タスク・コントロール・ブロックが、リンクの最後のタ
スク・コントロール・ブロックには自分より後のタスク
・コントロール・ブロックが存在しないため、それらの
アドレスエリアには、「0」が入っている。The OS manages the task by a task control block (TCB) as shown in FIG. The task control block stores information necessary for the OS to manage tasks, such as priority and task status. This task control
The blocks are linked to each other as shown in FIG. The OS has the end of this link and the task control block address of the last task.
The task control block has the task control block address before and after itself, and it is possible to follow them in order. The task control blocks at the beginning of the link have no task control blocks before them, and the last task control block of the link has no task control blocks after them, so their addresses The area contains "0".
あるタスクが他のタスクに対する操作をOSに要求する
(システムコールの発行)場合は、タスクを指定する値
としてタスク・コントロール・ブロック・アドレスを指
定する。優先順位とは、OSがタスクを指定選択する基準
として各タスクに与えられているものである。OSは、
「ready」状態のタスクの中から一つを選択し、CPUを割
当てる。OSは、「ready」状態のタスクのうち最も優先
順位と高いタスクにCPUを割当てる。When a task requests the OS to operate on another task (issue a system call), specify the task control block address as the value that specifies the task. The priority order is given to each task as a criterion for the OS to specify and select the task. OS is
Select one of the tasks in "ready" state and allocate the CPU. The OS allocates the CPU to the task with the highest priority among the tasks in the “ready” state.
次に、このようなOSの管理下にあるタスクを動作を、第
10図を参照しながら説明する。Next, run the tasks under the control of such OS,
This will be described with reference to FIG.
簡単のために、タスクの数は2つとし、それぞれを「タ
スクA」「タスクB」と呼ぶ。これらのタスクは、それ
ぞれタスク・コントロール・ブロックTCB−A,タスク・
コントロール・ブロックTCB−Bによって管理される。
タスク・コントロール・ブロックはすでに説明したよう
に、互いにリンクされている。第5図は、この様子を示
したものである。タスクの優先順位は、 タスクA>タスクB の関係にある。これらのタスクの処理は、セマフォによ
り互いに排除しあいながらI/Oの入出力を行うものとす
る。セマフォとは、オランダのDijkstraによって考案さ
れたタスク間の同期をとるための機構である。主に、OS
が持つ資源のアクセスに関するタスク間の排他制御に用
いられる。このOSにおいては、OSの資源であるI/Oをア
クセスする際の排他制御に用いている。For the sake of simplicity, the number of tasks is two, and they are called “task A” and “task B”, respectively. These tasks are task control block TCB-A, task
Managed by control block TCB-B.
The task control blocks are linked to each other as already explained. FIG. 5 shows this state. The priority of tasks is such that task A> task B. The processing of these tasks is performed by inputting / outputting I / O while mutually excluding each other by a semaphore. A semaphore is a mechanism for synchronizing tasks devised by Dijkstra in the Netherlands. Mainly OS
It is used for exclusive control between tasks related to the access of resources owned by. In this OS, it is used for exclusive control when accessing I / O which is a resource of the OS.
セマフォは、タスクから直接操作することはできない。
タスクがセマフォを操作するには、システムコールの形
でOSに要求を出す。Semaphores cannot be operated directly from tasks.
To operate a semaphore, a task makes a request to the OS in the form of a system call.
まず、セマフォを要求するシステムコールは、「wai-se
m」である。このシステムコールにより、タスクはセマ
フォを獲得することができる。もし、セマフォが他のタ
スクに獲得されている場合は、このシステムコールを発
行したタスクは、第9図の状態遷移図に従い、「run」
状態から「wait」状態へ遷移する。First, the system call that requests the semaphore is "wai-se
m ”. This system call allows the task to acquire the semaphore. If the semaphore has been acquired by another task, the task that issued this system call will be "run" according to the state transition diagram in Figure 9.
Transition from state to "wait" state.
セマフォを返すシステムコールは、「sig-sem」であ
る。このシステムコールによりタスクは、獲得している
セマフォをOSに返す。この時、セマフォを獲得できずに
「wait」状態になっているタスクがあれば、この時点で
セマフォを獲得でき、「ready」状態へと遷移する。The system call that returns a semaphore is "sig-sem". This system call causes the task to return the acquired semaphore to the OS. At this time, if there is a task in the "wait" state where the semaphore cannot be acquired, the semaphore can be acquired at this point and the task transits to the "ready" state.
はじめに、2つのタスクは「ready」状態にある。優先
順位はタスクAの方が高いため、OSはタスクAにCPUを
割当てる(第10図の)。タスクAは、I/Oの入出力の
ため「wai-sem」システムコールによってセマフォを獲
得する。セマフォを獲得したタスクAは、I/Oとの同期
をとるために「wai-tsk」システムコールによって一定
時間「wait」状態に入る(第10図の)。First, the two tasks are in the "ready" state. Since task A has a higher priority, the OS assigns a CPU to task A (see FIG. 10). Task A acquires a semaphore by the "wai-sem" system call for I / O input / output. Task A, which has acquired the semaphore, enters the "wait" state for a certain period of time by the "wai-tsk" system call in order to synchronize with I / O (Fig. 10).
タスクAが「wait」状態に入ったことにより、OSはタス
クBにCPUを割当てる。タスクBは、タスクAと同時にI
/Oの入出力を行うために「wai-sem」システムコールを
発行する。しかし、セマフォは、すでにタスクAが獲得
しているために、タスクBは「wait」状態に遷移する
(第10図の)。2つのタスクが共に「wait」状態に入
ったことにより、CPUはタスクが割当てられていない状
態に入る(第10図の)。When task A enters the "wait" state, the OS allocates CPU to task B. Task B is at the same time as Task A
Issue the "wai-sem" system call to input / output I / O. However, since the semaphore has already been acquired by task A, task B transitions to the "wait" state (Fig. 10). Since both tasks entered the "wait" state, the CPU enters the task unassigned state (Fig. 10).
指定時間が経過するとタスクAは、「wait」状態から
「ready」状態へ遷移し、I/O処理を再開する(第10図の
)。I/O処理が完了すると、タスクAは「sig-sem」シ
ステムコールによって、獲得していたセマフォをOSへ返
す。返されたセマフォは、セマフォが獲得できずに「wa
it」状態に遷移したタスクBに与えられる。この時点で
タスクBは、「ready」状態へ遷移する(第10図の
)。しかし、タスクBはタスクAが「ready」状態で
あるため、CPUは割当てられない。タスクAでの処理が
進み、他の要因でタスクAが「wait」状態に遷移する
と、タスクBにCPUが割当てられる(第10図の)。When the specified time has elapsed, task A transits from the "wait" state to the "ready" state and resumes I / O processing (Fig. 10). When the I / O processing is completed, task A returns the acquired semaphore to the OS by the "sig-sem" system call. The semaphore returned is "wa
It is given to task B that has transitioned to the "it" state. At this point, task B transitions to the "ready" state (Fig. 10). However, since task A is in the "ready" state, task B cannot be assigned a CPU. When the processing in the task A progresses and the task A transits to the "wait" state due to other factors, the CPU is assigned to the task B (Fig. 10).
以上のように、2つのタスクは互いに排除しあいながら
処理を行う。As described above, the two tasks perform processing while mutually excluding each other.
次に、上記のタスクを同じOS上でタスクとして実現され
ているデバッガでデバッグすることを考えてみる。デバ
ッガとタスクA、タスクBの優先順位の関係は、次のと
おりである。Next, consider debugging the above task with a debugger that is realized as a task on the same OS. The relationship between the priority of the debugger and the tasks A and B is as follows.
デバッガ>タスクA>タスクB デバッグの方法は、ブレークポイントを用いる。ブレー
クポイントとは、タスク実行を停止させる時点のことで
ある。タスクがブレークポイントまで実行すると、「wa
it」状態にあるデバッガが起動され、タスクを「wait」
状態に遷移させることにより実現される。Debugger> Task A> Task B A breakpoint is used as a debugging method. A breakpoint is a point at which task execution is stopped. When the task runs to the breakpoint, "wa
The debugger in the "it" state is started and the task is "wait"
It is realized by transitioning to the state.
いま、ブレークポイントが、タスクAのセマフォ獲得動
作の前に設定されているものとする。この時のタスク
A、タスクBの動作を第11図を参照しながら説明する。
簡単のために、第11図では、デバッガの動作の図示は省
略してある。Now, it is assumed that the breakpoint is set before the semaphore acquisition operation of task A. The operations of task A and task B at this time will be described with reference to FIG.
For simplicity, the operation of the debugger is not shown in FIG.
先程と同様、2つのタスクは「ready」状態にある。デ
バッガはコマンドが入力されるまで「wait」状態であ
る。「ready」状態のタスクのうち、優先順位はタスク
Aの方が高いため、OSはタスクAにCPUを割当てる(第1
1図の)。タスクAがブレークポイントに達すると、
デバッガが起動される。デバッガは、タスクAを「wai
t」状態に遷移させる。タスクAが「wait」状態に遷移
したことにより、OSはタスクBにCPUを割当てる(第11
図の)。As before, the two tasks are in the "ready" state. The debugger is in "wait" state until a command is input. Among tasks in the “ready” state, task A has a higher priority, so the OS allocates CPU to task A (first
(Fig. 1). When task A reaches the breakpoint,
The debugger is started. The debugger calls task A "wai
transition to the "t" state. Due to the transition of task A to the "wait" state, the OS allocates CPU to task B (11th
(In the figure).
タスクBは、I/O入出力のため「wai-sem」システムコー
ルを発行する。タスクAはセマフォを獲得する前に「wa
it」状態に遷移したため、タスクBはセマフォを獲得す
ることができる(第11図の)。セマフォを獲得したタ
スクBは、I/Oとの同期をとるために「wai-tsk」システ
ムコールによって「wait」状態に入る(第11図の)。Task B issues a "wai-sem" system call for I / O input / output. Before task A acquires the semaphore, "wa
Since it transits to the “it” state, task B can acquire the semaphore (see FIG. 11). Task B, which has acquired the semaphore, enters the "wait" state by the "wai-tsk" system call in order to synchronize with the I / O (Fig. 11).
この時、実行継続のため、「wait」状態に遷移していた
タスクAは、デバッガによって「ready」状態に戻され
たとする。タスクBは「wait」状態であるから、OSはタ
スクAにCPUを割当てる(第11図の)。At this time, it is assumed that the task A, which has been in the "wait" state in order to continue execution, is returned to the "ready" state by the debugger. Since task B is in the "wait" state, the OS allocates CPU to task A (Fig. 11).
タスクAは「wai-sem」システムコールによってセマフ
ォを獲得しようとする。しかし、すでにタスクBがセマ
フォを獲得しているために、再び「wait」状態に遷移す
る(第11図の)。Task A tries to acquire a semaphore by the "wai-sem" system call. However, since task B has already acquired the semaphore, it transits to the "wait" state again (Fig. 11).
以上の動作説明で明らかなように、デバッグのためにタ
スクAを停止させた(「ready」状態にした)ことによ
り、タスクBがタスクAよりも先に処理を行うことにな
る。本来デバッグは、対象となるシステムに対して影響
を与えてはならないものである。しかし、従来の方式で
は、タスクの同期関係、実行順序というマルチタスク処
理において最低限守らなければならないことが崩れてい
る。このために、停止させたタスクの動作を継続する
と、他のタスクによって本来獲得できるはずの資源など
がないなどの状態になり、タスクの正常な処理が行われ
なくなったりする。また、タスクBがセマフォを獲得し
た後、タスクAから起動されるのを待つような構成にな
っていると、タスクAはセマフォが返却されるのを待
ち、タスクBはセマフォを持ったままタスクAからの起
動を待つというような状態に入ってしまう。このような
状態を「デッドロック」といい、2つのタスクは無限の
待ち状態に入ってしまう。As is clear from the above description of the operation, by stopping the task A (putting it in the “ready” state) for debugging, the task B executes the processing before the task A. By nature, debugging should not affect the target system. However, in the conventional method, the minimum relationship that must be observed in the multitask processing such as the task synchronization relationship and the execution order is broken. For this reason, if the stopped task continues to operate, it will be in a state in which there is no resource or the like that should be originally acquired by another task, and normal processing of the task will not be performed. If task B acquires the semaphore and then waits for activation from task A, task A waits for the semaphore to be returned, and task B holds the semaphore It will enter a state where it waits for activation from A. Such a state is called "deadlock", and two tasks enter an infinite waiting state.
本発明のタスクデバッグ方式は、多重プログラミング用
オペレーティング・システム上で動作するタスクの中か
ら複数個のタスクを指定する手段と、前記指定手段によ
って指定された複数個のタスクの制御ブロック内に前記
指定手段によって指定されたことを示す情報を格納する
手段と、任意のタスクが停止させられた時に前記停止し
たタスクの制御ブロック内の情報を検査する手段と、前
記検査手段によって検査されたタスクが前記指定手段に
よって指定されていた場合、前記タスクの実行を停止さ
せる手段を具備し、前記指定手段によって指定されたタ
スクの何れかのタスクが、実行を停止された場合、他の
指定されたタスクも同時に停止されるようにしたことを
特徴とする。According to the task debugging method of the present invention, a means for designating a plurality of tasks from among tasks operating on an operating system for multiple programming, and the designation in a control block of the plurality of tasks designated by the designating means. Means for storing information indicating that the task has been designated, means for inspecting information in the control block of the stopped task when an arbitrary task is stopped, and the task inspected by the inspecting means When designated by the designating means, means for stopping the execution of the task is provided, and when the execution of any of the tasks designated by the designating means is stopped, other designated tasks are also included. The feature is that they are stopped at the same time.
次に本発明の第1の実施例について図面を参照して説明
する。タスクの数、状態、ブレークポイントの位置など
の条件は、従来例の説明で用いたものと同じとする。Next, a first embodiment of the present invention will be described with reference to the drawings. The conditions such as the number of tasks, the state, and the position of the breakpoint are the same as those used in the description of the conventional example.
第1図は本発明の第1の実施例を示す。第1図は、第3
図に示したタスク・コントロール・ブロックのステータ
ス領域に相当している。第1図において、識別ビットに
「1」がセットされている場合、デバッガのブレークポ
イント処理においてそのタスクを「wait」状態に遷移さ
せる。FIG. 1 shows a first embodiment of the present invention. Figure 1 shows the third
It corresponds to the status area of the task control block shown in the figure. In FIG. 1, when the identification bit is set to "1", the task is transited to the "wait" state in the breakpoint processing of the debugger.
「0」がセットされている場合、デバッガは何もしな
い。第6図は、この実施例において、タスクがブレーク
ポイントに達した時のデバッガの処理フローを示す。第
8図は、この実施例および後述する第2の実施例による
タスクの動作を示す。If "0" is set, the debugger does nothing. FIG. 6 shows the processing flow of the debugger when the task reaches the breakpoint in this embodiment. FIG. 8 shows operation of tasks according to this embodiment and a second embodiment described later.
第5図は、各タスクのタスク・コントロール・ブロック
のリンクを示す。簡単のためにデバッガのタスク・コン
トロール・ブロックは、図示を省略してある。OSは、リ
ンクの先頭のタスクAのタスク・コントロール・ブロッ
ク・アドレスと、リンクの最後のタスクBのタスク・コ
ントロール・ブロック・アドレスを持っている。タスク
Aのタスク・コントロール・ブロックには、次のタスク
・コントロール・ブロック・アドレスとして、タスクB
のタスク・コントロール・ブロック・アドレスを入って
いる。前のタスク・コントロール・ブロック・アドレス
は、タスクAがリンクの先頭であるため、「0」であ
る。タスクBのタスク・コントロール・ブロックには、
前のタスク・コントロール・ブロック・アドレスとし
て、タスクAのタスク・コントロール・ブロック・アド
レスが入っている。次のタスク・コントロール・ブロッ
ク・アドレスは、タスクBがリンクの最後であるため、
「0」である。FIG. 5 shows the links of the task control blocks of each task. For simplicity, the task control block of the debugger is not shown. The OS has the task control block address of task A at the beginning of the link and the task control block address of task B at the end of the link. In the task control block of task A, the next task control block address is assigned to task B.
Contains the task control block address of the. The previous task control block address is "0" because task A is at the beginning of the link. In the task control block of task B,
The task control block address of task A is entered as the previous task control block address. The next task control block address is because task B is at the end of the link,
It is "0".
次に、この実施例の動作を第1図,第5図,第6図,第
8図を参照しながら説明する。Next, the operation of this embodiment will be described with reference to FIG. 1, FIG. 5, FIG. 6, and FIG.
いま、ブレークポイント到達時に停止させるグループに
タスクAとタスクBを指定したものとする。デバッガ
は、タスクAとタスクBを管理するタスク・コントロー
ル・ブロック内のステータスの識別ビットに「1」をセ
ットする。セットした後、デバッガは、「wait」状態に
遷移する。デバッガが「wait」状態に遷移したことによ
り、OSはタスクAにCPUを割当てる(第8図の)。Now, it is assumed that task A and task B are designated as the group to be stopped when the breakpoint is reached. The debugger sets "1" to the status identification bit in the task control block that manages task A and task B. After setting, the debugger transitions to the "wait" state. The OS assigns the CPU to task A when the debugger enters the "wait" state (Fig. 8).
タスクAがブレークポイントに達すると、デバッガが起
動される。デバッガは、ブレークポイントで停止したタ
スクAを「wait」状態に遷移させる。次に、タスクAの
タスク・コントロール・ブロックは「0」であるため、
タスクAは、リンクの先頭であることがわかる。次のタ
スク・コントロール・ブロック・アドレスは、タスクB
のタスク・コントロール・ブロック・アドレスである
(第6図の)。タスクBのタスク・コントロール・ブ
ロック内の識別フラグをチェックする(第6図の)。
タスクBの識別フラグには、上述したように予め「1」
がセットされている。したがって、デバッガはタスクB
を「wait」状態に遷移させる(第6図の、第8図の
)。次のタスクBのタスク・コントロール・ブロック
を参照し、次のタスク・コントロール・ブロック・アド
レスを得る。次のタスク・コントロール・ブロック・ア
ドレスは「0」であるため、タスクBがリンクの最後で
あることがわかる。したがって、全てのタスクのタスク
・コントロール・ブロックの参照が完了したことにな
り、ブレークポイント処理を終了する(第6図の)。When task A reaches the breakpoint, the debugger is launched. The debugger shifts the task A stopped at the breakpoint to the "wait" state. Next, since the task control block of task A is "0",
It can be seen that task A is at the beginning of the link. The next task control block address is task B
Is the task control block address (in FIG. 6). Check the identification flag in the task control block of task B (Fig. 6).
As described above, the identification flag of the task B is “1” in advance.
Is set. Therefore, the debugger is task B
To the “wait” state (FIG. 6, FIG. 8). The task control block of the next task B is referred to and the next task control block address is obtained. Since the next task control block address is "0", it can be seen that task B is at the end of the link. Therefore, the reference of the task control blocks of all the tasks is completed, and the breakpoint processing is ended (see FIG. 6).
以上の操作を行ない、デバッガは「wait」状態に入る。After performing the above operations, the debugger enters the "wait" state.
3つのタスク(デバッガ、タスクA、タスクB)が共に
「wait」状態に入ったことにより、CPUはタスクが割当
てられていない状態に入る(第8図の)。ここで、実
行継続の操作が行われたとする。デバッガはブレークポ
イントに達して「wait」状態に遷移させられたタスクA
を、「ready」状態にする。次に、先程と同様にしてタ
スク・コントロール・ブロック内の識別フラグを検索
し、「wait」状態に遷移させられていたタスクBを「re
ady」状態に戻す(第8図の)。デバッガは、上記の
操作を行った後「wait」状態に入る。Since all three tasks (debugger, task A, and task B) have entered the "wait" state, the CPU enters the state where no tasks have been assigned (Fig. 8). Here, it is assumed that the operation of continuing the execution is performed. Debugger reaches task A and is placed in "wait" state.
To "ready" state. Next, as in the previous step, the identification flag in the task control block is searched, and the task B that has been transited to the "wait" state is "re
Return to "ady" state (Fig. 8). The debugger enters the "wait" state after performing the above operations.
「ready」状態の2つのタスクのうち、タスクAの優先
順位がタスクBのそれよりも高いため、OSはタスクAに
CPUを割当てる(第8図の)。Of the two tasks in the “ready” state, task A has a higher priority than task B, so the OS assigns task A
Allocate CPU (Fig. 8).
以上のようにしてタスクAは、処理を再開する。Task A resumes processing as described above.
この実施例では、既存のタスク・コントロール・ブロッ
ク内の領域を使用することによって、テーブルのサイズ
を拡大することなく、グループ化を実現することも可能
である。In this embodiment, the grouping can be realized without increasing the size of the table by using the area in the existing task control block.
次に本発明の第2の実施例について図面を参照して説明
する。Next, a second embodiment of the present invention will be described with reference to the drawings.
第2図は本発明の第2の実施例におけるタスク・コント
ロール・ブロックを示す。第7図は、この実施例におい
て、タスクがブレークポイントに達した時のデバッガの
処理フローを示す。FIG. 2 shows a task control block in the second embodiment of the present invention. FIG. 7 shows the processing flow of the debugger when the task reaches the breakpoint in this embodiment.
次に、この実施例の動作を第2図,第5図,第6図,第
8図を参照しながら説明する。タスクの数、状態などの
条件は、第1の実施例の説明で用いたものと同じとす
る。Next, the operation of this embodiment will be described with reference to FIG. 2, FIG. 5, FIG. 6, and FIG. The conditions such as the number of tasks and the states are the same as those used in the description of the first embodiment.
いま、ブレークポイント到達時に停止させるグループに
タスクAとタスクBを指定したものとする。デバッガ
は、タスクAとタスクBを管理するタスク・コントロー
ル・ブロック内のグループIDに「1」をセットする。セ
ットした後、デバッガは、「wait」状態に遷移する。デ
バッガが「wait」状態に遷移したことにより、OSはタス
クAにCPUを割当てる(第8図の)。Now, it is assumed that task A and task B are designated as the group to be stopped when the breakpoint is reached. The debugger sets "1" to the group ID in the task control block that manages task A and task B. After setting, the debugger transitions to the "wait" state. The OS assigns the CPU to task A when the debugger enters the "wait" state (Fig. 8).
タスクAがブレークポイントに達すると、デバッガが起
動される。デバッガは、ブレークポイントで停止したタ
スクAを「wait」状態に遷移させる。ブレークポイント
で「wait」状態にしたタスクのタスク・コントロール・
ブロックから、ブループIDを得る(第7図の)。次
に、リンク領域(次のタスクまたは前のタスクのアドレ
スが入っている領域)を参照し、タスクBのタスク・コ
ントロール・ブロック・アドレスを得る(第7図の
)。タスクBのタスク・コントロール・ブロックから
グループIDを得る。先に得たタスクAのグループIDと比
較を行なう(第7図の)。上述したように、両者のグ
ループIDは、「1」である。したがって、デバッガはタ
スクBを「wait」状態に遷移させる(第7図の、第8
図の)。デバッガは、更に次のタスク・コントロール
・ブロック・アドレスを得ようとするが、タスク・コン
トロール・ブロックは、もうリンクされていないためブ
レークポイント処理を終了する(第7図の)。When task A reaches the breakpoint, the debugger is launched. The debugger shifts the task A stopped at the breakpoint to the "wait" state. Task control of the task put in the "wait" state at the breakpoint
Get the group ID from the block (Fig. 7). Next, the link area (area containing the address of the next task or the previous task) is referred to, and the task control block address of task B is obtained (in FIG. 7). Get the group ID from the task control block of task B. A comparison is made with the group ID of task A obtained earlier (in FIG. 7). As described above, the group IDs of both parties are “1”. Therefore, the debugger shifts task B to the "wait" state (see FIG.
(In the figure). The debugger attempts to get the next task control block address, but the task control block is no longer linked and terminates breakpoint processing (FIG. 7).
以上の操作を行ない、デバッガは「wait」状態に入る。After performing the above operations, the debugger enters the "wait" state.
3つのタスク(デバッガ、タスクA、タスクB)が共に
「wait」状態に入ったことにより、CPUはタスクが割当
てられていない状態に入る(第8図の)。ここで、実
行継続の操作が行われたとする。デバッガはブレークポ
イントに達して「wait」状態に遷移させられたタスクA
を、「ready」状態にする。次に、先程と同様にしてタ
スク・コントロール・ブロック内のグループIDを検索
し、「wait」状態に遷移させられていたタスクBを「re
ady」状態に戻す(第8図の)。デバッガは、上記の
操作を行った後「wait」状態に入る。Since all three tasks (debugger, task A, and task B) have entered the "wait" state, the CPU enters the state where no tasks have been assigned (Fig. 8). Here, it is assumed that the operation of continuing the execution is performed. Debugger reaches task A and is placed in "wait" state.
To "ready" state. Next, the group ID in the task control block is searched in the same manner as above, and the task B that has been transited to the "wait" state is "re
Return to "ady" state (Fig. 8). The debugger enters the "wait" state after performing the above operations.
「ready」状態の2つのタスクのうち、タスクAの優先
順位がタスクBのそれよりも高いため、OSはタスクAに
CPUを割当てる(第8図の)。Of the two tasks in the “ready” state, task A has a higher priority than task B, so the OS assigns task A
Allocate CPU (Fig. 8).
以上のようにしてタスクAは、処理を再開する。Task A resumes processing as described above.
この実施例では、グループIDの領域の任意の数値をセッ
トすることによって、ブレークポイントで停止させたタ
スクのグループを複数個設定することが可能になり、そ
れぞれのブレークポイント付近で関係するタスクを細か
く指定でき、デバッグの効率を上げることができる。In this embodiment, by setting an arbitrary value in the group ID area, it is possible to set a plurality of groups of tasks stopped at a breakpoint, and the related tasks can be finely divided near each breakpoint. It can be specified and the efficiency of debugging can be improved.
以上の説明から明らかなように、本発明では、ブレーク
ポイントによってあるタスクが停止した時、予め指定さ
れているブレークポイントを設定されたタスクに関係あ
るタスクを同時に停止できる。このことにより、従来の
方式では不可能だったタスクの同期関係を維持すること
が可能となり、ブレークポイントで停止したタスクを再
開した場合、それ以降の処理も正常に行われるという効
果が奏される。As is clear from the above description, according to the present invention, when a task is stopped by a breakpoint, tasks related to the task to which a preset breakpoint is set can be stopped at the same time. This makes it possible to maintain the task synchronization relationship that was not possible with the conventional method, and when the task stopped at the breakpoint is restarted, the subsequent processing is also performed normally. .
更に本発明によれば、タスク間の同期関係を維持するた
めにシステム全体を停止させる方式と異なり、ブレーク
ポイントを設定したタスクの処理と全く関係ない処理を
行っているタスクに影響を与えることがない。Further, according to the present invention, unlike the method in which the entire system is stopped to maintain the synchronization relationship between tasks, it is possible to affect a task that is performing processing that is completely unrelated to the processing of the task to which the breakpoint is set. Absent.
第1図は本発明の第1の実施例を示す図、第2図は本発
明の第2の実施例を示す図、第3図はタスク・コントロ
ール・ブロックの構造を例示する図、第4図はタスク・
コントロール・ブロック間のリンクの一般例を示す図、
第5図はタスクが2つの場合のリンク関係を示す図、第
6図は第1の実施例においてタスクがブレークポイント
に達した場合のデバッガの処理を示すフロー図、第7図
は第2の実施例においてタスクがブレークポイントに達
した場合のデバッガの処理を示すフロー図、第8図は本
発明の実施例におけるタスクの動作を例示する図、第9
図はOS上のタスクの状態遷移を示す図、第10図は通常の
場合の2タスクの動作を例示する図、第11図は従来例に
おける2タスクの動作を例示する図である。 0,・・・,14,15……ビット位置。FIG. 1 is a diagram showing a first embodiment of the present invention, FIG. 2 is a diagram showing a second embodiment of the present invention, FIG. 3 is a diagram illustrating the structure of a task control block, and FIG. The figure shows a task
Diagram showing a general example of links between control blocks,
FIG. 5 is a diagram showing the link relationship when there are two tasks, FIG. 6 is a flow diagram showing the processing of the debugger when the task reaches a breakpoint in the first embodiment, and FIG. 7 is a second diagram. FIG. 8 is a flow chart showing the processing of the debugger when a task reaches a breakpoint in the embodiment, FIG. 8 is a diagram illustrating the operation of the task in the embodiment of the present invention, and FIG.
FIG. 10 is a diagram showing task state transitions on the OS, FIG. 10 is a diagram showing an operation of two tasks in a normal case, and FIG. 11 is a diagram showing an operation of two tasks in the conventional example. 0, ..., 14,15 …… Bit position.
Claims (1)
システム上で動作するタスクの中から複数個のタスクを
指定する手段と、前記指定手段によって指定された複数
個のタスクの制御ブロック内に前記指定手段によって指
定されたことを示す情報を格納する手段と、任意のタス
クが停止させられた時に前記停止したタスクの制御ブロ
ック内の情報を検査する手段と、前記検査手段によって
検査されたタスクが前記指定手段によって指定されてい
た場合、前記タスクの実行を停止させる手段を具備し、
前記指定手段によって指定されたタスクの何れかのタス
クが、実行を停止された場合、他の指定されたタスクも
同時に停止されるようにしたことを特徴とするタスクデ
バッグ方式。1. An operating system for multiple programming
Means for designating a plurality of tasks among the tasks operating on the system, and means for storing information indicating the designation by the designating means in a control block of the plurality of tasks designated by the designating means And means for inspecting information in the control block of the stopped task when any task is stopped, and executing the task if the task inspected by the inspection means is designated by the designating means Equipped with means for stopping
A task debugging method characterized in that, when the execution of any of the tasks specified by the specifying means is stopped, the other specified tasks are also stopped at the same time.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1123712A JPH07120302B2 (en) | 1989-05-16 | 1989-05-16 | Task debug method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1123712A JPH07120302B2 (en) | 1989-05-16 | 1989-05-16 | Task debug method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02300942A JPH02300942A (en) | 1990-12-13 |
| JPH07120302B2 true JPH07120302B2 (en) | 1995-12-20 |
Family
ID=14867492
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1123712A Expired - Fee Related JPH07120302B2 (en) | 1989-05-16 | 1989-05-16 | Task debug method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH07120302B2 (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5632032A (en) * | 1994-02-07 | 1997-05-20 | International Business Machines Corporation | Cross address space thread control in a multithreaded environment |
| JP3571976B2 (en) | 1999-11-08 | 2004-09-29 | 富士通株式会社 | Debugging apparatus and method, and program recording medium |
| JP3558052B2 (en) * | 2000-06-02 | 2004-08-25 | ヤマハ株式会社 | Multimedia execution system, multimedia file execution method, and multimedia file structure readable by sequencer |
-
1989
- 1989-05-16 JP JP1123712A patent/JPH07120302B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02300942A (en) | 1990-12-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10990513B2 (en) | Deterministic concurrent test program executor for an automated test equipment | |
| US5632032A (en) | Cross address space thread control in a multithreaded environment | |
| US10481911B2 (en) | Synchronization of execution threads on a multi-threaded processor | |
| US3614745A (en) | Apparatus and method in a multiple operand stream computing system for identifying the specification of multitasks situations and controlling the execution thereof | |
| CN101556545B (en) | Method for realizing process support, device and multithreading system | |
| WO2017166777A1 (en) | Task scheduling method and device | |
| JP2001134466A (en) | Debugging apparatus and method, and program recording medium | |
| JPH0644235B2 (en) | How to operate a computer system | |
| US8225320B2 (en) | Processing data using continuous processing task and binary routine | |
| JPH1153202A (en) | Parallel transaction processing system | |
| JP2000066904A (en) | Multitask control method and storage medium | |
| US11106395B2 (en) | Application execution apparatus and application execution method | |
| CN112363816B (en) | Deterministic scheduling method, system and medium for embedded multi-core operating system | |
| JPH07120302B2 (en) | Task debug method | |
| JPH07120301B2 (en) | Task debugging method | |
| CN117743176A (en) | Demand testing method and device, storage medium and computer equipment | |
| CN120723417B (en) | Method, device and apparatus for heterogeneous database migration scheduling based on distributed architecture | |
| CN115599525A (en) | Asynchronous task scheduling method, device, equipment and storage medium | |
| JPH10111857A (en) | Multi-processor | |
| CN118277067B (en) | Polling management method, device, medium and computer program product | |
| JPH11306149A (en) | Parallel arithmetic processing device and method | |
| CN117687805B (en) | Multithreading data synchronization method and system applied to PLC and device | |
| CN115203119B (en) | A multi-core SOC synchronization system | |
| JP2000305751A (en) | Parallel sort device and recording medium for recording program of the same | |
| CN120144255A (en) | A multi-task scheduling method and PLC controller |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |