JPH05127927A - Task termination processor - Google Patents
Task termination processorInfo
- Publication number
- JPH05127927A JPH05127927A JP28819691A JP28819691A JPH05127927A JP H05127927 A JPH05127927 A JP H05127927A JP 28819691 A JP28819691 A JP 28819691A JP 28819691 A JP28819691 A JP 28819691A JP H05127927 A JPH05127927 A JP H05127927A
- Authority
- JP
- Japan
- Prior art keywords
- task
- termination
- operating system
- processing
- exit
- 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.)
- Granted
Links
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、計算機において、タス
ク終了時に残された計算機資源の、解放処理を行うため
のタスク終了処理装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a task end processing device for releasing processing of computer resources left at the end of a task in a computer.
【0002】[0002]
【従来の技術と発明が解決しようとする課題】公知のよ
うに計算機で実行されるタスクが終了する場合には、使
用していた共用の計算機資源、即ち主記憶領域や共用デ
ータセット等をシステムに返却する手続きを行って、そ
れらを他のタスクで使用できる状態に解放する処理を行
った後に終了するのが原則である。2. Description of the Related Art As is well known, when a task to be executed by a computer ends, the shared computer resources that have been used, that is, the main storage area, the shared data set, etc., are transferred to the system. It is the principle to finish after performing the procedure to return to, to release them to a state that can be used by other tasks.
【0003】しかし、そのような共用資源の解放処理を
行うことなくタスクを終了する場合があり、その状態を
放置すると、使用できる共用資源が次第に減少し、遂に
はシステムが正常に稼働できない状態になり得るので、
そのようにタスク終了時に残されている諸資源の解放処
理を行うために、オペレーティングシステムでタスク終
了出口のサービスが設けられている。However, there is a case where the task is terminated without performing such shared resource release processing, and if the state is left as it is, the usable shared resources are gradually reduced, and finally the system cannot operate normally. Because it can be
In order to release the various resources left at the end of the task in this way, a task end exit service is provided in the operating system.
【0004】このタスク終了出口を利用するように登録
されていると、登録されているタスクが終了する時に
は、オペレーティングシステムのタスク終了処理の中で
タスク終了出口ルーチンが起動されて、必要な資源の解
放処理を行うので、共用資源が未解放のまゝに放置され
ることが無い。If the task termination exit is registered to use the task, when the registered task is terminated, the task termination exit routine is started in the task termination processing of the operating system so that necessary resources can be stored. Since the release process is performed, shared resources are not left unreleased.
【0005】しかし、タスク終了出口の登録は、オペレ
ーティングシステムのシステム生成時に行うことになっ
ているので、その後に追加されるプログラムでは、タス
ク終了出口のサービスを受けるようにすることが容易に
できない。However, since the task end exit is to be registered when the operating system creates the system, it is not easy for a program added thereafter to receive the service of the task end exit.
【0006】オペレーティングシステムの類似のサービ
スとして、公知の異常終了出口があり、このサービスで
はタスクが必要な異常終了出口の登録をオペレーティン
グシステムに要求して登録することができる。As a service similar to the operating system, there is a known abend exit, and this service can request and register an abend exit required for a task from the operating system.
【0007】この登録が行われていると、そのタスクが
所定の正常状態で終了しない場合に、オペレーティング
システムは、その終了処理の中で、異常終了出口に登録
されている異常終了出口ルーチンを起動する。With this registration, when the task does not end in a predetermined normal state, the operating system starts the abnormal termination exit routine registered in the abnormal termination exit during the termination processing. To do.
【0008】従って、異常終了出口ルーチンによって、
例えば異常発生時に必要な後始末等で、そのタスクに固
有の処理等を行うようにして、このサービスを有効に利
用することができる。Accordingly, the abnormal termination exit routine
For example, this service can be effectively used by performing processing unique to the task at the time of cleaning up when an abnormality occurs.
【0009】しかし、前記のとおり異常終了出口の登録
は、タスクが異常終了する場合にしか有効に作用しない
ので、異常終了出口のサービスを、そのまゝタスク終了
出口の代わりに利用することはできない。However, as described above, the registration of the abnormal termination exit is effective only when the task is abnormally terminated, so the service of the abnormal termination exit cannot be used in place of the task termination exit as it is. ..
【0010】本発明は、前記のタスク終了出口と同等の
機能を、比較的簡単に実現できるようにするタスク終了
処理装置を目的とする。It is an object of the present invention to provide a task end processing device that makes it possible to relatively easily realize the same function as the task end exit.
【0011】[0011]
【課題を解決するための手段】図1は、本発明の構成を
示すブロック図である。図はタスク終了処理装置の構成
であって、計算機のオペレーティングシステム1は、タ
スクの要求を受けて異常終了出口を登録することによ
り、当該タスクが所定の異常終了状態の場合に該登録に
指定されたルーチンを起動する機能を有するものとす
る。FIG. 1 is a block diagram showing the configuration of the present invention. The figure shows the configuration of the task end processing device. The operating system 1 of the computer registers the abnormal end exit by receiving the request of the task, and when the task is in a predetermined abnormal end state, it is designated in the registration. It has a function to activate the routine.
【0012】タスク終了処理装置2は、オペレーティン
グシステム1の制御下にある装置であって、タスク生成
部3と終了処理部4とを有する。タスク生成部3は、該
タスクの所定の要求によって、終了処理部4を当該タス
クを親タスク5とする子タスクとして生成することをオ
ペレーティングシステム1に要求する。The task end processing device 2 is a device under the control of the operating system 1, and has a task generation unit 3 and an end processing unit 4. The task generation unit 3 requests the operating system 1 to generate the end processing unit 4 as a child task having the task as a parent task 5 according to a predetermined request of the task.
【0013】終了処理部4は、所定の終了処理ルーチン
6を有し、終了処理ルーチン6を指定して、該異常終了
出口の登録をオペレーティングシステム1に要求した
後、所定の事象を指定して事象待ち状態となる。The termination processing unit 4 has a predetermined termination processing routine 6, specifies the termination processing routine 6, requests the operating system 1 to register the abnormal termination exit, and then designates a predetermined event. Waiting for an event.
【0014】オペレーティングシステム1は、親タスク
5の終了時に、終了処理部4のタスクが終了していなけ
れば、該異常終了状態と判断して、該異常終了出口の登
録に従って終了処理ルーチン6を起動する。At the end of the parent task 5, the operating system 1 judges that the task of the termination processing unit 4 is not in the termination state and starts the termination processing routine 6 according to the registration of the abnormal termination exit. To do.
【0015】終了処理ルーチン6は、親タスク5の使用
していた計算機資源について、当該計算機資源を解放す
る処理を実行する。The end processing routine 6 executes processing for releasing the computer resource used by the parent task 5.
【0016】[0016]
【作用】本発明のタスク終了処理装置により、あるタス
クの適当な要求発生を契機として、本装置のタスク生成
部がオペレーティングシステムによって子タスクを生成
する。With the task end processing device of the present invention, the task generation unit of this device generates a child task by the operating system upon the occurrence of an appropriate request for a certain task.
【0017】この子タスクは、終了処理部として機能
し、オペレーティングシステムの異常終了出口登録サー
ビスを使用して、終了処理ルーチンを登録した後、所定
の事象を指示して事象待ち状態になる。This child task functions as an end processing unit, uses the abnormal end exit registration service of the operating system to register the end processing routine, then issues a predetermined event and enters an event waiting state.
【0018】親タスクが、本来の所要の処理を終了し
て、タスクを終了しようとし、オペレーティングシステ
ムの終了処理に入ると、オペレーティングシステムは通
常の制御として、子タスクである終了処理部が事象待ち
状態のまゝで、終了していないことを検出する。When the parent task finishes the originally required processing, tries to terminate the task, and enters the termination processing of the operating system, the operating system performs normal control, and the termination processing unit, which is a child task, waits for an event. It detects that it is not finished while the status is still up.
【0019】従ってオペレーティングシステムは、親タ
スクが終了する時点で子タスクが生きていることによ
り、異常状態と判断して、子タスクを強制的に異常終了
させることにし、異常終了出口の登録があるために、そ
こに指定されている終了処理ルーチンを起動する。Therefore, the operating system determines that the child task is alive at the time when the parent task ends and is in an abnormal state, and forcibly ends the child task abnormally, and the abnormal end exit is registered. In order to do so, the termination processing routine specified there is started.
【0020】そこで、終了処理ルーチンを、例えば前記
タスク終了出口ルーチンに代わって同等の終了処理を行
うように、処理内容を定義しておくことにすれば、タス
ク終了出口に代わるサービスを比較的容易に実現するこ
とができる。Therefore, by defining the processing contents so that the end processing routine performs equivalent end processing instead of the task end exit routine, for example, the service replacing the task end exit is relatively easy. Can be realized.
【0021】[0021]
【実施例】計算機システムが、例えば図形処理等を実行
するための各種関数を提供する基本プログラムがあり、
図形処理の応用プログラムは、それらの関数を実行する
ための関数呼出の列で構成するようになっているとす
る。EXAMPLE A computer system has a basic program that provides various functions for executing, for example, graphic processing,
It is assumed that the graphic processing application program is composed of a sequence of function calls for executing those functions.
【0022】そのようなシステムにおいては、例えば応
用プログラムが、最初に図形処理に必要な諸計算機資源
の初期化を、初期化関数を呼び出すことによって行うの
で、その初期化関数の初期化処理の一部として、本発明
のタスク終了処理装置を組み込めば、応用プログラムで
は陽にタスク終了処理装置への要求送出を意識しないで
もよい。In such a system, for example, the application program first initializes the computer resources required for graphic processing by calling the initialization function. If the task end processing device of the present invention is incorporated as a unit, the application program need not be conscious of sending a request to the task end processing device.
【0023】図2は、そのような基本プログラムを使用
して処理を実行する応用プログラムを有するシステムに
おける、本発明の実施例の処理の流れを示す図であり、
応用プログラムのタスクが起動すると先ず処理ステップ
10で基本プログラムの初期化関数を呼ぶ。FIG. 2 is a diagram showing the flow of processing of the embodiment of the present invention in a system having an application program for executing processing using such a basic program.
When the task of the application program is started, first the processing step
At 10 we call the initialization function of the basic program.
【0024】初期化関数は処理ステップ11で図1のタス
ク生成部3の機能を実行して、子タスクの生成要求を出
し、オペレーティングシステムによって処理ステップ12
により、子タスクが起動される。The initialization function executes the function of the task generator 3 of FIG. 1 in processing step 11 to issue a generation request for a child task, and the operating system executes processing step 12
Causes the child task to be started.
【0025】子タスクは図1の終了処理部4を構成し、
処理ステップ13で異常終了出口の登録を要求し、オペレ
ーティングシステムにより処理ステップ14で登録が行わ
れ、終了処理ルーチンが異常終了出口ルーチンとして登
録される。The child task constitutes the end processing unit 4 of FIG.
The processing step 13 requests registration of the abnormal termination exit, the operating system performs registration in processing step 14, and the termination processing routine is registered as the abnormal termination exit routine.
【0026】子タスクは、処理ステップ15で初期化関数
に異常終了出口の登録済を通知した後、処理ステップ16
で所定の事象を指定して事象待ちをオペレーティングシ
ステムに要求し、処理ステップ17の処理で事象待ち状態
となる。The child task notifies the initialization function that the abnormal termination exit has been registered in processing step 15, and then executes processing step 16
In step 1, a predetermined event is designated and the operating system is requested to wait for an event, and the processing in step 17 enters the event waiting state.
【0027】初期化関数では、子タスクから登録済の通
知を受けると、処理ステップ18で、本来の初期化処理を
開始して資源獲得要求を出すので、オペレーティングシ
ステムは処理ステップ19で資源割当を行う。In the initialization function, when the registered notification is received from the child task, the original initialization process is started and a resource acquisition request is issued in processing step 18, so that the operating system allocates resources in processing step 19. To do.
【0028】資源の割当が終わると、初期化関数は処理
ステップ20で処理を終わり応用プログラムに制御を戻す
ので、処理ステップ21で応用プログラムによる業務自体
の処理が実行される。When the resource allocation is completed, the initialization function ends the processing in processing step 20 and returns control to the application program, so that in processing step 21, the processing of the work itself by the application program is executed.
【0029】応用プログラムの処理を終わると処理ステ
ップ22でオペレーティングシステムへ制御が渡り、処理
ステップ23でタスクの終了処理が行われ、その結果子タ
スクが事象待ち状態のまゝであるので、処理ステップ24
で子タスクの強制終了処理を始める。When the processing of the application program is completed, control is passed to the operating system in processing step 22 and task ending processing is carried out in processing step 23. As a result, the child task remains in the event waiting state. twenty four
Start the forced termination process of the child task.
【0030】その結果処理ステップ25で、異常終了出口
に登録されている終了処理ルーチンが起動され、処理ス
テップ26で、応用プログラムのタスクが獲得した資源に
ついて、オペレーティングシステムへ資源の返却が行わ
れ、処理ステップ27でオペレーティングシステムにより
資源が解放される。As a result, in the processing step 25, the termination processing routine registered in the abnormal termination exit is started, and in the processing step 26, the resource acquired by the task of the application program is returned to the operating system, Resources are released by the operating system in process step 27.
【0031】なお、基本プログラムに例えば終了化関数
として、資源の返却等を行う関数が準備されている場合
には、終了化関数の処理の一部として、例えば前記で子
タスクが待つ事象を発生させることにより、子タスクを
実行させる。When a function for returning a resource is prepared in the basic program as, for example, a finalization function, an event that the child task waits is generated as a part of the processing of the finalization function. By doing so, the child task is executed.
【0032】そこで子タスクは自身で正常に終了するよ
うにすれば、応用プログラムが終了化関数を呼んで終了
する場合には、子タスクの登録した異常終了出口による
終了処理ルーチンの起動が行われないようにすることが
できる。Therefore, if the child task is normally terminated by itself, when the application program terminates by calling the finalization function, the termination processing routine is started by the abnormal termination exit registered by the child task. You can avoid it.
【0033】[0033]
【発明の効果】以上の説明から明らかなように本発明に
よれば、計算機における、タスク終了時に残された計算
機資源の解放処理のために、タスク終了出口と同等の機
能を、比較的簡単に実現できるという著しい工業的効果
がある。As is clear from the above description, according to the present invention, the function equivalent to the task end exit can be relatively easily provided for the processing of releasing the computer resources left at the end of the task in the computer. There is a remarkable industrial effect that can be realized.
【図1】 本発明の構成を示すブロック図FIG. 1 is a block diagram showing the configuration of the present invention.
【図2】 本発明の処理の流れ図FIG. 2 is a flow chart of processing of the present invention.
1 オペレーティングシステム 2 タスク終了処理装置 3 タスク生成部 4 終了処理部 5 親タスク 6 終了処理ルーチン 10〜27 処理ステップ 1 Operating System 2 Task End Processing Device 3 Task Generation Unit 4 End Processing Unit 5 Parent Task 6 End Processing Routine 10 to 27 Processing Steps
Claims (1)
は、タスクの要求を受けて異常終了出口を登録すること
により、当該タスクが所定の異常終了状態の場合に該登
録に指定されたルーチンを起動する機能を有し、 該オペレーティングシステム(1)の制御下にある装置(2)
であって、タスク生成部(3)と終了処理部(4)とを有し、 該タスク生成部(3)は、該タスクの所定の要求によっ
て、該終了処理部(4)を当該タスクを親タスク(5)とす
る子タスクとして生成することを該オペレーティングシ
ステム(1)に要求し、 該終了処理部(4)は、所定の終了処理ルーチン(6)を有
し、該終了処理ルーチンを指定して、該異常終了出口の
登録を該オペレーティングシステム(1)に要求した後、
所定の事象を指定して事象待ち状態となり、 該オペレーティングシステム(1)は、該親タスク(5)の終
了時に、該終了処理部(4)のタスクが終了していなけれ
ば、該異常終了状態と判断して、該異常終了出口の登録
に従って該終了処理ルーチン(6)を起動し、 該終了処理ルーチン(6)は、該親タスク(5)の使用してい
た計算機資源について、当該計算機資源を解放する処理
を実行するように構成されていることを特徴とするタス
ク終了処理装置。1. A computer operating system (1)
Has a function of activating a routine specified in the registration when the task is in a predetermined abnormal end state by registering an abnormal end exit in response to a request from the task. Equipment under control (2)
It has a task generation unit (3) and an end processing unit (4), and the task generation unit (3) causes the end processing unit (4) to execute the task according to a predetermined request of the task. The operating system (1) is requested to generate as a child task to be a parent task (5), and the end processing unit (4) has a predetermined end processing routine (6). After specifying and requesting the operating system (1) to register the abnormal termination exit,
When a predetermined event is designated, the operating system (1) enters the event waiting state, and when the parent task (5) ends, if the task of the end processing unit (4) has not ended, the operating system (1) enters the abnormal end state. The termination processing routine (6) is started according to the registration of the abnormal termination exit, and the termination processing routine (6) determines that the computer resources used by the parent task (5) are the relevant computer resources. A task end processing device, which is configured to execute processing for releasing a task.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP03288196A JP3128898B2 (en) | 1991-11-05 | 1991-11-05 | Task termination processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP03288196A JP3128898B2 (en) | 1991-11-05 | 1991-11-05 | Task termination processor |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH05127927A true JPH05127927A (en) | 1993-05-25 |
JP3128898B2 JP3128898B2 (en) | 2001-01-29 |
Family
ID=17727058
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP03288196A Expired - Fee Related JP3128898B2 (en) | 1991-11-05 | 1991-11-05 | Task termination processor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3128898B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07219789A (en) * | 1994-01-27 | 1995-08-18 | Internatl Business Mach Corp <Ibm> | Method for processing of external event in plurality of thread systems |
US6907605B1 (en) | 1998-05-18 | 2005-06-14 | International Business Machines Corporation | Method and apparatus for providing for notification of task termination |
-
1991
- 1991-11-05 JP JP03288196A patent/JP3128898B2/en not_active Expired - Fee Related
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07219789A (en) * | 1994-01-27 | 1995-08-18 | Internatl Business Mach Corp <Ibm> | Method for processing of external event in plurality of thread systems |
US8407703B1 (en) | 1994-01-27 | 2013-03-26 | International Business Machines Corporation | Quiensce termination/suspension in a multithreaded enviroment |
US6907605B1 (en) | 1998-05-18 | 2005-06-14 | International Business Machines Corporation | Method and apparatus for providing for notification of task termination |
Also Published As
Publication number | Publication date |
---|---|
JP3128898B2 (en) | 2001-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1162536A1 (en) | Multiple operating system control method | |
CN107479981B (en) | Processing method and device for realizing synchronous call based on asynchronous call | |
US6507861B1 (en) | System and method for avoiding deadlock in a non-preemptive multi-threaded application running in a non-preemptive multi-tasking environment | |
CN110659131A (en) | Task processing method, electronic device, computer device, and storage medium | |
EP1191439A1 (en) | Computer system and computer-readable record medium | |
JPH05127927A (en) | Task termination processor | |
JPH09259002A (en) | Debug support device | |
CN114661436A (en) | Cloud-native job scheduling method, system and storage medium | |
JPH05313923A (en) | Exclusive controller for shared resources | |
JPH07219789A (en) | Method for processing of external event in plurality of thread systems | |
KR100594019B1 (en) | Process Management Method in Distributed Environment | |
JP2790472B2 (en) | Multiple conversation processing control method | |
JP3641341B2 (en) | Online exclusive weight avoidance device | |
CN117056093A (en) | Method, equipment and medium for asynchronously calling service interface based on IROS | |
JP3096760B2 (en) | Common data reference setting device and reference setting method | |
JP2000259436A (en) | Exclusive control method in distributed object environment | |
US7467139B1 (en) | Library lock management | |
JPH04205231A (en) | Program execution control system | |
JPH03212715A (en) | Power supply control system for working station | |
JPH0497474A (en) | Job managing system for computer network | |
JPH04372042A (en) | Input/output interrupt processing management system | |
JPH05113891A (en) | Pseudo semaphore system | |
JPH0330172B2 (en) | ||
JPH04343159A (en) | Exclusive control system for shared resources | |
JPH0231263A (en) | Conflict control system for peripheral device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20001017 |
|
LAPS | Cancellation because of no payment of annual fees |