JPH08212064A - Switching system and method for shared subroutine - Google Patents

Switching system and method for shared subroutine

Info

Publication number
JPH08212064A
JPH08212064A JP1452495A JP1452495A JPH08212064A JP H08212064 A JPH08212064 A JP H08212064A JP 1452495 A JP1452495 A JP 1452495A JP 1452495 A JP1452495 A JP 1452495A JP H08212064 A JPH08212064 A JP H08212064A
Authority
JP
Japan
Prior art keywords
subroutine
task
shared
processing
replacement
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
JP1452495A
Other languages
Japanese (ja)
Inventor
Kunihiko Tsunetomi
邦彦 恒冨
Takanori Yokoyama
孝典 横山
Masaru Shimada
優 島田
Masahiko Saito
雅彦 齊藤
Tomoaki Nakamura
智明 中村
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 Ltd
Original Assignee
Hitachi 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 Ltd filed Critical Hitachi Ltd
Priority to JP1452495A priority Critical patent/JPH08212064A/en
Publication of JPH08212064A publication Critical patent/JPH08212064A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

PURPOSE: To effectively switch the shared subroutines without stopping the operation of an entire system. CONSTITUTION: A shared subroutine switching system includes a subroutine switch processing instruction recorder means 5 which instructs how to deal with the task that is using a subroutine when a subroutine switching command is carried out. Then the system decides the using state of the subroutine to be switched and carries out the switch processing when the subroutine is not used by any task and also the means 5 has no designation. In other cases, the task is compulsively finished by an instruction or the switch processing is delayed until the task is finished and the switch processing becomes possible.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、複数のタスクが複数の
共用サブルーチンを共有しているシステムにおいて、シ
ステム全体を停止させることなく共用サブル−チンの入
れ替えを行う、共用サブルーチン入れ替えシステムおよ
び共用サブルーチンの入れ替え方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a shared subroutine replacing system and shared subroutine for replacing a shared subroutine in a system in which a plurality of tasks share a plurality of shared subroutines without stopping the entire system. Regarding the replacement method.

【0002】[0002]

【従来の技術】ユニックス(UNIX:ユニックス シ
ステム ラボラトリーズ(Unix SystemLaboratories)の
ライセンスしているオペレーティングシステム)等の従
来のオペレーティングシステムは、システム内の全ての
タスク間で共用して使用することが可能な共用サブルー
チン(ユニックスでは共用ライブラリと呼ばれる)を用
意している。共用サブルーチンはタスクのオブジェクト
ファイルに一緒に含まれずに別ファイルとなっている。
この為、全てのタスクのオブジェクトファイルにサブル
ーチンを予めリンクしておく場合に比べて、オブジェク
トファイルを格納するハードディスクの使用量を削減で
きる。また、メモリ上の共用サブルーチンも複数のタス
クにより共用されるので、メモリ使用量も節約できる。
2. Description of the Related Art Conventional operating systems such as UNIX (UNIX: operating system licensed by Unix System Laboratories) can be shared and used by all tasks in the system. Subroutine (called shared library in Unix) is prepared. The shared subroutine is not included in the task object file but is a separate file.
Therefore, the amount of use of the hard disk storing the object files can be reduced as compared with the case where the subroutines are linked to the object files of all the tasks in advance. Further, since the shared subroutine on the memory is shared by a plurality of tasks, the memory usage amount can be saved.

【0003】共用サブルーチンについては、文献「マネ
ージング プログラムス アンドライブラリズ イン
エーアイエックス バージョン3 フォー リスクシス
テム/6000プロセッサ:アイビーエム ジャーナル
オブ リサーチ アンドデベロップメント,34巻1
号 1990年1月刊 エム.エイ.アウスランダー著」(M
anaging programs and libraries in AIX Version 3 fo
r RISC System/6000 processors:IBM Journal of Rese
arch and Development Vol.34, no1. January 1990:M.
A. Auslander)、文献「シェアード ライブラリ イン
サンオーエス:ユーゼニックス プロシーディング
1987年夏,ロバート エイ.ジンゲル等著」(Shared L
ibraries in SunOS:USENIX proceding Summer 1987:R
obert A. Gingell et al.)に詳しく記載されている。
For common subroutines, refer to the document "Managing Programs and Libraries
AIX Version 3 For Risk System / 6000 Processor: IBM Journal of Research and Development, Vol. 34, Vol. 1
Issue January 1990 M. A. By Auslander "(M
anaging programs and libraries in AIX Version 3 fo
r RISC System / 6000 processors: IBM Journal of Rese
arch and Development Vol.34, no1. January 1990: M.
A. Auslander), “Shared Library in SunOS: Euzenix Proceedings”
Robert A. Summer 1987. Zinger et al. "(Shared L
ibraries in SunOS: USENIX proceding Summer 1987: R
obert A. Gingell et al.).

【0004】この共用サブルーチンを、オンラインで入
れ替える必要が生じる場合がある。例えば、システム動
作中のサブルーチンのバージョンアップを行う場合や、
共用サブルーチンのデバッグを行う場合である。そのた
め従来のオペレーティングシステムでは、例えば特開平
4−39739に示されるような、共用サブルーチンの
入れ替え処理を行うコマンド及びシステムを用意してい
る。
It may be necessary to replace this shared subroutine online. For example, when updating the version of the subroutine during system operation,
This is a case of debugging a shared subroutine. Therefore, in the conventional operating system, a command and a system for performing the replacement process of the common subroutine as shown in, for example, JP-A-4-39739 are prepared.

【0005】この特開平4−39739においては、サ
ブルーチン交換管理手段は、何れのタスクがどのサブル
ーチンを判別する呼出判別手段を有しており、該呼出判
別手段により走行中のタスクによって現在サブルーチン
が使用されているかどうかを判定する。もしくは該呼出
判別手段の替わりにどのサブルーチンが現在メモリにマ
ッピングされているかを管理するサブルーチンマッピン
グ情報記録部を持ち、これからサブルーチンの使用状況
を調べる。そして共用サブルーチンに含まれる全てのサ
ブルーチンが使用されていない時には入れ替え処理を行
い、タスクにより使用されているサブルーチンがある時
は、そのサブルーチンを使用しているタスクが終了する
まで待つか、そのタスクを強制終了させてから共用サブ
ルーチンを入れ替える。また、タスクが入れ替え途中の
サブルーチンをコールしようとする場合には、タスク管
理がそのコールを中止しタスクを強制終了させるか、そ
のコールを延期する。これにより、システムの全タスク
を全停止させることなく、また、タスクの実行結果に不
整合が起こさずに共用サブルーチンを入れ替えることが
できる。
In Japanese Patent Laid-Open No. 4-39739, the subroutine exchange management means has a call discrimination means for discriminating which subroutine is which task, and the subroutine is currently used by the task running by the call discrimination means. It is determined whether it has been done. Alternatively, instead of the call discriminating means, a subroutine mapping information recording unit for managing which subroutine is currently mapped in the memory is provided, and the usage status of the subroutine is checked from this. Then, when all the subroutines included in the shared subroutine are not used, the replacement process is performed, and when there is a subroutine used by the task, wait until the task using the subroutine finishes, or execute the task. Replace the shared subroutine after forcibly ending it. When a task tries to call a subroutine in the middle of replacement, task management cancels the call and forcibly terminates the task, or postpones the call. As a result, the shared subroutines can be replaced without stopping all the tasks of the system and without causing inconsistency in the execution results of the tasks.

【0006】[0006]

【発明が解決しようとする課題】特開平4-39739で述べ
られている様な従来のサブルーチン入れ替え処理は、サ
ブルーチンを実行しているタスクに対する処理が、タス
ク強制終了若しくはタスク終了待ちのどちらかに固定さ
れているため、サブルーチン入れ替えがシステムに大き
なオーバヘッドをもたらすという問題があった。
In the conventional subroutine replacement process as described in Japanese Patent Laid-Open No. 4-39739, the process for the task executing the subroutine is either task forced termination or task termination waiting. Since it is fixed, there is a problem that the replacement of subroutines brings a large overhead to the system.

