[go: up one dir, main page]

JPH10124331A - Data processing method - Google Patents

Data processing method

Info

Publication number
JPH10124331A
JPH10124331A JP27588596A JP27588596A JPH10124331A JP H10124331 A JPH10124331 A JP H10124331A JP 27588596 A JP27588596 A JP 27588596A JP 27588596 A JP27588596 A JP 27588596A JP H10124331 A JPH10124331 A JP H10124331A
Authority
JP
Japan
Prior art keywords
thread
threads
processing
flag
data processing
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
JP27588596A
Other languages
Japanese (ja)
Inventor
Ikuko Yoshimoto
郁子 吉本
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.)
NEC Engineering Ltd
Original Assignee
NEC Engineering 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 NEC Engineering Ltd filed Critical NEC Engineering Ltd
Priority to JP27588596A priority Critical patent/JPH10124331A/en
Publication of JPH10124331A publication Critical patent/JPH10124331A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prevent a system from the lack of resources and the reduction of performance due to the increment of threads by reducing the number of stand-by threads up to the number of operating threads when the number of stand-by threads after parallel processing is larger than the number of threads required for system operation. SOLUTION: A thread program is entered. While referring to a common memory, whether a stand-by flag is ON or not is checked (S22). Just after the generation of a thread, a stand-by flag corresponding to the thread is OFF. Then processing data are acquired from the common memory and processing for executing parallel processing is executed (S25). Then whether a thread number in the common memory is smaller than a regulated value indicating the number of threads at the time of normal system operation or not is checked (S26). When the thread number is larger than the regulated value, a use/unused flag, a stand-by flag and processing data in the common memory are cleared (S28).

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、データ処理方法に
関し、特に、データ処理システムにおいてスレッドの生
成や削除などを管理する方法に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a data processing method, and more particularly, to a method of managing creation and deletion of a thread in a data processing system.

【0002】[0002]

【従来の技術】例えばコンピュータを用いたデータ処理
システムにおいて、メインプログラムの実行中に、並行
処理、例えば、メインプログラムの処理と並行して特定
の関数を実行する場合がある。上記並行処理は、例えば
スレッドを用いて行われる。このスレッドを用いる場
合、一度生成したスレッドを削除することなく再利用す
ることで、スレッドの生成時間を短縮・削減し、システ
ムにおける処理の高速化を図ることも試みられている。
このような技術については、例えば特開平4−2313
7号や特開平6−318191号公報などに開示されて
いる。このようなスレッドを用いた従来のデータ処理の
一例を、図6〜図8を用いて以下に説明する。
2. Description of the Related Art In a data processing system using a computer, for example, a specific function may be executed in parallel with the execution of a main program, for example, in parallel with the processing of the main program. The parallel processing is performed using, for example, a thread. When this thread is used, attempts have been made to reduce and reduce the thread generation time by reusing the once generated thread without deleting it, and to speed up the processing in the system.
For such a technique, see, for example,
7 and JP-A-6-318191. An example of conventional data processing using such a thread will be described below with reference to FIGS.

【0003】まず、図6において、リサイクル可能なス
レッドの個数をチェックする(ステップS31)。この
ような個数チェックは、図8のリサイクルスレッドカウ
ントGのカウント値から判別できる。そして、この個数
が0の場合には、リサイクル可能なスレッドが存在しな
いことから、ステップS36以降の処理に移行し、スレ
ッドの生成処理を行う。一方、上記の個数が0でなく、
リサイクル可能なスレッドが存在する場合は、スレッド
管理テーブルの先頭から各スレッドの使用/未使用フラ
グBを順次チェックし、これらの使用/未使用フラグの
状態をチェックする(ステップS32)。
First, in FIG. 6, the number of recyclable threads is checked (step S31). Such a number check can be determined from the count value of the recycle thread count G in FIG. If the number is 0, there is no recyclable thread, and the process shifts to step S36 and the subsequent steps to generate a thread. On the other hand, the above number is not 0,
If there is a recyclable thread, the use / unused flag B of each thread is checked sequentially from the top of the thread management table, and the status of these used / unused flags is checked (step S32).

