JPH052496A - Multi-task monitor - Google Patents

Multi-task monitor

Info

Publication number
JPH052496A
JPH052496A JP3151737A JP15173791A JPH052496A JP H052496 A JPH052496 A JP H052496A JP 3151737 A JP3151737 A JP 3151737A JP 15173791 A JP15173791 A JP 15173791A JP H052496 A JPH052496 A JP H052496A
Authority
JP
Japan
Prior art keywords
task
time
monitor
service
value
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
JP3151737A
Other languages
Japanese (ja)
Inventor
Akira Watanabe
晶 渡辺
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.)
Hitachi Cable Ltd
Original Assignee
Hitachi Cable 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 Hitachi Cable Ltd filed Critical Hitachi Cable Ltd
Priority to JP3151737A priority Critical patent/JPH052496A/en
Publication of JPH052496A publication Critical patent/JPH052496A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To easily obtain the stopping time of itself without issuing the request for acquiring the present time with a task by assigning respective kinds of resources (CPU time, main memory, etc.,) of a system with the task as a unit. CONSTITUTION:While a task is in a stopping condition, when the stopping condition is released by other task, a multi-task monitor subtracts the time when the task starts the stopping condition, from the present time (step 301). Thus, the stopping time of the task is obtained. The time value is stored into a memory area pointed out by a WaitTime designated by the task (step 302). Here, when a Task Wait service is the service to inform of the remaining time up to the limit time, the stopping time of the task obtained from a LimitTime is subtracted, and the value is stored in the memory area pointed out by the WaitTime. Thus, the stopping time of the task itself can be obtained as the turn-back value of the service from the multi-monitor.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はマルチタスクモニタに係
り、特にタスクが自身の停止していた時間を容易に入手
できるようにしたマルチタスクモニタに関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multitask monitor, and more particularly to a multitask monitor which makes it possible to easily obtain the time when a task has stopped.

【0002】[0002]

【従来の技術】一つのプロセッサを複数のタスクが共有
することを可能にするマルチタスクモニタにおいては、
タスクは必要とする事象が発生するまで自身を停止状態
とする場合がある。このとき、停止時間の制限値を指定
することも考えられる。これはマルチタスクモニタに、
タスクを停止し事象の発生を待つサ−ビスを要求して、
プロセッサでの実行を他のタスクに切り替えることによ
って行う。停止状態のタスクにおいて再開を指定した事
象が発生すると、マルチタスクモニタは、そのタスクを
実行可能な状態に変更し、マルチタスクモニタに実装さ
れているタスク実行優先規則に従って、そのタスクがプ
ロセッサで実行すべき条件となった時点でそのタスクに
実行を切り替える。このタスク実行優先規則の例として
は、タスクに優先順位を割り振り、その優先順位の高い
タスクから実行する規則や、各タスクに一定時間だけプ
ロセッサを割り付け、順に実行する規則などが考えられ
る。タスクは実行が再開された場合に、自身がどれだけ
の時間停止していたかを知るため、マルチタスクモニタ
に停止要求を発行する前に、現在の時刻を獲得する要求
をマルチタスクモニタに対して行う。マルチタスクモニ
タは、現在時刻をハ−ドウェアからの一定周期の割り込
み信号を計数することによって求め内部領域に格納して
いる。そして、タスクは実行再開後再び現在時刻を入手
し、これら2つの時刻の差から自身の停止時間を入手す
る。また、タスクが停止時間の制限値を指定した場合
で、その制限時間までの残り時間の入手が必要な場合
は、制限時間の値から上述の方法で求めた自身の停止時
間を減ずることによって行う。
2. Description of the Related Art In a multi-task monitor that allows a plurality of tasks to share one processor,
A task may suspend itself until the required event occurs. At this time, it is possible to specify a limit value for the stop time. This is a multitask monitor,
Request a service that stops the task and waits for the occurrence of an event,
By switching execution on the processor to another task. When an event that specifies restarting occurs in a task in the stopped state, the multitask monitor changes the task to the executable state and the task is executed by the processor according to the task execution priority rules implemented in the multitask monitor. When the condition is reached, the execution is switched to the task. Examples of the task execution priority rule include a rule in which a priority is assigned to a task and the task with the higher priority is executed, and a rule in which a processor is assigned to each task for a certain time and then executed in order. Before the task issues a stop request to the multitask monitor, the task asks the multitask monitor to acquire the current time in order to know how long it has been stopped when execution resumes. To do. The multitask monitor obtains the current time by counting the interrupt signals from the hardware in a constant cycle and stores it in the internal area. Then, the task obtains the current time again after resuming the execution, and obtains its own stop time from the difference between these two times. If the task specifies a stop time limit value and it is necessary to obtain the remaining time up to that time limit, the task's stop time obtained by the above method is subtracted from the time limit value. .