【0007】第一の例としては、異なる性質乃至は処理
形態のタスクが混在するシステムにおけるサブルーチン
入れ替え処理である。一般にシステムを構成するタスク
の性質は処理の形態により2種類に分けることが出来
る。1つはユニックスにおけるデーモンプロセスのよう
に、無限ループを繰り返して何らかの処理を継続し、基
本的には自らは終了することがないような性質のタスク
であり、以下この様なタスクを「デーモン型タスク」と
呼ぶ。「デーモン型タスク」は、他のタスクや計算機の
入出力装置から処理要求を受け付け、その処理を行うこ
とが多い。また、、他のタスクや計算機の入出力装置か
らの処理要求が存在しない場合は、タスクは実行状態の
まま次の要求が到着するまで休止状態となる。もう1つ
は、処理が終ると自ら終了する性質を有するタスクであ
り、以下この様なタスクを「通常タスク」と呼ぶ。
The first example is subroutine replacement processing in a system in which tasks of different natures or processing forms coexist. Generally, the nature of the tasks that make up the system can be divided into two types depending on the processing form. One is a task of the nature that it does not end itself by repeating an infinite loop and continuing some processing like a daemon process in Unix. Call it "task". The “daemon type task” often receives a processing request from another task or an input / output device of a computer and performs the processing. Further, if there is no processing request from another task or the input / output device of the computer, the task remains in the execution state and is in the sleep state until the next request arrives. The other is a task that has the property of ending itself when processing is completed, and such a task is called a "normal task" below.

【0008】これら「デーモン型タスク」と「通常タス
ク」の2種類のタスクが混在するシステムにおいては、
従来の入れ替え処理では以下のような問題点がある。即
ち、共用サブルーチン入れ替え時に、サブルーチン入れ
替え処理部の処理がタスクの強制終了に固定されている
場合、「通常タスク」がコールするサブルーチンを入れ
替える際に、「通常タスク」が以後サブルーチンをコー
ルしなくとも、そのタスクを強制終了する。これは、そ
れまで実行していた「通常タスク」の処理結果を無効と
し、始めから処理を際実行しなければならず、処理効率
が低下する。
In a system in which two types of tasks, "daemon type task" and "normal task" are mixed,
The conventional replacement process has the following problems. That is, when the process of the subroutine replacement processing unit is fixed to the forced termination of the task when the shared subroutine is replaced, when the subroutine called by the "normal task" is replaced, the "normal task" does not have to call the subroutine thereafter. , Kill the task. This invalidates the processing result of the "normal task" that has been executed until then, and the processing must be re-executed from the beginning, resulting in a decrease in processing efficiency.

【0009】また逆に、共用サブルーチン入れ替え時
に、サブルーチン入れ替え処理部の処理がタスクの処理
終了待ちに固定されている場合、「デーモン型タスク」
がコールするサブルーチンを入れ替える際に、「デーモ
ン型タスク」は終了することはあり得ないにもかかわら
ず、そのタスクの終了を待ち続ける。従って、この待ち
時間は無駄になる。
On the contrary, if the processing of the subroutine replacement processing unit is fixed to the task completion waiting time when the shared subroutine is replaced, the "daemon type task" is executed.
The "daemon-type task" continues to wait for the end of the task when it replaces the subroutine called by the "daemon-type task". Therefore, this waiting time is wasted.

【0010】第二の例は、「排他制御命令を有するタス
ク」と「排他制御命令を有さないタスク」が混在するシ
ステムにおけるサブルーチン入れ替え処理である。「排
他制御命令を有するタスク」とは、共有データ、共有デ
ータベースなどを排他的にアクセスするために、排他制
御命令を使用するタスクである。排他制御命令には、共
有データを独占するロックと、共有データを解放するア
ンロック命令がある。「排他制御命令を有さないタス
ク」とは、排他制御命令を使用しないタスクである。
The second example is subroutine replacement processing in a system in which "tasks having exclusive control instructions" and "tasks not having exclusive control instructions" coexist. The "task having an exclusive control instruction" is a task that uses the exclusive control instruction to exclusively access shared data, a shared database, and the like. The exclusive control instruction includes a lock for monopolizing shared data and an unlock instruction for releasing shared data. The “task having no exclusive control instruction” is a task that does not use an exclusive control instruction.

【0011】これら2種類のタスクが混在するシステム
においては、従来の入れ替え処理では次のような問題点
がある。共用サブルーチン入れ替え時に、サブルーチン
入れ替え処理部の処理がタスクの強制終了に固定されて
いる場合、「排他制御命令を有するタスク」がコールす
るサブルーチンを入れ替える際に、該タスクが共有デー
タをロックしている場合でもこのタスクを強制終了する
ため、該タスクが占有していた共有データをアンロック
するタスクが存在しなくなる。そのため、以後この共有
データを使用しようするタスクはすべて共有データを使
用できない状態に陥る。
In a system in which these two types of tasks coexist, the conventional replacement processing has the following problems. When the processing of the subroutine replacement processing unit is fixed to the forced termination of the task when the shared subroutine is replaced, the shared data is locked by the task when the subroutine called by the "task having the exclusive control instruction" is replaced. Even in this case, since this task is forcibly terminated, there is no task that unlocks the shared data occupied by the task. Therefore, all the tasks that try to use the shared data thereafter fall into a state where the shared data cannot be used.

【0012】また逆に、共用サブルーチン入れ替え時
に、サブルーチン入れ替え処理部の処理がタスクの処理
終了待ちに固定されている場合、「排他制御命令を有さ
ないタスク」がコールするサブルーチンを入れ替える
時、「排他制御命令を有さないタスク」はデッドロック
状態になることはあり得ないにもかかわらず、そのタス
クの終了を待ち続ける。従って、この待ち時間は無駄で
ある。
On the contrary, when the processing of the subroutine replacement processing unit is fixed at the end of the processing of the task at the time of the replacement of the shared subroutine, when the subroutine called by the "task having no exclusive control instruction" is replaced, Although a task that does not have an exclusive control instruction cannot enter a deadlock state, it continues to wait for the end of the task. Therefore, this waiting time is useless.

【0013】このように、公知の共用サブルーチン入れ
替えシステムでは、捜査の対象となるタスクの性質を考
慮することがなかったため、タスクに対する処理とタス
ク種別の組み合わせによっては、システムにとって大き
なオーバヘッドが発生するという問題点があった。
As described above, in the known shared subroutine replacement system, since the nature of the task to be investigated is not taken into consideration, a large overhead occurs in the system depending on the combination of the processing for the task and the task type. There was a problem.

【0014】本発明の目的は、共用サブルーチンを入れ
替える際に、上記の如きオーバーヘッドを削減し効率の
良い共用サブルーチン入れ替えシステムを提供すること
である。
An object of the present invention is to provide a system for exchanging shared subroutines which is efficient and reduces the above overhead when exchanging shared subroutines.

【0015】[0015]