【0004】そして、使用/未使用フラグがオフで未使
用のスレッドがある場合は、そのスレッドの使用/未使
用フラグをオン、つまり使用中にし(ステップS3
3)、また、図8の処理データDに処理に必要なデータ
をセット(ステップS34)する。さらに、図8のスレ
ッド番号(ハンドル値)Aに基づいてスレッドの再開処
理を行う(ステップS35)。
If the use / unused flag is off and there is an unused thread, the use / unused flag of the thread is turned on, that is, in use (step S3).
3) Further, data necessary for processing is set in the processing data D of FIG. 8 (step S34). Further, a thread resumption process is performed based on the thread number (handle value) A in FIG. 8 (step S35).

【0005】一方、使用/未使用フラグがオフで未使用
のスレッドが存在しない場合は、テーブルの先頭から上
記のリサイクル可能なスレッド個数分だけ飛ばした位置
にある、スレッド管理テーブル上の空きエリアを確保
し、この空きエリアにおける使用/未使用フラグを使用
中とする(ステップS36)。また、この空きエリア
に、スレッド番号として、スレッド管理テーブルの先頭
から何番目のエリアであったかをセットする(ステップ
S37)。そして、上記のようにスレッドが生成され、
リサイクル可能なスレッド数が増えたことから、図8の
リサイクルスレッドカウントGを+1する(ステップS
38)。
On the other hand, when the use / unused flag is off and there is no unused thread, an empty area in the thread management table at a position skipped by the number of recyclable threads from the top of the table is deleted. The used / unused flag in this empty area is set to be in use (step S36). Also, the number of the area from the top of the thread management table is set as the thread number in this empty area (step S37). And a thread is created as described above,
Since the number of recyclable threads has increased, the recycle thread count G in FIG. 8 is incremented by 1 (step S).
38).

【0006】次に、上記でセットしたエリアをスレッド
とメインプログラムとの共用メモリに指定するため、ス
レッド生成時において指定する共用メモリアドレスとし
て、データをセットしたスレッド管理テーブル内のエリ
アのアドレスを、図8のEのアドレスに割り当てる(ス
テップS39)。これにより、スレッドの生成処理が完
了し、その後、ステップS34とステップS35の処理
を行ってスレッドの実行の指示をする。
Next, in order to designate the area set as described above as a shared memory between the thread and the main program, the address of the area in the thread management table where the data is set is set as the shared memory address designated when the thread is created. It is assigned to the address E in FIG. 8 (step S39). As a result, the thread generation processing is completed, and thereafter, the processing of steps S34 and S35 is performed to instruct the execution of the thread.

【0007】ここで、共用メモリは、スレッドが参照し
て動作するためのものである。そして、スレッドを必要
とする場合には、管理テーブルから未使用のスレッドを
検索し、未使用スレッドに該当する管理テーブル内のエ
リアの使用/未使用フラグを使用中とし、スレッドの動
作に必要なデータを所定のエリア内にセットし、その
後、親スレッドが動作のトリガとして、そのスレッドの
リジウムを行い、処理動作を指示する。また、スレッド
は、割り当てられた親スレッドとの共用メモリエリアか
ら必要なデータを取得し、動作を開始する。さらに、こ
の共用メモリを書き替えることで、親スレッドはスレッ
ドに対して所定の動作を指示し実行させることができ
る。
Here, the shared memory is for a thread to operate by referring to it. If a thread is required, an unused thread is searched from the management table, the used / unused flag of the area in the management table corresponding to the unused thread is set to “in use”, and the thread required for the operation of the thread is used. Data is set in a predetermined area, and then the parent thread performs iridium of the thread as an operation trigger to instruct a processing operation. Further, the thread acquires necessary data from the shared memory area with the allocated parent thread and starts operation. Further, by rewriting the shared memory, the parent thread can instruct and execute a predetermined operation to the thread.