【0003】[0003]

【発明が解決しようとする課題】上述したように、従来
のマルチタスクモニタは、タスクが自身の停止時間を入
手するために、停止要求の前後2回に渡って、現在時刻
を入手する要求をマルチタスクモニタに対して発行する
必要があった。この2回に渡る現在時刻の入手要求に応
えるため、その分だけプロセッサの処理時間が余計にか
かってしまい、マルチタスク環境におけるデ−タ処理効
率のさらなる向上を図ろうとする上で障害となってい
た。
As described above, in the conventional multitask monitor, in order for a task to obtain its own stop time, a request to obtain the current time is made twice before and after the stop request. It was necessary to issue it to the multitask monitor. In order to meet the two requests for obtaining the current time, an extra processing time is required for the processor, which is an obstacle to further improving the data processing efficiency in the multitask environment. It was

【0004】本発明は、上記課題を解消すべく創案され
たものであり、タスクが現在時刻の入手要求を発行する
ことなく、自身の停止時間を容易に入手できる機能を備
えたマルチタスクモニタを提供することを目的とする。
The present invention was devised to solve the above problem, and provides a multi-task monitor having a function of easily acquiring its own stop time without issuing a request for acquisition of the current time by a task. The purpose is to provide.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するた
め、本発明のマルチタスクモニタは、少なくとも1つ以
上のタスクを少なくとも1つ以上のプロセッサに割り付
け、タスクを切り替えることでマルチタスクを実現する
マルチタスクモニタであって、タスクから自身を停止状
態とするサ−ビス要求があったとき、そのタスクを停止
状態とすると共にその時刻をメモリに記録し、その停止
状態が解除される事象が発生したとき、そのタスクの実
行を再開すると共にその実行再開時刻から上記メモリに
記録していた停止状態開始時刻を引いた時間値をサ−ビ
スの戻り値としてそのタスクに通知する機能を備えてい
る。
In order to achieve the above object, a multitask monitor of the present invention realizes multitask by allocating at least one task to at least one processor and switching the tasks. In a multi-task monitor, when a task requests a service to suspend itself, the task is suspended and the time is recorded in memory, and the suspended state is released. When it does, it has a function to restart the execution of the task and notify the task of the time value obtained by subtracting the stop state start time recorded in the memory from the execution restart time as the service return value. .

【0006】さらに、本発明のマルチタスクモニタは、
タスクから停止時間の制限値を指定して自身を停止状態
とするサ−ビス要求があったとき、そのタスクを停止状
態とすると共にその時刻をメモリに記録し、その停止状
態が解除される事象が発生したとき、そのタスクの実行
を再開すると共に停止時間の制限値から上記時間値を引
いた残りの時間値をサ−ビスの戻り値としてそのタスク
に通知する機能を備えていることが望ましい。
Further, the multitask monitor of the present invention is
When a task sends a service request that specifies a limit value for the stop time and puts itself in the stop state, the task is placed in the stop state, the time is recorded in memory, and the stop state is released. When an error occurs, it is desirable to have a function to restart the execution of the task and notify the task of the remaining time value obtained by subtracting the above time value from the stop time limit value as the service return value. .

【0007】[0007]

【作用】マルチタスクモニタは、タスクを単位としてシ
ステムの各種資源(CPU時間、主記憶装置など)の割
振りを行う性質上、タスクの停止と再開の時刻をモニタ
自身が内部管理しているメモリの格納領域から容易に入
手できる。そこで、マルチタスクモニタは、タスクの実
行再開時刻から停止状態開始時刻を減じて、上記時間
値、すなわちそのタスクが停止していた時間を入手す
る。また、停止時間の制限値前にタスクの実行を再開す
る場合には、マルチタスクモニタは停止時間の制限値か
ら上記時間値を減じることにより停止時間の残り時間を
入手する。これらタスク停止時間や制限値までの残り時
間などの時間データを、実行再開の際サ−ビスの戻り値
としてタスクに通知することにより、従来必要であった
タスクからマルチタスクモニタへの現在時刻の入手要求
が不要となり、処理の単純化、高速化が図られる。
The multitask monitor allocates various resources (CPU time, main memory, etc.) of the system in units of tasks. It can be easily obtained from the storage area. Therefore, the multitask monitor subtracts the stop state start time from the task execution restart time to obtain the time value, that is, the time when the task has been stopped. When the task execution is restarted before the stop time limit value, the multi-task monitor obtains the remaining stop time by subtracting the time value from the stop time limit value. By notifying the task of the time data such as the task stop time and the remaining time up to the limit value as the service return value when resuming execution, the current time from the previously required task to the multi-task monitor can be displayed. The acquisition request is not required, and the processing can be simplified and speeded up.