【課題を解決するための手段】上記目的を達成するため
に、本発明の共用サブルーチン入れ替えシステムは、ユ
ーザのプログラムを実行するタスクと、タスク間で共有
して実行可能なプログラムである共有サブルーチンと、
該共用サブルーチンを格納するサブルーチン格納部と、
当該サブルーチン格納部に格納されるサブルーチンを入
れ替えるサブルーチン入れ替え手段と、タスクの実行開
始処理と実行終了処理を行なうタスク管理手段を有する
計算機システムにおいて、上記サブルーチン入れ替え手
段は、サブルーチンの入れ替えコマンドが実行された時
にサブルーチンがタスクにより使用中であった場合に、
当該タスクに対する対処をタスクの性質に基づき指定す
るサブルーチン入れ替え処理指示記録手段を有し、上記
タスク管理手段は、タスクがコールしようとするサブル
ーチンについて入れ替え処理が実行中かどうかを判定
し、入れ替え処理中ならばそのタスクの処理を中断、ま
たは強制終了し、上記サブルーチン入れ替え手段は、入
れ替えようとするサブルーチンの使用状況を判定し、サ
ブルーチンがタスクに使用されておらず、かつサブルー
チン入れ替え処理記録手段に指定がない場合、入れ替え
処理を行ない、これ以外の場合には、指示に従ってタス
クの強制終了行うか又は、タスクが終了して入れ替え処
理可能になるまでサブルーチン入れ替え処理を延期する
ことを特徴としている。
In order to achieve the above-mentioned object, a shared subroutine replacing system of the present invention comprises a task for executing a user program and a shared subroutine which is a program that can be shared among tasks. ,
A subroutine storage unit for storing the shared subroutine,
In a computer system having a subroutine replacement means for replacing subroutines stored in the subroutine storage part and a task management means for performing task execution start processing and task execution end processing, the subroutine replacement means executes a subroutine replacement command. Sometimes when a subroutine is in use by a task,
It has a subroutine replacement processing instruction recording means for designating the handling of the task based on the nature of the task, and the task management means judges whether the replacement processing is being executed for the subroutine to be called by the task, and the replacement processing is in progress. If so, the processing of the task is interrupted or forcibly terminated, and the subroutine replacement means determines the usage status of the subroutine to be replaced, the subroutine is not used for the task, and is designated as the subroutine replacement processing recording means. If there is not, the replacement process is performed, and in other cases, the task is forcibly terminated according to the instruction, or the subroutine replacement process is postponed until the task ends and the replacement process becomes possible.

【0016】[0016]

【作用】本発明によれば、共用サブルーチン入れ替え処
理を行うときには、現在実行中のタスクがその共用サブ
ルーチンを使用していないか確認し、もし使用していれ
ば、タスク毎にその性質に基づき指定されたサブルーチ
ン入れ替え処理指示記録部の指示に従って、タスクの終
了を待つか、タスクを強制終了させるかを選択する。
According to the present invention, when the shared subroutine replacement processing is performed, it is confirmed whether or not the task currently being executed is using the shared subroutine, and if so, the task is designated based on the nature of each task. According to the instruction of the executed subroutine replacement processing instruction recording unit, whether to wait for the end of the task or to forcibly terminate the task is selected.

【0017】上記により、例えば「通常タスク」「デー
モン型タスク」の如き性質の異なるタスクが混在するシ
ステムにおいてサブルーチン入れ替えが行われるとき、
「通常タスク」が実行中の場合は、タスクの終了までサ
ブルーチン入れ替えが延期される。このため、「通常タ
スク」の途中までの処理結果が、無駄に破棄されること
がなくなる。また、「デーモン型タスク」が実行中の場
合には、すぐにタスクを強制終了させサブルーチン入れ
替えを行う。このため、サブルーチン入れ替え処理のた
めに「デーモン型タスク」の終了を無駄に待つような状
況が発生しなくなり、効率の良い共用サブルーチン入れ
替えシステムを実現することが出来る。
According to the above, when the subroutine replacement is performed in a system in which tasks having different properties such as "normal task" and "daemon type task" are mixed,
When the "normal task" is being executed, the replacement of subroutines is postponed until the task is completed. Therefore, the processing results up to the middle of the “normal task” are not discarded unnecessarily. If the "daemon-type task" is being executed, the task is immediately terminated and the subroutine is replaced. Therefore, the situation of wastefully waiting for the end of the "daemon-type task" for the subroutine replacement processing does not occur, and an efficient shared subroutine replacement system can be realized.

【0018】[0018]

【実施例】本発明における一実施例を、「通常タスク」
及び「デーモン型タスク」が混在するシステムにおける
サブルーチン入れ替えシステムの例で説明する。このシ
ステムでは、サブルーチン入れ替え時に「通常タスク」
が実行中の場合は、タスクの終了までサブルーチン入れ
替えを延期する。また、「デーモン型タスク」が実行中
の場合には、すぐにタスクを強制終了させサブルーチン
を入れ替える。
[Embodiment] One embodiment of the present invention is a "normal task".
And an example of a subroutine replacement system in a system in which "daemon type tasks" are mixed. In this system, when changing subroutines, "normal task"
If is being executed, the replacement of subroutines is postponed until the end of the task. If the "daemon type task" is being executed, the task is immediately terminated and the subroutines are replaced.

【0019】まず図1に、本発明の共用サブルーチン入
れ替えシステムの構成を示す。タスク1、2は、ユーザが
記述したプログラムやシステムが定めたプログラム処理
を行い、必要な場合には共用サブルーチン31〜33を呼び
出して実行する。各々のタスクは一意に区別可能なよう
にタスクの識別情報を持っている。タスクの識別情報と
しては、タスク番号等がある。なお、図1において「破
線」矢印はデータの移動を示し、「実線」矢印は制御情
報の移動を示している。
First, FIG. 1 shows the configuration of a shared subroutine replacing system of the present invention. Tasks 1 and 2 perform a program described by the user or a program defined by the system, and call and execute shared subroutines 31 to 33 when necessary. Each task has task identification information so that it can be uniquely distinguished. The task identification information includes a task number and the like. In addition, in FIG. 1, a "broken line" arrow indicates a movement of data, and a "solid line" arrow indicates a movement of control information.

【0020】共用サブルーチンは、タスク間で共用され
自由に実行可能なプログラムである。共用サブルーチン
には、内部に単一のサブルーチンしか持たないシングル
エントリサブルーチンと、複数のサブルーチンを保持す
るマルチエントリサブルーチンがある。本実施例では、
全ての共用サブルーチンがシングルエントリサブルーチ
ンであるとして説明するが、本発明はマルチエントリサ
ブルーチンの場合でも適用できることは明らかである。
サブルーチン31〜33は、タスクの識別情報と同様に一意
に区別可能な様にサブルーチンの識別子を持っている。
このサブルーチンの識別子としては、サブルーチン番号
がある。本実施例においては、共用サブルーチンは「lo
ad」コマンドによりロード、「deload」コマンドにより
デロードされる。ロードとはディスク等外部記憶装置上
にある共用サブルーチンのファイルをメモリ上にコピー
することである。また、デロードとは、ロードされた共
用サブルーチンをメモリ上から消すことである。また、
タスク開始処理は「queue」、終了処理は「abort」とい
うコマンドで実現されているものとする。
The shared subroutine is a program which is shared between tasks and can be freely executed. The shared subroutine includes a single-entry subroutine having only a single subroutine inside and a multi-entry subroutine having a plurality of subroutines. In this embodiment,
Although all shared subroutines are described as being single-entry subroutines, it is clear that the present invention is also applicable in the case of multi-entry subroutines.
Each of the subroutines 31 to 33 has a subroutine identifier so that it can be uniquely identified like the task identification information.
The subroutine number is a subroutine number. In this embodiment, the shared subroutine is "lo
It is loaded by the "ad" command and unloaded by the "deload" command. Loading is copying a file of a shared subroutine on an external storage device such as a disk onto a memory. Further, unloading means erasing the loaded shared subroutine from the memory. Also,
It is assumed that the task start process is realized by the command “queue” and the end process is realized by the command “abort”.

【0021】コマンドインタプリタ6は、ユーザ13がマ
ウス125やキーボード126で入力したコマンドを解釈す
る。コマンドインタプリタ6は、「load」コマンド、「d
eload」コマンドを受け取った時には、解釈したコマン
ドと引数をサブルーチン入れ替え手段15に渡す。また、
「queue」コマンド、「abort」コマンドを受けた時は、
タスク管理手段14にコマンドと引き数を渡す。なお「lo
ad」コマンドでは共用サブルーチンのファイル名とサブ
ルーチン識別子を、「deload」コマンドではサブルーチ
ン識別子を引き数として指定する。
The command interpreter 6 interprets a command input by the user 13 with the mouse 125 or the keyboard 126. The command interpreter 6 uses the "load" command, "d"
When the "eload" command is received, the interpreted command and argument are passed to the subroutine exchanging means 15. Also,
When you receive the "queue" command or the "abort" command,
Pass the command and arguments to the task management means 14. Note that "lo
The "ad" command specifies the file name and subroutine identifier of the shared subroutine, and the "deload" command specifies the subroutine identifier as an argument.