【0008】また、図7は、スレッドにおける並行処理
の手順を示したもので、スレッドは、スレッド用プログ
ラムを取り込んで並行処理の実行を開始する。まず、ス
レッドは、その生成後すぐに、それ自身をサスペンドし
て待機状態とする(ステップS42)。なお、サスペン
ドとは、スレッドを中断して再開可能な待機状態にする
ことをいう。そして、スレッドは、上記のような再開の
指示があった場合、共用メモリFから処理データを取得
し、並行処理を実行する(ステップS43)。さらに、
並行処理実行後は、処理データエリアをクリアし、使用
/未使用フラグBを未使用にセットし、再び待機状態に
なる(ステップS42)。
FIG. 7 shows a procedure of parallel processing in a thread. The thread fetches a thread program and starts executing the parallel processing. First, immediately after the thread is created, the thread suspends itself and enters a standby state (step S42). Note that suspending refers to suspending a thread to bring it into a resumable standby state. Then, when the above-described restart instruction is issued, the thread acquires the processing data from the shared memory F and executes the parallel processing (step S43). further,
After the execution of the parallel processing, the processing data area is cleared, the used / unused flag B is set to unused, and the apparatus enters the standby state again (step S42).

【0009】以上のようにして、全てのスレッドがリサ
イクル可能なスレッドとなり、また、使用されないとき
には常に待機状態となる。さらに、スレッドの削除は、
システムのシャットダウン時までは行われない。
As described above, all the threads become recyclable threads, and are always in a standby state when not used. In addition, thread deletion
Not done until the system shuts down.

【0010】[0010]

【発明が解決しようとする課題】ところで、上記のよう
なデータ処理システムにおいてシステムに負担がかかっ
た場合には、当然のことながら、スレッドの個数が通常
のシステム運用時の個数よりも増大する。そして、上記
従来の方法の場合、スレッドの個数は、例えば、図9の
ように、通常運用時の個数よりも増加する。
When a load is imposed on the data processing system as described above, the number of threads naturally becomes larger than that during normal system operation. Then, in the case of the above-mentioned conventional method, the number of threads is larger than the number during normal operation, for example, as shown in FIG.

【0011】ところが、この従来は、スレッドの個数が
増大した後に通常の運用に戻った場合、図9のようにス
レッドの個数が増大したままとなる。このため、使用さ
れない複数のスレッドが待機状態となって、システムの
資源を無駄に使用し続けるという問題があった。
However, in the prior art, when the normal operation is resumed after the number of threads increases, the number of threads remains increased as shown in FIG. For this reason, there has been a problem that a plurality of unused threads are in a standby state, and continue to use system resources unnecessarily.

【0012】また、スレッドは、待機状態であっても、
非常に少ない値ではあるがCPU時間を消費する。よっ
て、上記従来の手法では、システムに負荷がかかった後
に通常の運用に戻った際、待機状態のスレッドによるC
PU時間の消費量が増加してしまう。このため、通常の
運用に戻った際の運転時におけるシステムの処理性能の
低下を招くという問題もあった。
Further, even when the thread is in the standby state,
A very small value, but consumes CPU time. Therefore, according to the above-mentioned conventional method, when the system returns to the normal operation after the system is loaded, the waiting thread C
The consumption of PU time increases. For this reason, there is also a problem that the processing performance of the system during operation when returning to normal operation is reduced.

【0013】本発明は、上記のようなスレッドの増加に
よるシステムの資源不足や性能低下を防止できる、改良
されたデータ処理方法を提供することを課題としてい
る。
An object of the present invention is to provide an improved data processing method capable of preventing a shortage of system resources and a decrease in performance due to an increase in threads as described above.

【0014】[0014]

【課題を解決するための手段】本発明のデータ処理方法
は、所定のデータ処理システム上で複数のスレッドによ
り並行処理を行うデータ処理方法において、並列処理の
実行後に、前記データ処理システムのシステム運用に必
要となる規定値の個数のスレッドを並行処理が再開可能
な待機状態とし、前記規定値の個数を越えたスレッドを
並列処理の実行後に削除することを特徴とする。
A data processing method according to the present invention is a data processing method for performing parallel processing by a plurality of threads on a predetermined data processing system. The number of threads required for the process is set to a standby state in which parallel processing can be resumed, and threads exceeding the specified value are deleted after execution of parallel processing.

【0015】ここで、システム運用に必要となる規定値
の個数とは、システム上における通常の運用において使
用する任意の個数ないし規定値を意味する。このような
規定値は、システムに応じて変化するものであり、シス
テムに応じた任意の値とすれば良い。
Here, the number of prescribed values required for system operation means any number or prescribed value used in normal operation on the system. Such a specified value changes according to the system, and may be an arbitrary value according to the system.