【0008】[0008]

【実施例】次に、本発明の実施例を図1及び2により説
明する。ここでは、本マルチタスクモニタは、ハ−ドウ
ェア(プロセッサ内蔵クロック等)からの一定周期の信
号を受けてこれを計数し、現在時刻を管理するものとす
る。さらに、マルチタスクモニタが、タスクが指定した
一定時間の間、そのタスクを停止状態にするサ−ビスを
提供するものとする。このサ−ビスをANSIX3J11 で審議
されているプログラミング言語Cで記述すると以下のよ
うになる。
EXAMPLE An example of the present invention will be described below with reference to FIGS. Here, it is assumed that the present multitask monitor receives a signal of a constant cycle from the hardware (clock included in the processor, etc.), counts it, and manages the current time. Further, it is assumed that the multi-task monitor provides a service for suspending the task for a fixed time specified by the task. This service is described in the programming language C discussed in ANSI X3J11 as follows.

【0009】void TaskWait(Time limitTime,Time *wa
itTime);ここで、 TaskWait は上記サ−ビスを提供する
関数名。Time は本例のマルチタスクモニタで実装する
時間を示す型で、ハ−ドウェアからの信号の周期を1 と
したものである。例えば、ハ−ドウェアからの信号周期
が1ms である場合、1 秒は1000となる。これは、ハ−ド
ウェアからの信号の周期を1とする必要はなく、例えば
ハ−ドウェアからの信号を10回受ける時間を1 としても
よい。limitTimeは型Timeで表した停止時間の制限値で
あり、waitTimeはタスクが実行を再開したときに、マル
チタスクモニタによってタスクの停止時間が格納される
メモリ領域のアドレスである。
Void TaskWait (Time limitTime, Time * wa
itTime); where TaskWait is the function name that provides the above services. Time is a type that indicates the time to be implemented by the multitask monitor of this example, where the period of the signal from the hardware is 1. For example, if the signal period from the hardware is 1 ms, 1 second will be 1000. This does not require the period of the signal from the hardware to be 1, but may be 1, for example, the time for receiving the signal from the hardware 10 times. limitTime is the limit value of the stop time represented by type Time, and waitTime is the address of the memory area in which the task stop time is stored by the multitask monitor when the task resumes execution.

【0010】マルチタスクモニタは、サ−ビスTaskWait
が要求されると、図1(A) に示す手順をとる。まず、タ
スクの要求を記録するためにメモリ領域を獲得する (ス
テップ100)。獲得したメモリ領域の例を図2に示す。そ
して指定されたlimitTime および現在時刻を400,401 の
領域に記録する (ステップ101)。このメモリ領域には、
TaskWaitのサ−ビスを実現するために必要な他の情報も
格納され得る。そして、マルチタスクモニタは、ハ−ド
ウェアからの一定周期の信号を受信すると、図1(B) に
示す手順をとる。まず、limitTime を格納したメモリ領
域401 の内容を1 減算し (ステップ200)、それが 0にな
ったかを検査する (ステップ201)。0 でない場合は処理
を終了する。0 になった場合は、タスクが指定したwait
Timeが指すメモリ領域にタスクの停止時間値としてlimi
tTime を格納し (ステップ202)、タスクを実行可能状態
とする (ステップ203)。マルチタスクモニタは、実装さ
れているタスク実行優先順位に従って、そのタスクがプ
ロセッサで実行すべき条件となった時点で、そのタスク
に実行を切り替えると共に停止時間値(limitTime)をサ
−ビスの戻り値として通知する。
The multitask monitor is a service TaskWait
Is requested, the procedure shown in Fig. 1 (A) is taken. First, a memory area is acquired to record a task request (step 100). An example of the acquired memory area is shown in FIG. Then, the specified limitTime and the current time are recorded in the area of 400,401 (step 101). In this memory area,
Other information needed to implement the TaskWait service may also be stored. When the multi-task monitor receives a signal of a constant cycle from the hardware, it takes the procedure shown in FIG. 1 (B). First, the content of the memory area 401 storing limitTime is decremented by 1 (step 200), and it is checked whether or not it has become 0 (step 201). If it is not 0, the process ends. If it becomes 0, the wait specified by the task
Limi as the task stop time value in the memory area pointed to by Time
The tTime is stored (step 202), and the task is made ready (step 203). According to the implemented task execution priority, the multi-task monitor switches execution to the task at the time when the task becomes a condition to be executed by the processor and also sets the stop time value (limitTime) to the return value of the service. Notify as