【0022】共用サブルーチンの入れ替えを行うサブル
ーチン入れ替え手段15は、サブルーチン入れ替え部4、
サブルーチン入れ替え処理指示記録部5、サブルーチン
使用記録部9、サブルーチン入れ替え記録部11を有して
いる。サブルーチン入れ替え手段15はコマンドインタプ
リタ11からコマンドとサブルーチン識別子を受けとる
と、サブルーチン入れ替え部4によって「load」「deloa
d」コマンドを実行する。
The sub-routine exchanging means 15 for exchanging the common sub-routine comprises the sub-routine exchanging unit 4,
It has a subroutine replacement processing instruction recording unit 5, a subroutine use recording unit 9, and a subroutine replacement recording unit 11. Upon receiving the command and the subroutine identifier from the command interpreter 11, the sub-routine exchanging means 15 causes the sub-routine exchanging unit 4 to execute “load” and “deloa”.
d) command.

【0023】タスクの走行状態を管理するタスク管理手
段14は、タスクの開始処理と終了処理を行うタスク管理
部10を有しており、コマンドインタプリタ6や、サブル
ーチン入れ替え部4から呼び出される。「queue」、「ab
ort」コマンドを受け取ったタスク管理手段14では、引
数として指定された実行開始するタスクや、実行終了す
るタスクのタスク番号に基づき、タスク管理部10が指定
されたタスク番号を持つタスクの開始処理と終了処理を
行う。
The task managing means 14 for managing the running state of the task has a task managing section 10 for carrying out task start processing and task end processing, and is called from the command interpreter 6 and the subroutine replacing section 4. "Queue", "ab
In the task management means 14 receiving the "ort" command, the task management unit 10 performs the start processing of the task having the specified task number based on the task number of the task specified as an argument to start the execution or the task to end the execution. Perform termination processing.

【0024】また、サブルーチン格納部3は、ディスク
等外部記憶装置に存在するサブルーチンファイル格納部
8に格納された共用サブルーチンのファイルをロードす
るためのメモリ上の領域を表している。
The subroutine storage unit 3 is a subroutine file storage unit existing in an external storage device such as a disk.
It represents the area on memory for loading the shared subroutine file stored in 8.

【0025】図3に、上記本発明における一実施例を計
算機12上で実現したときの構成例を示す。タスク1、2
と、共用サブルーチン入れ替え部4がディスク123からメ
モリ122に読み出される。その後メモリ122上にタスク状
態記録部7、サブルーチン入れ替え記録部11、サブルー
チン入れ替え処理指示記録部7、サブルーチン格納部3の
ための領域を確保する。そして、これらのタスクやサブ
ルーチン入れ替え部をプロセッサ121が実行する。図3
では、全てのサブルーチン31〜33やタスク1、2及び共用
サブルーチン入れ替え部4が連続したメモり上に存在す
る構成として表されているが、これらは不連続のメモり
上に存在することも可能であるし、また全てが同時にメ
モリ上に存在する必要はなく必要に応じてメモリ上に存
在すればよい。更に、本実施例の計算機は入出力装置と
してディスプレイ124、マウス125、キーボード126、プ
リンタ127を備えているが、入出力装置はこれらに限ら
れないし、又これらを全て備えている必要はない。
FIG. 3 shows an example of the configuration when one embodiment of the present invention is realized on the computer 12. Task 1, 2
Then, the shared subroutine replacement unit 4 is read from the disk 123 to the memory 122. Thereafter, areas for the task state recording unit 7, the subroutine replacement recording unit 11, the subroutine replacement processing instruction recording unit 7, and the subroutine storage unit 3 are secured in the memory 122. Then, the processor 121 executes these tasks and the subroutine replacement unit. FIG.
Shows that all the subroutines 31 to 33, tasks 1 and 2 and the shared subroutine replacing section 4 exist on a continuous memory, but these can also exist on a discontinuous memory. In addition, it is not necessary that all of them exist in the memory at the same time, and they may all exist in the memory as needed. Further, the computer of this embodiment is provided with the display 124, the mouse 125, the keyboard 126, and the printer 127 as input / output devices, but the input / output devices are not limited to these, and it is not necessary to have all of them.

【0026】図4に、サブルーチン入れ替え記録部11の
構成について示す。サブルーチン入れ替え記録部11は、
各サブルーチン31〜33に対応してサブルーチンの実行が
許可されているか否かを示す領域111〜113を有してい
る。各領域111〜113は対応するサブルーチンが使用許可
の場合には「1」、使用不許可の場合には「0」が記録
される。従って、共用サブルーチンがロードされていれ
ば「1」、デロードされていれば、「0」がそれぞれ格
納される。
FIG. 4 shows the configuration of the subroutine replacement recording unit 11. Subroutine replacement recording unit 11,
Corresponding to each of the subroutines 31 to 33, it has areas 111 to 113 indicating whether or not execution of the subroutine is permitted. In each of the areas 111 to 113, "1" is recorded when the use of the corresponding subroutine is permitted, and "0" is recorded when the use is not permitted. Therefore, "1" is stored if the shared subroutine is loaded, and "0" is stored if the shared subroutine is unloaded.

【0027】サブルーチン使用記録部9は図5に示すよ
うに、各タスク1、2がリンクする全共用サブルーチンを
記録する領域の列92〜94と、共用サブルーチンに対応し
てサブルーチン識別子を記録する列91を有している。本
実施例ではサブルーチン使用記録部9はビット列で実現
し、タスクがリンクするサブルーチンを記録する列の各
々の値は、サブルーチンが使用状態である場合には
「1」、未使用状態である場合には「0」が記録され
る。サブルーチン使用記録部9の内容は全て前もって初
期化されているものとする。例えば、タスクのコンパイ
ルあるいは共用サブルーチンのリンク時に、タスクが使
用する共用サブルーチンのサブルーチン識別子とタスク
番号をユーザに指定させ、これをサブルーチン使用記録
部のファイルに記録しておくことによっても初期化が可
能である。
As shown in FIG. 5, the subroutine use recording section 9 has columns 92 to 94 of an area for recording all shared subroutines linked to each task 1 and 2, and a column for recording a subroutine identifier corresponding to the shared subroutine. Has 91. In the present embodiment, the subroutine use recording unit 9 is realized by a bit string, and the value of each of the columns that record the subroutine linked by the task is "1" when the subroutine is in use, and the value when the subroutine is not in use. Is recorded as "0". It is assumed that the contents of the subroutine use recording unit 9 are all initialized in advance. For example, when compiling a task or linking a shared subroutine, the user can specify the subroutine identifier and task number of the shared subroutine used by the task, and this can also be initialized by recording this in a file in the subroutine use recording section. Is.

【0028】図6に、サブルーチン入れ替え処理指示記
録部5の構造について示す。サブルーチン入れ替え処理
指示記録部5は、各タスク1、2が走行状態の時に、タス
クがリンクするサブルーチンが「deload」される場合、
そのタスクを強制終了させるか、そのサブルーチンの終
了まで「deload」を停止するかの指示をタスク毎に記録
する。前者の場合は「KILL」、後者の場合は「WAIT」が
各タスクの対応する領域に記録される。
FIG. 6 shows the structure of the subroutine replacement processing instruction recording unit 5. When each of the tasks 1 and 2 is in the running state, when the subroutine to which the tasks are linked is "deloaded",
An instruction to forcibly terminate the task or stop "deload" until the end of the subroutine is recorded for each task. In the former case, "KILL" is recorded, and in the latter case, "WAIT" is recorded in the corresponding area of each task.

【0029】図7に、タスク状態記録部7の構造につい
て示す。タスク状態記録部7は、各タスク1、2毎に該タ
スクが走行状態か、停止状態かを示す領域71〜73を有し
ている。そして各領域には対応するタスクが走行状態な
らば「1」、停止状態ならば「0」が記録される。
FIG. 7 shows the structure of the task status recording unit 7. The task state recording unit 7 has areas 71 to 73 indicating whether the task is a running state or a stopped state for each of the tasks 1 and 2. In each area, "1" is recorded when the corresponding task is in the running state, and "0" is recorded when the corresponding task is in the stopped state.