【0016】つまり、本発明では、並行処理後における
待機スレッドの数がシステム運用に必要なスレッド(運
用スレッド)の数よりも多い場合には、待機スレッドの
数を運用スレッドの数まで削減するようにしたものであ
る。
That is, in the present invention, when the number of standby threads after the parallel processing is larger than the number of threads (operation threads) required for system operation, the number of standby threads is reduced to the number of operation threads. It was made.

【0017】上記のような並行処理実行後におけるスレ
ッドの削除を行うため、例えば、並列処理に使用される
各スレッドに対して所定のスレッド番号を順次設定する
とともに並行処理の実行直後に各スレッドのスレッド番
号と前記規定値とを比較し、スレッド番号が前記規定値
より大きいスレッドは削除し、スレッド番号が前記規定
値以下であるスレッドは前記待機状態とする、手順が用
いられる。
In order to delete a thread after the execution of the parallel processing as described above, for example, a predetermined thread number is sequentially set for each thread used for the parallel processing, and each thread is set immediately after the execution of the parallel processing. A procedure is used in which a thread number is compared with the specified value, a thread whose thread number is larger than the specified value is deleted, and a thread whose thread number is equal to or smaller than the specified value is placed in the standby state.

【0018】[0018]

【発明の実施の形態】以下に、本発明のデータ処理方法
の実施の形態を説明する。図1は、本発明が適用される
データ処理システムにおける処理の概要を示したもので
ある。そして、このメインプログラムの実行中におい
て、複数のスレッドにより並行処理を行う必要が生じた
場合には、メインプログラムにおいては以下に説明する
処理Aが、また各スレッド(スレッド1〜スレッドn)
においては以下に説明する処理Bがそれぞれ行われる。
Embodiments of the data processing method according to the present invention will be described below. FIG. 1 shows an outline of processing in a data processing system to which the present invention is applied. When it is necessary to perform parallel processing by a plurality of threads during execution of the main program, the processing A described below is performed in the main program, and each thread (thread 1 to thread n) is executed.
, The following processing B is performed.

【0019】まず、データ処理システムのメインプログ
ラムにおける処理Aについて、つまり、メインプログラ
ムにおけるスレッド管理処理について、図2を参照して
説明する。この処理は、次の(1)〜(4)のように行
われる。 (1) 並行処理が必要となった時は、リサイクルスレ
ッドカウントが0であるかをチェックするとともに、リ
サイクルスレッドが存在するかどうかをチェックする
(ステップS1)。
First, the processing A in the main program of the data processing system, that is, the thread management processing in the main program will be described with reference to FIG. This processing is performed as in the following (1) to (4). (1) When parallel processing is required, it is checked whether the recycle thread count is 0 and whether a recycle thread exists (step S1).

【0020】なお、リサイクルスレッドカウンタは、例
えば、図4に符号Gとして例示したように、データ処理
システムの所定のスレッド管理テーブルに設定されるも
ので、スレッド管理テーブル内におけるリサイクル可能
なスレッドの数を示すものである。また、このスレッド
管理テーブルには、このテーブルが管理しているスレッ
ドの数に対応するだけの共用メモリFがあり、各共用メ
モリFは、スレッド番号(ハンドル値)A、使用/未使
用フラグB、待機フラグC、処理データDがそれぞれ設
定されている。
The recycle thread counter is set in a predetermined thread management table of the data processing system, for example, as exemplified by reference numeral G in FIG. 4, and the number of recyclable threads in the thread management table is set. It shows. The thread management table has shared memories F corresponding to the number of threads managed by the table. Each shared memory F has a thread number (handle value) A, a used / unused flag B , The standby flag C, and the processing data D are set.

【0021】ここで、スレッド番号Aは、スレッド管理
テーブルにおいて管理されるスレッドに対して順次設定
される番号を示したものである。また、使用/未使用フ
ラグBは、各スレッドの使用状態を示すためのものであ
る。さらに、待機フラグCは、そのスレッドが生成直後
ではなくてリサイクル可能なスレッドであることを示す
ためのものである。さらに、処理データDは、メインプ
ログラムから並行処理に必要なデータをスレッドへ提供
するためのものである。
Here, the thread number A indicates a number sequentially set for the threads managed in the thread management table. The used / unused flag B is for indicating the use state of each thread. Further, the wait flag C is for indicating that the thread is not immediately after generation but a recyclable thread. Further, the processing data D is for providing data necessary for parallel processing from the main program to the thread.