【0011】ここで、タスクが停止状態にいる間に、他
のタスクによってその停止状態が解除された場合の処理
を考える。この場合マルチタスクモニタは、図1(C) の
手順をとる。マルチタスクモニタは、現在の時刻を取り
出し(ステップ300 )、現在時刻からタスクが停止状態
を開始した時刻(メモリ領域401 に書き込まれている)
を引く (ステップ301)。これによってタスクの停止時間
が求められる。この時間値をタスクが指定したwaitTime
が指すメモリ領域に格納する (ステップ302)。ここで、
TaskWaitサ−ビスが、制限時間までの残り時間を通知す
るサ−ビスである場合は、limitTime からステップ302
で求めたタスクの停止時間を引き、その値をwaitTimeが
指すメモリ領域に格納することになる。そしてマルチタ
スクモニタは、タスクの実行を再開する際に、waitTime
が指すメモリ領域に格納した時間デ−タをサ−ビスの戻
り値としてタスクに通知する。
Now, let us consider the processing in the case where the suspended state is canceled by another task while the task is in the suspended state. In this case, the multitask monitor takes the procedure shown in FIG. The multitask monitor retrieves the current time (step 300), and the time when the task started the stopped state from the current time (written in the memory area 401).
(Step 301). This gives the task downtime. The waitTime at which this time value was specified by the task
It is stored in the memory area pointed to by (step 302). here,
If the TaskWait service is a service that notifies the remaining time up to the time limit, the process from limitTime to step 302
The task stop time calculated in step 1 is subtracted and the value is stored in the memory area pointed to by waitTime. The multitask monitor will then waitTime when restarting the task execution.
The task is notified of the time data stored in the memory area indicated by as the return value of the service.

【0012】かくして、従来タスクが停止要求の前後2
回に渡ってマチルタスクモニタに発行していた現在時刻
の入手要求は完全に不要となる。
Thus, the conventional task is 2 before and after the stop request.
The request to obtain the current time, which was issued to the Matil task monitor over time, is completely unnecessary.

【0013】[0013]

【発明の効果】以上要するに本発明によれば、タスクが
停止状態となる要求から解除された際に、自身の停止時
間をマルチタスクモニタからのサ−ビスの戻り値として
入手できるので、従来必要であったマルチタスクモニタ
への現在時刻の入手要求が不要となり、処理の単純化、
高速化を図ることができる。
In summary, according to the present invention, when the task is released from the request to be in the stopped state, the own stop time can be obtained as the return value of the service from the multitask monitor. It became unnecessary to obtain the current time from the multitask monitor, which was a simple process.
The speed can be increased.

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

【図1】本発明に係るマルチタスクモニタの動作例を示
すフロ−チャ−ト図である。
FIG. 1 is a flowchart showing an operation example of a multitask monitor according to the present invention.