【0030】以下、タスクが実行を開始した後、共用サ
ブルーチンを実行し、タスクの処理を停止するまでの処
理手順を説明する。その後、サブル−チンのロード、デ
ロードを行うコマンド処理の処理手順について説明す
る。
The processing procedure from execution of the task to execution of the shared subroutine to stop of the task processing will be described below. Then, a processing procedure of command processing for loading and unloading a subroutine will be described.

【0031】A.タスクの処理手順 以下図1において、ユーザのコマンド「queue」、また
は、システムの他の管理部から「queue」がコールされ
てタスク1が実行を開始し、続いてタスクが終了する手
順について説明する。なおここでは図4〜7に示すよう
に、タスク1はサブルーチン31、32をリンクするものと
して説明する。
A. Task Processing Procedure In FIG. 1, a procedure in which a user command “queue” or “queue” is called from another management unit of the system, task 1 starts execution, and then the task ends is described. . Here, as shown in FIGS. 4 to 7, it is assumed that task 1 links subroutines 31 and 32.

【0032】タスク1を正常に動作させるためには、タ
スク1の使用するサブルーチン31、32が、事前にサブル
ーチン格納部3にロードされなければならない。ここで
は、システムを操作するユーザがコマンドインタプリタ
6にサブルーチン31、32の「load」を発行することによ
って、既にサブルーチン31、32がロードされているもの
とする。
In order for the task 1 to operate normally, the subroutines 31 and 32 used by the task 1 must be loaded in the subroutine storage unit 3 in advance. Here, the user operating the system is the command interpreter.
It is assumed that the subroutines 31 and 32 have already been loaded by issuing "load" of the subroutines 31 and 32 to 6.

【0033】タスク実行開始直後、最初に処理の制御は
タスク管理部10に移り、このタスク管理部10によりコマ
ンド「queue」が実行される。この「queue」コマンドの
フローチャートを図8に示す。
Immediately after the start of task execution, control of the process is first transferred to the task management unit 10, and the task management unit 10 executes the command "queue". A flowchart of this "queue" command is shown in FIG.

【0034】(1)タスクの種別を判定し、サブルーチ
ン入れ替え処理指示記録手段5の該当タスクの領域に、
タスクがコールするサブルーチンが「deload」される場
合の処理を記録する。「デーモン型タスク」の場合は、
タスクを強制終了させないと入れ替えられないので、
「KILL」を記録する。「通常タスク」の場合はその終了
まで「deload」を停止するだけでよいので「WAIT」を記
録する(801)。
(1) The type of task is determined, and the area of the corresponding task of the subroutine replacement processing instruction recording means 5 is
Records the process when the subroutine called by the task is "deloaded". In the case of "daemon type task",
If you do not kill the task, you can not replace it,
Record "KILL". In the case of a "normal task", "WAIT" is recorded because it is sufficient to stop "deload" until the end (801).

【0035】(2)サブルーチン使用記録部9から、当
該タスクの使用するサブル−チン番号を1つ読み込む
(802)。
(2) One subroutine number used by the task is read from the subroutine use recording unit 9 (802).

【0036】(3)サブル−チン入れ替え記録部11によ
り、当該サブル−チン番号に対応する領域が1(使用許
可)か否かを調べる(803)。0(使用不許可)なら
ば、タスクは実行を継続することは不可能なので、エラ
ー処理を行い終了する。1(使用許可)ならば、処理
(4)を実行する。
(3) The subroutine replacement recording unit 11 checks whether or not the area corresponding to the subroutine number is 1 (use permitted) (803). If the value is 0 (use not permitted), the task cannot continue execution, so error processing is performed and the task ends. If 1 (use permitted), the process (4) is executed.

【0037】(4)上記(1),(2),(3)の処理
を、サブルーチン使用記録部9に記録されているサブル
ーチン識別子全てについて繰り返して行った後(80
4)、タスク状態記録部の該当タスクの領域を1(走行
状態)にセットする。
(4) After repeating the processes of (1), (2), and (3) for all the subroutine identifiers recorded in the subroutine use recording section 9, (80)
4) Set the area of the relevant task in the task status recording section to 1 (running status).

【0038】(5)タスクの実体を生成する(805)。(5) The substance of the task is generated (805).

【0039】ここで、処理(1)におけるタスクの種別
の判定方式の一例を示す。「デーモン型タスク」は、他
のタスクからの処理要求を読み込むための命令を含んで
いる。ユニックスではシグナル、ソケット、共用メモリ
などの機能を使用して処理要求を読み込む。そして処理
要求が存在しない場合は「デーモン型タスク」は休止状
態となる。本実施例では、要求読み込みと、要求がない
場合に休止状態となる動作を「qwait」というシステム
コールにより行うものとする。通常「デーモン型タス
ク」では、この「qwait」が無限ループで囲まれてい
る。そこで、タスクのソースプログラムをコンパイルす
る際に、ループで囲まれた「qwait」を検出した場合、
そのタスクは「デーモン型タスク」と判定することにす
る。そして、その「デーモン型タスク」と判定されたタ
スクのオブジェクトファイルのヘッダに、タスク種別を
表わす領域を生成し「デーモン型タスク」と記録する。
An example of a task type determination method in the process (1) will be described below. The "daemon type task" includes an instruction for reading a processing request from another task. On Unix, processing requests are read using functions such as signals, sockets, and shared memory. When there is no processing request, the "daemon type task" is in the dormant state. In the present embodiment, it is assumed that the request read and the operation to enter the sleep state when there is no request are performed by the system call "qwait". Usually, in "daemon type task", this "qwait" is surrounded by an infinite loop. So when compiling the source program of the task, if "qwait" surrounded by a loop is detected,
The task is decided to be a "daemon type task". Then, an area indicating the task type is generated in the header of the object file of the task determined to be the "daemon type task" and recorded as "daemon type task".

【0040】一方、ループで囲まれた「qwait」が検出
できなかった場合、そのタスクは「通常タスク」と判定
し、オブジェクトコードのヘッダに「通常タスク」と記
録する。そして(1)では、オブジェクトファイルのヘッ
ダにあるタスク種別を表す領域を参照することにより、
タスクが「デーモン型タスク」であるか「通常タスク」
であるかを判別する。
On the other hand, when "qwait" enclosed by the loop cannot be detected, the task is determined to be a "normal task" and is recorded in the header of the object code as "normal task". And in (1), by referring to the area that represents the task type in the header of the object file,
Whether the task is a "daemon type task" or "normal task"
Is determined.

【0041】タスク管理部10の処理が終了すると、処理
は生成されたタスクに移る。そしてタスクの処理が終了
すると、タスク自身が「abort」をコールしてタスク管
理部の終了処理が行われる。「abort」コマンドのフロ
ーチャートを図9に示す。
When the processing of the task management unit 10 is completed, the processing moves to the created task. Then, when the processing of the task ends, the task itself calls "abort" to end the task management unit. A flowchart of the "abort" command is shown in FIG.

【0042】(1)タスク状態記憶部の当該タスクの領域
に、停止状態と記録する(901)。
(1) The stopped state is recorded in the task area of the task state storage section (901).

【0043】(2)タスクの実体を消滅する(902)。(2) The substance of the task is deleted (902).

【0044】本実施例では、共用サブルーチンの最初の
メモリへのロードはコマンドインタプリタ6からコマン
ドが入力されることで行うものとしている。しかし、計
算機の立ちあげ時に、全てのタスクについてサブルーチ
ン使用記録部9に登録されたサブルーチンをロードする
コマンドを発行させる方式も考えられる。例えばユニッ
クスではrcコマンドを用いて、計算機の立ちあげ時に
ロードコマンドを実行する方式がある。rcコマンドに
ついては「ユニックス4.3ビーエスディー(BSD)の設
計と実装(S.J.Leffler等著、丸善株式会社刊)」に詳
しい記載がある。
In this embodiment, the first loading of the shared subroutine into the memory is performed by the command input from the command interpreter 6. However, a method of issuing a command to load the subroutine registered in the subroutine use recording unit 9 for all the tasks at the time of starting the computer is also conceivable. For example, in Unix, there is a method of executing a load command when the computer is started up by using the rc command. The rc command is described in detail in "Unix 4.3 BSD Design and Implementation (SJ Leffler et al., published by Maruzen Co., Ltd.)".