【0022】そして、リサイクルカウンタが0であった
場合、つまり、リサイクルスレッドが存在しない場合に
は、以下の(4)の処理に進み、スレッドの生成処理を
行う。また、リサイクルカウンタが0でない場合には、
以下の(2)の処理に進み、利用可能なリサイクルスレ
ッドが存在するかどうかのチェックを行う。
If the recycle counter is 0, that is, if there is no recycle thread, the process proceeds to the following process (4) to execute a thread generation process. If the recycle counter is not 0,
Proceeding to the process of (2) below, it is checked whether or not there is a usable recycling thread.

【0023】(2) リサイクルスレッドカウントに対
応する数のスレッド管理テーブル内の使用/未使用フラ
グBをチェックする(ステップS2)。そして、未使用
のリサイクルスレッドがない場合は、下記(4)のスレ
ッド生成処理に進む。また、未使用のリサイクルスレッ
ドがある場合は、以下の(3)のリサイクルスレッドを
利用した処理へ進む。
(2) The used / unused flag B in the thread management table corresponding to the recycled thread count is checked (step S2). If there is no unused recycling thread, the process proceeds to the thread generation processing of (4) below. If there is an unused recycling thread, the process proceeds to the following (3) using a recycling thread.

【0024】(3) リサイクルスレッドの利用は、ま
ず、使用しようとしているスレッドの共用メモリに指定
される管理テーブルの待機フラグCをオンにする(ステ
ップS3)。次に、使用/未使用フラグBをオンにして
使用中とし(ステップS4)、並行処理に必要なデータ
を処理データDにセットし(ステップS5)、スレッド
を再開させる(ステップS6)。すると、スレッドは、
ステップS29より待機状態から解かれて再開され、図
3に示したリサイクル処理(S29)が行われる。
(3) To use a recycled thread, first, the standby flag C of the management table specified in the shared memory of the thread to be used is turned on (step S3). Next, the used / unused flag B is turned on to be used (step S4), data necessary for parallel processing is set in the processing data D (step S5), and the thread is restarted (step S6). Then the thread
The process is released from the standby state from step S29 and restarted, and the recycling process (S29) shown in FIG. 3 is performed.

【0025】(4)スレッドの生成処理は次のように行
われる。まず、使用しようとしているスレッドの共用メ
モリFの待機フラグCをオフにする(ステップS7)。
次に、その共用メモリFにおける使用/未使用フラグB
を使用中とする(ステップS8)。さらに、スレッド管
理テーブルの共有メモリFのスレッド番号Aをスレッド
番号Aを設定し、またた並行処理に必要なデータを処理
データDにセットする(ステップS9)。次に、今後こ
のスレッドをリサイクルスレッドとして利用するかどう
かの判断として、スレッド番号Aが、データ処理システ
ムにおいて通常使用するスレッド数(規定値)より大き
いかをチェックし(ステップS10)、小さい場合はリ
サイクルスレッドとして利用することから、スレッド管
理テーブルのリサイクルスレッドカウントGを+1する
(ステップS11)。そして、スレッド管理テーブルの
上記で設定およびセットを行ったエリアの共用メモリF
をメインプログラムとスレッドとの共用メモリに指定し
て、スレッドの生成を行う(ステップS12)。なお、
このようにして生成されたスレッドは、図3のステップ
S21から処理を開始する。
(4) The thread generation process is performed as follows. First, the waiting flag C of the shared memory F of the thread to be used is turned off (step S7).
Next, the used / unused flag B in the shared memory F
Is in use (step S8). Further, the thread number A of the shared memory F in the thread management table is set to the thread number A, and data necessary for the parallel processing is set in the processing data D (step S9). Next, as a determination as to whether or not this thread will be used as a recycling thread in the future, it is checked whether the thread number A is larger than the number of threads normally used in the data processing system (specified value) (step S10). Since it is used as a recycled thread, the recycled thread count G in the thread management table is incremented by 1 (step S11). Then, the shared memory F of the area set and set in the thread management table as described above.
Is designated as a shared memory between the main program and the thread, and a thread is generated (step S12). In addition,
The thread generated in this way starts processing from step S21 in FIG.