【図2】本発明に係るマルチタスクモニタがタスク停止
サ−ビスを実現するために必要となるメモリ領域の構成
例を示す図である。
FIG. 2 is a diagram showing a configuration example of a memory area required for the multitask monitor according to the present invention to realize a task stop service.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 少なくとも1つ以上のタスクを少なくと
も1つ以上のプロセッサに割り付け、タスクを切り替え
ることでマルチタスクを実現するマルチタスクモニタで
あって、タスクから自身を停止状態とするサ−ビス要求
があったとき、そのタスクを停止状態とすると共にその
時刻をメモリに記録し、その停止状態が解除される事象
が発生したとき、そのタスクの実行を再開すると共にそ
の実行再開時刻から上記メモリに記録していた停止状態
開始時刻を引いた時間値をサ−ビスの戻り値としてその
タスクに通知する機能を備えていることを特徴とするマ
ルチタスクモニタ。
1. A multi-task monitor for allocating at least one or more tasks to at least one or more processors and switching the tasks to realize a multi-task, which is a service request for suspending itself from the tasks. When there is an event, the task is stopped and the time is recorded in the memory. When an event that cancels the stopped state occurs, execution of the task is restarted and the execution restart time is stored in the memory. A multi-task monitor having a function of notifying the task of a time value obtained by subtracting the recorded stop state start time as a service return value.
【請求項2】 請求項1のマルチタスクモニタにおい
て、タスクから停止時間の制限値を指定して自身を停止
状態とするサ−ビス要求があったとき、そのタスクを停
止状態とすると共にその時刻をメモリに記録し、その停
止状態が解除される事象が発生したとき、そのタスクの
実行を再開すると共に停止時間の制限値から上記時間値
を引いた残りの時間値をサ−ビスの戻り値としてそのタ
スクに通知する機能を備えていることを特徴とするマル
チタスクモニタ。
2. In the multitask monitor according to claim 1, when a task requests a service to specify a limit value of a stop time and put itself in a stop state, the task is stopped and the time is set. Is recorded in the memory, and when an event that cancels the stopped state occurs, execution of the task is resumed and the remaining time value obtained by subtracting the above time value from the limit value of the stop time is returned to the service. A multi-task monitor characterized by having a function of notifying the task as.
JP3151737A 1991-06-24 1991-06-24 Multi-task monitor Pending JPH052496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3151737A JPH052496A (en) 1991-06-24 1991-06-24 Multi-task monitor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3151737A JPH052496A (en) 1991-06-24 1991-06-24 Multi-task monitor

Publications (1)

Publication Number Publication Date
JPH052496A true JPH052496A (en) 1993-01-08

Family

ID=15525192

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3151737A Pending JPH052496A (en) 1991-06-24 1991-06-24 Multi-task monitor

Country Status (1)

Country Link
JP (1) JPH052496A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS534812A (en) * 1976-07-01 1978-01-17 Mitsubishi Electric Corp Power source for dc motor
WO2021048964A1 (en) * 2019-09-12 2021-03-18 サンケン電気株式会社 Processor and event processing method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS534812A (en) * 1976-07-01 1978-01-17 Mitsubishi Electric Corp Power source for dc motor
WO2021048964A1 (en) * 2019-09-12 2021-03-18 サンケン電気株式会社 Processor and event processing method
JPWO2021048964A1 (en) * 2019-09-12 2021-03-18
CN114258516A (en) * 2019-09-12 2022-03-29 三垦电气株式会社 Processor and event processing method
US11868825B2 (en) 2019-09-12 2024-01-09 Sanken Electric Co., Ltd. Processor and event processing method
CN114258516B (en) * 2019-09-12 2024-05-14 三垦电气株式会社 Processor and event processing method

Similar Documents

Publication Publication Date Title
JP3659062B2 (en) Computer system
KR930000592B1 (en) Task searching apparatus
US4685125A (en) Computer system with tasking
US5812844A (en) Method and system for scheduling the execution of threads using optional time-specific scheduling constraints
US5784618A (en) Method and system for managing ownership of a released synchronization mechanism
US6006247A (en) Method and system for scheduling threads and handling exceptions within a multiprocessor data processing system
US5455958A (en) Rendering context manager for display adapters
US5748959A (en) Method of conducting asynchronous distributed collective operations
US5666523A (en) Method and system for distributing asynchronous input from a system input queue to reduce context switches
EP0425320A2 (en) Multiprocessor system and process synchronisation method therefor
US20030041090A1 (en) Yield on multithreaded processors
US5291608A (en) Display adapter event handler with rendering context manager
JPH05189251A (en) Multitasking operating system and operating method for this computer
RU2397535C2 (en) Device for information processing, method for storage area control
US5367680A (en) Rendering context manager for display adapters supporting multiple domains
JP2004326774A (en) Selective generation of asynchronous report about compartment managing operation for logically compartmentalized computer
JPH052496A (en) Multi-task monitor
JPH06274354A (en) Method and system for control of operation of destructive hardware
JP3349547B2 (en) Scheduling system
EP0442714A2 (en) Interrupt handling in a data processing system
JPH08297585A (en) Data transfer method by operating system
JP2000259467A (en) Device and method for data access
JPH05210524A (en) Method of controlling storage device, computer system and product for usage in computer system
JPH0619858A (en) Automatic return system for common resources
EP0442729A2 (en) Multitasking data processing system