【0045】 B.ロード、デロードのコマンドの処理手順 図1において、共用サブルーチンのロード、またはデロ
ードコマンドが入力された場合を例として本実施例を説
明する。
B. Load / Unload Command Processing Procedure In FIG. 1, the present embodiment will be described by taking as an example the case where a load / unload command of a shared subroutine is input.

【0046】まず、ユーザがキーボード125やその他の
入力装置にコマンド「load」、「deload」を入力する
と、コマンドインタプリタ6は、コマンドとその引き数
をサブルーチン入れ替え手段15に送り、制御をサブルー
チン入れ替え手段15に移す。サブルーチン入れ替え手段
15では該送られたコマンドをサブルーチン入れ替え部4
で処理する。サブルーチン入れ替え部4の「deload」の
動作を表すフローチャートを図10に示す。
First, when the user inputs the commands "load" and "deload" to the keyboard 125 or other input device, the command interpreter 6 sends the command and its argument to the subroutine exchanging means 15, and the control is executed to the subroutine exchanging means. Move to 15. Subroutine replacement means
In 15 the sent command is transferred to the subroutine changing section 4
To process. FIG. 10 is a flowchart showing the operation of the “deload” of the subroutine replacement unit 4.

【0047】(1)まず、サブル−チン入れ替え記録部
11の当該サブル−チン番号の領域を0(使用不可能)に
セットする(1001)。
(1) First, the subroutine replacement recording section
The area of the relevant subroutine number of 11 is set to 0 (unusable) (1001).

【0048】(2)サブルーチン使用記録部9の当該サ
ブル−チン番号の行から、あるタスクについて、そのタ
スクは当該サブルーチンを実行するか否かを検索する
(1002)。実行する場合は(3)に移る。そうでなけれ
ば(5)に移る。
(2) From the line of the subroutine number in the subroutine use recording unit 9, for a task, whether or not the task executes the subroutine is searched (1002). When executing, move to (3). If not, move to (5).

【0049】(3)そのタスクが実行状態であるかどう
か、タスク状態記録部7を検索する(1003)。実行状態
であれば、(4)に移る。そうでなければ(5)に移
る。
(3) The task status recording unit 7 is searched to see if the task is in the running status (1003). If it is in the execution state, move to (4). If not, move to (5).

【0050】(4)実行中のタスクに対する処理をどう
するかを、サブルーチン入れ替え指示処理記録部5の該
当タスクの領域から調べる(1004)。該当タスクの領域
が「KILL」であればタスク管理手段14によりタスクを強
制終了させ、「WAIT」であれば、該当タスクが終了する
まで待つ。その後(5)に移る。
(4) The processing for the task being executed is checked from the area of the task in the subroutine replacement instruction processing recording section 5 (1004). If the area of the relevant task is "KILL", the task management means 14 forcibly terminates the task, and if it is "WAIT", it waits until the relevant task is terminated. Then move to (5).

【0051】(5)上記(2),(3),(4)の処理
をタスク番号全てについて繰り返す(1005)。
(5) The above processes (2), (3) and (4) are repeated for all task numbers (1005).

【0052】(6)該当サブルーチンに割り当てられた
メモリ領域を解放する(1006)。
(6) The memory area allocated to the relevant subroutine is released (1006).

【0053】このようにして古い共用サブルーチンをメ
モリから削除する。
In this way, the old shared subroutine is deleted from the memory.

【0054】次に、図11にサブルーチン入れ替え部の
「load」動作のフローチャートを示す。
Next, FIG. 11 shows a flow chart of the "load" operation of the subroutine changing section.

【0055】(1)サブルーチン格納部3のうち、サブ
ルーチン識別子により指定された未使用のメモリ領域を
当該サブルーチンに割り当てる(1101)。その後、サブ
ルーチンファイル格納部8から、引き数で指定されたサ
ブル−チンファイルを読み込み、割り当てられたメモリ
領域にロードする(1102)。
(1) An unused memory area designated by the subroutine identifier in the subroutine storage unit 3 is allocated to the subroutine (1101). After that, the subroutine file specified by the argument is read from the subroutine file storage unit 8 and loaded into the allocated memory area (1102).

【0056】(2)サブルーチン入れ替え記録部7のサ
ブル−チン番号の領域を「1」(使用可能)にセットす
る(1103)。
(2) The subroutine number area of the subroutine replacement recording section 7 is set to "1" (usable) (1103).

【0057】この様にして、新たな共用サブルーチンに
入れ替える。
In this way, the new shared subroutine is replaced.

【0058】上述の本発明における一実施例において
は、「load」、「deload」コマンドが実行不可能な場合
にも、そのまま共用サブルーチン入れ替え処理は継続で
きるようになっていた。しかし、共用サブルーチンのロ
ード、デロード処理よりもタスクの実行を妨げないこと
の方が重要であるシステムの場合、「queue」コマンド
実行時にこのような処理を優先させるタスクに対して
は、サブルーチン入れ替え処理指示記録部5の対応する
領域に「ABORT」を記録する。そして、「deload」コマ
ンド実行の際、サブルーチン入れ替え処理指示記録部5
に「ABORT」が書かれているタスクの場合、「deload」
コマンドの処理を強制終了させることにする。これによ
り、処理を優先させなければならないタスクが存在する
システムにおいても、信頼性の高い共用サブルーチン入
れ替え処理を行うことが出来る。
In the above-described embodiment of the present invention, even when the "load" and "deload" commands cannot be executed, the common subroutine replacement process can be continued. However, in a system where it is more important not to hinder the execution of tasks than the loading and unloading of shared subroutines, subroutine replacement processing is performed for tasks that prioritize such processing when executing the "queue" command. “ABORT” is recorded in the corresponding area of the instruction recording unit 5. When the "deload" command is executed, the subroutine replacement processing instruction recording unit 5
If the task has "ABORT" written in, "deload"
Command processing will be terminated. As a result, it is possible to perform highly reliable shared subroutine replacement processing even in a system in which there is a task for which processing must be prioritized.

【0059】また、前記本発明の一実施例において、タ
スク毎のサブルーチン入れ替え処理時の動作指示は、オ
ブジェクトファイルを元に自動的に行うものとしてい
た。これに対して、サブルーチン入れ替え処理時のタス
クに対する処理の指示を、共用サブルーチン入れ替え処
理が発生したときに、必要に応じてユーザから与えるよ
うにすることも可能である。この実施例の構成を図12
に示す。
Further, in the above-described embodiment of the present invention, the operation instruction at the time of sub-routine replacement processing for each task is automatically given based on the object file. On the other hand, it is also possible to give a processing instruction to the task at the time of the subroutine replacement processing from the user as needed when the shared subroutine replacement processing occurs. The configuration of this embodiment is shown in FIG.
Shown in

【0060】この共用サブルーチン入れ替えシステム
は、サブルーチン入れ替え処理記録部5の代わりにメッ
セージ表示部16を持つ。そして、「deload」コマンドの
実行中に入れ替え対象のサブルーチンを使用しているタ
スクを発見すると、メッセージ表示部16により「タスク
を強制終了させる」か「タスクが終了するのを待つ」か
「コマンドを終了する」といった選択肢を画面に表示し
てユーザに処理を選択させる。そしてユーザの選択に従
って「deload」コマンドの処理を続行する。上記動作
は、図10のステップ1004の処理において、メッセージ
表示部が当該タスクに対する処理の選択肢をユーザに示
し、ユーザの選択に従って当該タスクを強制終了する
か、乃至は当該タスクの終了を待つか、あるいはコマン
ドを終了するかを選択するように変更することで実現で
きる。
This shared subroutine replacement system has a message display section 16 instead of the subroutine replacement processing recording section 5. Then, when a task that uses the subroutine to be replaced is found during execution of the "deload" command, the message display unit 16 displays "kill the task", "wait for the task to finish", or "command An option such as “End” is displayed on the screen and the user is prompted to select a process. Then, the processing of the "deload" command is continued according to the user's selection. In the operation described above, in the processing of step 1004 of FIG. 10, the message display unit shows the user the processing options for the task, and forcibly terminates the task according to the user's selection, or waits for the termination of the task. Alternatively, it can be realized by changing to select whether to terminate the command.