【0026】次に、各スレッド内での処理を、図3によ
り説明する。この処理は、スレッドの生成直後における
処理と、スレッドのリサイクル時における処理の2つに
分かれる。
Next, the processing in each thread will be described with reference to FIG. This process is divided into two processes, that is, a process immediately after thread creation and a process at the time of thread recycling.

【0027】まず、スレッドの生成直後におけるスレッ
ド内での処理は次の通りである。最初に、スレッド生成
処理として、スレッド用プログラムが取り込まれ、スレ
ッド生成処理が開始される(ステップS21)。次い
で、共用メモリFを参照して、待機フラグCがオンであ
るかどうかをチェックする(ステップS22)。ここ
で、スレッド生成直後においてはそのスレッドに対応す
る待機フラグCはオフになっている。そして、次に、共
用メモリFから処理データDを取得し、並行処理を実行
する処理が行われる(ステップS25)。
First, the processing in the thread immediately after the creation of the thread is as follows. First, as a thread generation process, a thread program is fetched, and the thread generation process is started (step S21). Next, it is checked whether or not the standby flag C is turned on with reference to the shared memory F (step S22). Here, immediately after thread creation, the waiting flag C corresponding to the thread is turned off. Then, processing for acquiring the processing data D from the shared memory F and executing the parallel processing is performed (step S25).

【0028】次いで、共用メモリFのスレッド番号Aが
通常のシステム運用時におけるスレッド数の規定値より
小さいかどうかをチェックする(ステップS26)。そ
して、スレッド番号Aが規定値よりも大きい場合は、そ
の共用メモリFにおける使用/未使用フラグB、待機フ
ラグC、並びに処理データDがそれぞれクリアされ、終
了する(ステップS28)。なお、使用/未使用フラグ
Bをクリアすることは、この共用メモリFを未使用にす
ることを意味する。また、処理データDをクリアするこ
とは、そのスレッドを削除することを意味する。
Next, it is checked whether or not the thread number A of the shared memory F is smaller than a specified value of the number of threads during normal system operation (step S26). If the thread number A is larger than the specified value, the used / unused flag B, the standby flag C, and the processing data D in the shared memory F are cleared, and the process ends (step S28). Clearing the used / unused flag B means that the shared memory F is unused. Clearing the processing data D means deleting the thread.

【0029】また、スレッド番号が規定値よりも小さい
か、または同じであった場合は、その共用メモリFにお
ける待機フラグCをオンにして(ステップS27)、ス
テップS22に処理が移行する。そして、ステップS2
2では、待機フラグCがオンであるので、リサイクル処
理であるステップS23、つまり、処理データDのクリ
アと使用/未使用フラグBを未使用にセットする処理が
行われる。次いで、ステップS24において、そのスレ
ッドはそれ自身をサスペンドして待機状態となる。
If the thread number is smaller than or equal to the specified value, the standby flag C in the shared memory F is turned on (step S27), and the process proceeds to step S22. Then, step S2
In step 2, since the standby flag C is ON, step S23 as a recycling process, that is, a process of clearing the processing data D and setting the use / unused flag B to unused is performed. Next, in step S24, the thread suspends itself and enters a standby state.

【0030】次に、スレッドのリサイクル時における処
理を説明する。この処理は、次の(11)〜(12)の
ように行われる。
Next, processing at the time of thread recycling will be described. This processing is performed as in the following (11) and (12).

【0031】(11) すなわち、リサイクル時におい
ては、スレッドはステップS29のサスペンドして待機
している状態から始まる。そして、メインプログラムか
ら待機が解除されるので、共用メモリFから処理データ
Dを取得し、並行処理を実行する(ステップS25)。
(11) That is, at the time of recycling, the thread starts from the state of suspending and waiting in step S29. Then, since the standby is released from the main program, the processing data D is acquired from the shared memory F, and the parallel processing is executed (step S25).