【0061】これにより、不用意なタスクの終了乃至は
サブルーチン入れ替え処理の遅延を防ぎ、効率の良い共
用サブルーチン入れ替え処理を行うことが出来る。
As a result, it is possible to prevent an inadvertent termination of a task or a delay in subroutine replacement processing, and to perform efficient shared subroutine replacement processing.

【0062】更に、前記本発明の一実施例においては、
共用サブルーチンはシングルエントリサブルーチンであ
るとして説明してきた。しかし、ユニックスなどの共用
ライブラリは、一般にマルチエントリサブルーチンであ
り、この場合について以下記述する。
Furthermore, in one embodiment of the present invention,
The shared subroutine has been described as being a single entry subroutine. However, shared libraries such as Unix are generally multi-entry subroutines, and this case is described below.

【0063】共用ライブラリの場合には、サブルーチン
毎ではなくライブラリ毎にサブルーチン識別子としてサ
ブルーチン番号を割り当てる。そして、サブルーチン使
用記録部9は各タスクがどのサブルーチンを使用するか
をサブルーチン毎にではなくライブラリ単位で記録す
る。また、「load」「deload」コマンドの入れ替え指定
単位は、各サブルーチン単位ではなくライブラリ単位と
する。このようにすることにより、マルチエントリの共
用サブルーチンライブラリをオンラインで効率良く入れ
替えるシステムを実現することができる。
In the case of a shared library, a subroutine number is assigned not as a subroutine but as a subroutine identifier for each library. Then, the subroutine use recording unit 9 records which subroutine each task uses, in each library, not in each subroutine. Also, the replacement designation unit of the "load" and "deload" commands is not the subroutine unit but the library unit. By doing so, it is possible to realize a system that efficiently replaces the multi-entry shared subroutine library online.

【0064】[0064]

【発明の効果】本発明によれば、共用サブルーチン入れ
替え処理を行うときには、現在実行中のタスクがその共
用サブルーチンを使用していないか確認し、もし使用し
ていれば、タスク毎に指定されたサブルーチン入れ替え
処理指示記録部の指示に従って、タスクの終了を待つ
か、タスクを強制終了させるかを選択する。
According to the present invention, when the shared subroutine replacement processing is performed, it is confirmed whether or not the task currently being executed is using the shared subroutine, and if so, the task is designated for each task. According to the instruction of the subroutine replacement processing instruction recording unit, it is selected whether to wait for the end of the task or to forcibly end the task.

【0065】上記により、例えば「通常タスク」「デー
モン型タスク」が混在するシステムにおいてサブルーチ
ン入れ替えが行われるとき、「通常タスク」が実行中の
場合は、タスクの終了までサブルーチン入れ替えが延期
される。このため、「通常タスク」の途中までの処理結
果が、無駄に破棄されることがなくなる。また、「デー
モン型タスク」が実行中の場合には、すぐにタスクを強
制終了させサブルーチン入れ替えを行う。このため、サ
ブルーチン入れ替え処理のために、「デーモン型タス
ク」の終了を無駄に待つような状況が発生しなくなる。
As described above, when the "normal task" is being executed in a system in which the "normal task" and the "daemon type task" are mixed, the subroutine replacement is postponed until the end of the task. Therefore, the processing results up to the middle of the “normal task” are not discarded unnecessarily. If the "daemon-type task" is being executed, the task is immediately terminated and the subroutine is replaced. For this reason, the situation of wastefully waiting for the end of the "daemon-type task" does not occur due to the subroutine replacement processing.

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

【図1】本発明のサブルーチン入れ替えシステムの構成
図である。
FIG. 1 is a configuration diagram of a subroutine replacement system of the present invention.

【図2】本発明の別のサブルーチン入れ替えシステムの
構成図である。
FIG. 2 is a configuration diagram of another subroutine replacement system of the present invention.

【図3】本発明のサブルーチン入れ替えシステムを計算
機上に実現した構成図の一例である。
FIG. 3 is an example of a configuration diagram in which a subroutine replacement system of the present invention is realized on a computer.

【図4】サブルーチン入れ替え記録部の構成図である。FIG. 4 is a configuration diagram of a subroutine replacement recording unit.

【図5】サブルーチン使用記憶部の構成図である。FIG. 5 is a configuration diagram of a subroutine use storage unit.

【図6】サブルーチン入れ替え処理指示記憶部の構成図
である。
FIG. 6 is a configuration diagram of a subroutine replacement processing instruction storage unit.

【図7】タスク状態記憶部の構成図である。FIG. 7 is a configuration diagram of a task state storage unit.

【図8】本発明にかかる実施例の動作を示すフローチャ
ートである。
FIG. 8 is a flowchart showing the operation of the embodiment according to the present invention.

【図9】本発明にかかる実施例の動作を示すフローチャ
ートである。
FIG. 9 is a flowchart showing the operation of the embodiment according to the present invention.

【図10】本発明にかかる実施例の動作を示すフローチ
ャートである。
FIG. 10 is a flowchart showing the operation of the embodiment according to the present invention.

【図11】本発明にかかる実施例の動作を示すフローチ
ャートである。
FIG. 11 is a flowchart showing the operation of the embodiment according to the present invention.

【符号の説明】[Explanation of symbols]

1,2…タスク、3…サブルーチン格納部、4…サブル
ーチン入れ替え部、5…サブルーチン入れ替え処理指示
記録部、6…コマンドインタプリタ、7…タスク状態記
録部、8…サブルーチンファイル格納部、9…サブルー
チン使用記録部、10…タスク管理部、11…サブルー
チン入れ替え記録部、12…計算機、14…タスク管理
手段、15サブルーチン入れ替え手段、16…メッセー
ジ表示部、31〜33…サブルーチン、125…マウ
ス、126…キーボード。
1, 2 ... Task, 3 ... Subroutine storage section, 4 ... Subroutine replacement section, 5 ... Subroutine replacement processing instruction recording section, 6 ... Command interpreter, 7 ... Task state recording section, 8 ... Subroutine file storage section, 9 ... Subroutine use Recording unit, 10 ... Task management unit, 11 ... Subroutine replacement recording unit, 12 ... Calculator, 14 ... Task management unit, 15 Subroutine replacement unit, 16 ... Message display unit, 31-33 ... Subroutine, 125 ... Mouse, 126 ... Keyboard .