【0032】(12) 次いで、共用メモリのスレッド
番号Aが通常のシステム運用時におけるスレッド数の規
定値より小さいかどうかをチェックする(ステップS2
6)。そして、スレッド番号Aがこの規定値よりも以下
であるので、共用メモリFの待機フラグCをオンにして
(ステップS27)、ステップS22に処理を移す。そ
して、ステップS22において、待機フラグCがオンで
あるので、リサイクル処理であるステップS23とステ
ップS24が行われる。
(12) Next, it is checked whether or not the thread number A of the shared memory is smaller than a specified value of the number of threads during normal system operation (step S2).
6). Then, since the thread number A is smaller than the specified value, the standby flag C of the shared memory F is turned on (step S27), and the process proceeds to step S22. Then, in step S22, since the standby flag C is on, steps S23 and S24, which are recycling processes, are performed.

【0033】以上のように構成されるこの実施の形態の
データ処理方法では、システムに負荷が発生して一時的
にスレッド個数が図5のIのように増大しても、並列処
理の終了後は、図5でIIのように通常のシステム運用
に必要なスレッド以外は削除され、これら必要なスレッ
ドのみ待機状態となりリサイクル可能なスレッドとな
る。
In the data processing method according to this embodiment configured as described above, even if the system is overloaded and the number of threads temporarily increases as shown in FIG. As shown in II in FIG. 5, threads other than those necessary for normal system operation are deleted, and only those necessary threads are put into a standby state and become recyclable threads.

【0034】このため、従来のように必要のないスレッ
ドが待機状態でいるために使用されるCPU時間の消費
が削減されて、負荷発生後におけるシステムの性能低下
が防止できる。また、無駄なスレッドが生成され存在し
続けることで使用されるシステム資源の無駄使いがなく
なる、システムの有効な資源確保が行える。さらに、シ
ステムで正常時に必要なスレッドの数のスレッドを待機
状態でリサイクルする構成であるので、その分のスレッ
ドの生成や削除にかかる時間が削減されてシステムの性
能向上が図れる。
As a result, the consumption of CPU time used when unnecessary threads are in a standby state as in the related art is reduced, and a decrease in system performance after a load occurs can be prevented. In addition, effective use of system resources is eliminated by generating and continuing to useless threads, so that effective resources of the system can be secured. Further, since the system is configured to recycle a necessary number of threads in a standby state in a normal state in the system, the time required to generate and delete the threads is reduced, and the performance of the system can be improved.

【0035】[0035]

【発明の効果】以上の説明から明らかなように、本発明
によれば、スレッドの増加によるシステムの資源不足や
性能低下が抑制される効果がある。
As is apparent from the above description, according to the present invention, there is an effect that a shortage of system resources and a decrease in performance due to an increase in threads are suppressed.

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

【図1】本発明が適用されるデータ処理システムにおけ
る処理の概要を示した説明図。
FIG. 1 is an explanatory diagram showing an outline of processing in a data processing system to which the present invention is applied.

【図2】実施の形態のデータ処理システムにおけるスレ
ッド管理処理を示したフローチャート。
FIG. 2 is a flowchart illustrating a thread management process in the data processing system according to the embodiment;

【図3】実施の形態のデータ処理システムにおける各ス
レッド内での処理を示したフローチャート。
FIG. 3 is a flowchart showing processing in each thread in the data processing system according to the embodiment;

【図4】実施の形態のデータ処理システムにおけるスレ
ッド管理テーブルの説明図。
FIG. 4 is an explanatory diagram of a thread management table in the data processing system according to the embodiment;

【図5】実施の形態のデータ処理システムにおけるスレ
ッド数の推移を示した説明図。
FIG. 5 is an explanatory diagram showing a transition of the number of threads in the data processing system according to the embodiment;

【図6】従来のデータ処理システムにおける処理を説明
したフローチャート。
FIG. 6 is a flowchart illustrating processing in a conventional data processing system.

【図7】従来のデータ処理システムにおける処理を説明
したフローチャート。
FIG. 7 is a flowchart illustrating processing in a conventional data processing system.

【図8】従来のデータ処理システムにおけるスレッド管
理テーブルの説明図。
FIG. 8 is an explanatory diagram of a thread management table in a conventional data processing system.