───────────────────────────────────────────────────── フロントページの続き (72)発明者 齊藤 雅彦 茨城県日立市大みか町七丁目1番1号 株 式会社日立製作所日立研究所内 (72)発明者 中村 智明 茨城県日立市大みか町五丁目2番1号 株 式会社日立製作所大みか工場内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Masahiko Saito 7-1-1 Omika-cho, Hitachi City, Ibaraki Hitachi Ltd. Hitachi Research Laboratory (72) Inventor Tomoaki Nakamura 5-2 Omika-cho, Hitachi City, Ibaraki Prefecture No. 1 Stock company Hitachi Ltd. Omika factory

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】一つ以上のタスクと、タスク間で共有して
実行可能な共用サブルーチンと、該共用サブルーチンを
格納するサブルーチン格納部と、当該サブルーチン格納
部に格納された共用サブルーチンを入れ替えるサブルー
チン入れ替え手段と、タスクの実行開始処理と実行終了
処理を行なうタスク管理手段を有する、共用サブルーチ
ン入れ替えシステムにおいて、 該サブルーチン入れ替え手段は、サブルーチンの入れ替
えを行う際に、入れ替えの対象となるサブルーチンがタ
スクにより使用中であった場合の該サブルーチンを使用
するタスクに対する処理を指定するサブルーチン入れ替
え処理指示記録手段を有し、 該タスク管理手段は、タスクが使用するサブルーチンの
入れ替え処理が実行中か判定し、入れ替え処理中ならば
該サブルーチンを使用するタスクの処理を中断乃至は強
制終了し、 上記サブルーチン入れ替え手段は、入れ替えの対象とな
る共用サブルーチンの使用状況を判定し、当該共用サブ
ルーチンがタスクに使用されておらず、かつサブルーチ
ン入れ替え処理記録手段に指定がない場合、入れ替え処
理を行ない、それ以外の場合には、該サブルーチン入れ
替え処理指示記録手段に記録された指示に従って処理を
行うことを特徴とする、共用サブルーチン入れ替えシス
テム。
Claim: What is claimed is: 1. One or more tasks, a shared subroutine that can be shared and executed between tasks, a subroutine storage section for storing the shared subroutine, and a subroutine exchange for exchanging the shared subroutine stored in the subroutine storage section. In a shared subroutine replacement system having means and task management means for performing execution start processing and execution end processing of a task, the subroutine replacement means uses the subroutine to be replaced by the task when the subroutine is replaced. In the case of being in the middle, it has a subroutine replacement processing instruction recording means for designating the processing for the task that uses the subroutine, and the task management means judges whether the replacement processing of the subroutine used by the task is being executed, and the replacement processing If it's inside The processing for the task that uses the task is interrupted or forcibly terminated, the subroutine replacement means determines the usage status of the shared subroutine to be replaced, and the shared subroutine is not used for the task, and the subroutine replacement is performed. A shared subroutine replacement system, wherein the replacement processing is performed when no designation is made in the processing recording means, and in other cases, processing is performed according to the instruction recorded in the subroutine replacement processing instruction recording means.
【請求項2】一つ以上のタスクと、タスク間で共有して
実行可能な共用サブルーチンと、該共用サブルーチンを
格納するサブルーチン格納部とを有する計算機システム
における共用サブルーチン入れ替え方法であって、 共用サブルーチンを入れ替える際に、入れ替えの対象と
なるサブルーチンがタスクにより使用中であるか否かを
判定する判定処理と、 該判定処理により、該サブルーチンがタスクにより使用
中である場合は、該サブルーチンを使用するタスクの性
質により、該タスクに対する操作を決定する処理を有す
ることを特徴とする共用サブルーチン入れ替え方法。
2. A method for replacing a shared subroutine in a computer system, comprising: one or more tasks; a shared subroutine that can be shared by the tasks and executed; and a subroutine storage section for storing the shared subroutine. When substituting, the determination process that determines whether or not the sub-routine to be exchanged is in use by a task, and if the sub-routine is in use by a task by this determination process, the sub-routine is used A method for replacing a shared subroutine, characterized by having a process of determining an operation for the task depending on the nature of the task.
【請求項3】請求項2の共用サブルーチン入れ替え方法
における、前記サブルーチンを使用するタスクの性質
は、タスクが処理の終了後に自ら停止するか否かを元に
判定し、該タスクが処理の終了後に自ら停止する場合に
は、前記タスクに対する操作を決定する処理において該
タスクが停止するまでサブルーチンの入れ替えを中断す
ることを特徴とする共用サブルーチン入れ替え方法。
3. The shared subroutine replacing method according to claim 2, wherein the nature of the task using the subroutine is determined based on whether or not the task itself stops after the completion of the processing, and the task after the completion of the processing. A method for exchanging shared subroutines, characterized in that in the case of stopping itself, in the process of determining an operation for the task, the exchanging of subroutines is suspended until the task is stopped.
【請求項4】請求項3の共用サブルーチン入れ替え方法
において、上記タスクの性質はタスクのコンパイル時に
タスクのプログラムを元に判定しておくことを特徴とす
る共用サブルーチン入れ替え方法。
4. The shared subroutine replacement method according to claim 3, wherein the nature of the task is determined based on the task program at the time of compiling the task.
JP1452495A 1995-01-31 1995-01-31 Switching system and method for shared subroutine Pending JPH08212064A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1452495A JPH08212064A (en) 1995-01-31 1995-01-31 Switching system and method for shared subroutine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1452495A JPH08212064A (en) 1995-01-31 1995-01-31 Switching system and method for shared subroutine

Publications (1)

Publication Number Publication Date
JPH08212064A true JPH08212064A (en) 1996-08-20

Family

ID=11863510

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1452495A Pending JPH08212064A (en) 1995-01-31 1995-01-31 Switching system and method for shared subroutine

Country Status (1)

Country Link
JP (1) JPH08212064A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6374362B1 (en) 1998-01-14 2002-04-16 Nec Corporation Device and method for shared process control
US6546485B1 (en) 1998-03-13 2003-04-08 Hitachi, Ltd. Method for exchanging modules in operating system by using inheritance buffer presented in virtual space to store inherited information of old module and read by new module thereafter
JP2005165902A (en) * 2003-12-05 2005-06-23 Toyota Motor Corp Task management system
US8589930B2 (en) 2002-03-22 2013-11-19 Toyota Jidosha Kabushiki Kaisha Determining whether to execute a new task by deleting task objects of existing tasks
JP2015527676A (en) * 2012-09-12 2015-09-17 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method and apparatus for patching

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6374362B1 (en) 1998-01-14 2002-04-16 Nec Corporation Device and method for shared process control
US6546485B1 (en) 1998-03-13 2003-04-08 Hitachi, Ltd. Method for exchanging modules in operating system by using inheritance buffer presented in virtual space to store inherited information of old module and read by new module thereafter
US8589930B2 (en) 2002-03-22 2013-11-19 Toyota Jidosha Kabushiki Kaisha Determining whether to execute a new task by deleting task objects of existing tasks
JP2005165902A (en) * 2003-12-05 2005-06-23 Toyota Motor Corp Task management system
JP4682513B2 (en) * 2003-12-05 2011-05-11 トヨタ自動車株式会社 Task management system
US8151274B2 (en) 2003-12-05 2012-04-03 Toyota Jidosha Kabushiki Kaisha Task management system
JP2015527676A (en) * 2012-09-12 2015-09-17 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method and apparatus for patching
US10241813B2 (en) 2012-09-12 2019-03-26 International Business Machines Corporation Method and apparatus for patching

Similar Documents

Publication Publication Date Title
US4104718A (en) System for protecting shared files in a multiprogrammed computer
US6216179B1 (en) System for processing an I/O request using an old program while loading a new program which upon completion used to process the I/O request
US5526523A (en) Interface between operating system and operating system extension
US5717902A (en) Method and system for selectively applying an appropriate object ownership model
KR100413915B1 (en) Computer system based on microprocessor, its driving method and backup system therefor
JPS60147855A (en) Memory managing apparatus
JPH10301834A (en) Management method for shared memory
JPH08212064A (en) Switching system and method for shared subroutine
JPH08221372A (en) Free resource management device in distributed processing system
US6338054B1 (en) Channel interface re-connection controlling method and file controlling apparatus
US6842900B2 (en) Information processing apparatus executing processing corresponding to new thread by reusing arrangement for previous thread
JP2003308219A (en) Exclusive control system
JPH09185540A (en) Multi-process system
JP3460265B2 (en) Data transfer method between computers
JPH01126738A (en) System for control data set competition in execution of multiple job
JP3998604B2 (en) Computer device, agent execution continuation method, access restriction guarantee method, and program
JP2682495B2 (en) Disk controller
JPS5947341B2 (en) Dynamic exclusive control method for index sequential files
US6345312B1 (en) Selectively dummying a data pipe transparent to a writer application
JPH09269912A (en) Information processing method and information processor
JPH07175671A (en) Process managing system
JPH0546415A (en) Exclusive management control system
JPH01303537A (en) Exclusive control method for shared resources
JP2630215B2 (en) Method of deleting unnecessary file data while online
JPH0563824B2 (en)