【図9】従来のデータ処理システムにおけるスレッド数
の推移の説明図。
FIG. 9 is an explanatory diagram of a change in the number of threads in a conventional data processing system.

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

Aスレッド番号 B 使用/未使用フラグ C 待機フラグ D処理データ Gリサイクルスレッドカウンタ F 共用メモリ A thread number B used / unused flag C wait flag D processing data G recycled thread counter F shared memory

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 所定のデータ処理システム上で複数のス
レッドにより並行処理を行うデータ処理方法において、 並列処理の実行後に、前記データ処理システムのシステ
ム運用に必要となる規定値の個数のスレッドを並行処理
が再開可能な待機状態とし、前記規定値の個数を越えた
スレッドを並列処理の実行後に削除することを特徴とす
るデータ処理方法。
In a data processing method for performing parallel processing by a plurality of threads on a predetermined data processing system, after executing the parallel processing, a predetermined number of threads required for system operation of the data processing system are processed in parallel. A data processing method in which a standby state in which processing can be resumed is set, and threads exceeding the specified value are deleted after execution of parallel processing.
【請求項2】 並列処理に使用される各スレッドに対し
て所定のスレッド番号を順次設定するとともに並行処理
の実行直後に各スレッドのスレッド番号と前記規定値と
を比較し、スレッド番号が前記規定値より大きいスレッ
ドは削除し、スレッド番号が前記規定値以下であるスレ
ッドは前記待機状態とすることを特徴とする請求項1記
載のデータ処理方法。
2. A method according to claim 1, wherein a predetermined thread number is sequentially set for each thread used in the parallel processing, and immediately after the execution of the parallel processing, the thread number of each thread is compared with the specified value. 2. The data processing method according to claim 1, wherein a thread whose thread number is larger than the value is deleted, and a thread whose thread number is equal to or less than the specified value is set in the standby state.
JP27588596A 1996-10-18 1996-10-18 Data processing method Pending JPH10124331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP27588596A JPH10124331A (en) 1996-10-18 1996-10-18 Data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP27588596A JPH10124331A (en) 1996-10-18 1996-10-18 Data processing method

Publications (1)

Publication Number Publication Date
JPH10124331A true JPH10124331A (en) 1998-05-15

Family

ID=17561801

Family Applications (1)

Application Number Title Priority Date Filing Date
JP27588596A Pending JPH10124331A (en) 1996-10-18 1996-10-18 Data processing method

Country Status (1)

Country Link
JP (1) JPH10124331A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7137115B2 (en) 2000-01-25 2006-11-14 Fujitsu Limited Method for controlling multithreading

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7137115B2 (en) 2000-01-25 2006-11-14 Fujitsu Limited Method for controlling multithreading

Similar Documents

Publication Publication Date Title
US8930497B1 (en) Centralized execution of snapshot backups in a distributed application environment
US20010010052A1 (en) Method for controlling multithreading
US6952793B2 (en) Computer system and methods for acquiring dump information and system recovery
JPH07219665A (en) Method for suspension and restarting of state of system and computer apparatus capable of performing it
US8464269B2 (en) Handling and reporting of object state transitions on a multiprocess architecture
JP2007018282A (en) Process control system and its control method
JPH07311749A (en) Multiprocessor system and kernel substituting method
US20220350668A1 (en) Function parallelism in a runtime container of a function-as-a-service (faas) system
US7010725B2 (en) Method and apparatus for getting dump of a computer system
US20050028159A1 (en) Memory managing system and task controller in multitask system
JP2000242484A (en) How to change the control program
US20010037425A1 (en) Interrupt processing method in an operation processing device and the device using the same
CN112764822A (en) Operating system starting method, device, equipment and medium
JPH10124331A (en) Data processing method
US20030140082A1 (en) Patch processing system and method
JPH08190491A (en) Task switching method
JP2822728B2 (en) Computer system
JP2851039B2 (en) Workstation backup system
JPH10232855A (en) Parallel job execution system and recording medium
JPH07152574A (en) Program loading method
CN117742892A (en) Object memory recycling method, device, equipment and storage medium
GB2362246A (en) Computer system with checkpoint facility.
JPH056302A (en) Memory management system
JPH05224941A (en) Application program control system
JPH04195535A (en) Program space forming system