JP2011198063A - Method, program and device for controlling data input/output - Google Patents

Method, program and device for controlling data input/output Download PDF

Info

Publication number
JP2011198063A
JP2011198063A JP2010064417A JP2010064417A JP2011198063A JP 2011198063 A JP2011198063 A JP 2011198063A JP 2010064417 A JP2010064417 A JP 2010064417A JP 2010064417 A JP2010064417 A JP 2010064417A JP 2011198063 A JP2011198063 A JP 2011198063A
Authority
JP
Japan
Prior art keywords
output
data input
thread
input
asynchronous
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
Application number
JP2010064417A
Other languages
Japanese (ja)
Other versions
JP5540799B2 (en
Inventor
Rie Goto
理恵 後藤
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2010064417A priority Critical patent/JP5540799B2/en
Publication of JP2011198063A publication Critical patent/JP2011198063A/en
Application granted granted Critical
Publication of JP5540799B2 publication Critical patent/JP5540799B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a technique enabling high speed execution of input/output corresponding to an asynchronous input/output text of an application.SOLUTION: When the execution of an application starts, a thread generation part 125 generates a prescribed number of threads. A thread management information storage part 131 stores management information of the generated threads. When an asynchronous data input/output of the application designated by an asynchronous input/output text starts, a use data input/output determination part 126 selects processing to be executed by a thread-using input/output processing part 127 for the presence of a thread in an empty state but selects processing to be executed by a system-using input/output processing part 128 for the absence of a thread in an empty state. The thread-using input/output processing part 127 executes data input/output processing utilizing already generated threads. The system-using input/output processing part 128 executes data input/output processing utilizing asynchronous I/O of a system call and a system library.

Description

本発明は,アプリケーションにおける非同期入出力文に応じたデータの入出力処理を制御するデータ入出力制御方法,データ入出力制御プログラムおよびデータ入出力制御装置に関するものである。   The present invention relates to a data input / output control method, a data input / output control program, and a data input / output control device for controlling data input / output processing corresponding to an asynchronous input / output statement in an application.

例えば,プログラミング言語のFortranには,非同期なデータの入出力処理を指定する非同期入出力文がある。このような非同期入出力文で指定されたデータ入出力処理の実行モデルとしては,例えば,OS(Operating System)などのシステムが提供するシステムコールやシステムライブラリなどを利用したデータ入出力モデルや,スレッドを利用したデータ入出力モデルなどがある。なお,非同期入出力文は,CやC++などのプログラミング言語にもある。 For example, Fortran, a programming language, has an asynchronous input / output statement that specifies asynchronous data input / output processing. As an execution model of data input / output processing specified by such an asynchronous input / output statement, for example, a data input / output model using a system call or system library provided by a system such as an OS (Operating System), a thread, or the like There is a data input / output model that uses. Asynchronous I / O statements are also available in programming languages such as C and C ++ .

システムが提供するシステムコールやシステムライブラリなどを利用したデータ入出力モデルでは,例えば多重I/O(Input/Output)や非同期I/O(AIO:Asynchronous Input/Output )の技術を利用し,非同期なデータ入出力を実現する。また,スレッドを利用したデータ入出力モデルでは,例えばアプリケーションのメインスレッドとは別にサブスレッドを生成し,生成したサブスレッドを用いて並列にデータ入出力を実行する。   The data input / output model using system calls and system libraries provided by the system uses asynchronous I / O (AIO: Asynchronous Input / Output) technology for example. Data input / output is realized. In the data input / output model using threads, for example, a sub thread is generated separately from the main thread of the application, and data input / output is executed in parallel using the generated sub thread.

なお,プログラムで1つのサブタスク(プロセス)を生成し,生成したプロセスで非同期入出力文を実行する技術が知られている。また,ファイルごとに新規のスレッドを生成して,非同期入出力文を実行させる技術が知られている。また,キーアクセスされる頻度を管理し,頻度の高い順にデータをバッファリングして,システムコールの発行回数を減少させる非同期入出力の技術が知られている。   A technique for generating one subtask (process) by a program and executing an asynchronous input / output statement by the generated process is known. In addition, a technique for generating a new thread for each file and executing an asynchronous input / output statement is known. Asynchronous I / O technology is also known in which the frequency of key access is managed, data is buffered in order of frequency, and the number of system calls issued is reduced.

特許第2585797号公報Japanese Patent No. 25859797 特開2000―194574号公報JP 2000-194574 A 特開平4―342011号公報JP-A-4-342011

上述のシステムが提供するシステムコールやシステムライブラリなどを利用したデータ入出力において,多重I/Oでは,ブロッキングによる待ちの問題がある。また,非同期I/Oでは,システムリソースを他のアプリケーションと共有するため,他のアプリケーションの動作によっては性能劣化を余儀なくされる可能性がある。スレッドを利用したデータ入出力では,スレッドの生成コストの問題や,スレッドの立て過ぎによるリソースの枯渇という問題がある。   In data input / output using the system call or system library provided by the above system, there is a problem of waiting due to blocking in multiplexed I / O. In addition, in asynchronous I / O, system resources are shared with other applications, and performance degradation may be forced depending on the operation of other applications. In data input / output using threads, there are problems of thread generation costs and resource depletion due to excessive thread establishment.

アプリケーションの非同期入出力文で指定されたデータ入出力を高速に実行するためには,システムリソースを効率的に利用することや,状況に応じた効率的なデータ入出力処理を実行することが要求される。   In order to execute data input / output specified in an asynchronous input / output statement of an application at high speed, it is necessary to use system resources efficiently and to execute efficient data input / output processing according to the situation. Is done.

本発明は,上記の問題の解決を図り,システムリソースを効率的に使用し,状況に応じた効率的なデータ入出力処理を実行することにより,アプリケーションの非同期入出力文に対応するデータ入出力を高速に実行することが可能となる技術を提供することを目的とする。   The present invention solves the above problems, uses system resources efficiently, and executes efficient data input / output processing according to the situation, thereby enabling data input / output corresponding to an asynchronous input / output statement of an application. It is an object of the present invention to provide a technique capable of executing the above at high speed.

プログラミング言語の非同期入出力文を含むソースプログラムによって作成されたアプリケーションの非同期入出力文に対応する処理を,コンピュータによって実現するデータ入出力制御方法は,コンピュータが,アプリケーションの実行開始の際に,アプリケーションの実行に使用する所定数のスレッドを生成し,生成したスレッドを管理する管理情報を,コンピュータがアクセス可能な記憶装置に記憶する処理と,アプリケーションにおける非同期入出力文に対応するデータ入出力処理の開始の際に,管理情報を参照して,生成したスレッド中に未使用状態のスレッドがある場合には,スレッド利用データ入出力処理を行うと決定し,生成したスレッド中に未使用状態のスレッドがない場合には,非同期I/O利用データ入出力処理を行うと決定する処理と,スレッド利用データ入出力処理を行うと決定した場合に,管理情報においてデータ入出力処理に利用する未使用状態のスレッドの状態をデータ入出力処理が終了するまで使用状態に設定し,未使用状態のスレッドを利用するデータ入出力処理を実行する処理と,非同期I/O利用データ入出力処理を行うと決定した場合に,システムコールまたはシステムライブラリにより提供される非同期I/Oを利用するデータ入出力処理を実行する処理とを実行することを特徴とする。   A data input / output control method that implements processing corresponding to an asynchronous input / output statement of an application created by a source program including an asynchronous input / output statement of a programming language by a computer is performed when the computer starts execution of the application. A process that generates a predetermined number of threads used to execute and stores management information for managing the generated threads in a storage device accessible by the computer, and a data input / output process corresponding to an asynchronous input / output statement in the application When starting, if there is an unused thread in the created thread by referring to the management information, it is determined that the thread use data I / O processing is performed, and the unused thread is created in the created thread. If there is no data, perform asynchronous I / O usage data input / output processing And the thread usage data I / O process, the management thread sets the unused thread status used for data I / O processing to the usage status until the data I / O processing is completed. Asynchronous I / O provided by a system call or system library when it is determined to execute data input / output processing that uses an unused thread and asynchronous I / O usage data input / output processing And a process of executing a data input / output process using the.

上記の技術によって,データ入出力処理の実行時に,適切な実行モデルを判断することで,アプリケーションの非同期入出力文の実行において,高速にデータ入出力を実行することが可能となる。   With the above technology, it is possible to execute data input / output at high speed when executing an asynchronous input / output statement of an application by determining an appropriate execution model when executing data input / output processing.

データ入出力のモデルの分類例を示す図である。It is a figure which shows the classification example of the model of a data input / output. 多重I/Oを説明する図である。It is a figure explaining multiplexed I / O. 非同期I/Oを説明する図である。It is a figure explaining asynchronous I / O. 非同期I/O時のデータのバッファリングを説明する図である。It is a figure explaining the buffering of the data at the time of asynchronous I / O. 本実施の形態によるコンピュータシステムの構造を示す図である。It is a figure which shows the structure of the computer system by this Embodiment. CPUの例を示す図である。It is a figure which shows the example of CPU. 本実施の形態によるコンパイルを説明する図である。It is a figure explaining the compilation by this Embodiment. 非同期入出力文を含むソースプログラムの例を示す図である。It is a figure which shows the example of the source program containing an asynchronous input-output sentence. 本実施の形態によるデータ入出力制御機能を説明する機能構成例を示す図である。It is a figure which shows the function structural example explaining the data input / output control function by this Embodiment. 本実施の形態のスレッド管理情報記憶部に格納された情報の例を示す図である。It is a figure which shows the example of the information stored in the thread management information storage part of this Embodiment. 本実施の形態のバッファ管理情報記憶部に格納された情報の例を示す図である。It is a figure which shows the example of the information stored in the buffer management information storage part of this Embodiment. 本実施の形態の使用データ入出力決定部による使用データ入出力決定処理フローチャートである。It is a use data input / output determination process flowchart by the use data input / output determination part of this Embodiment. 本実施の形態による既生成スレッドを利用するデータ入出力処理の例を説明する図である。It is a figure explaining the example of the data input / output process using the already produced | generated thread by this Embodiment. 本実施の形態のスレッド利用入出力処理部によるスレッド利用データ入出力処理フローチャートである。It is a thread utilization data input / output processing flowchart by the thread utilization input / output processing unit of the present embodiment. 本実施の形態によるシステムの非同期I/Oを利用したデータ入力処理の例を説明する図である。It is a figure explaining the example of the data input process using the asynchronous I / O of the system by this Embodiment. 本実施の形態によるシステムの非同期I/Oを利用したデータ出力処理の例を説明する図である。It is a figure explaining the example of the data output process using the asynchronous I / O of the system by this Embodiment. 本実施の形態のシステム利用入出力処理部によるシステム利用データ入出力処理フローチャートである。It is a system utilization data input / output process flowchart by the system utilization input / output processing part of this Embodiment.

以下,本実施の形態について,図を用いて説明する。   Hereinafter, the present embodiment will be described with reference to the drawings.

まず,本実施の形態によるデータ入出力制御の技術を説明する前に,一般的なデータ入出力の技術について,簡単に説明する。   First, before explaining the data input / output control technique according to the present embodiment, a general data input / output technique will be briefly described.

図1は,データ入出力のモデルの分類例を示す図である。   FIG. 1 is a diagram showing an example of classification of data input / output models.

一般的なデータ入出力のモデルは,例えば図1に示すように,同期(synchronous )か非同期(asynchronous)か,またはブロッキング(blocking)が行われるか行われないかで分類することができる。   For example, as shown in FIG. 1, a general data input / output model can be classified according to whether it is synchronous or asynchronous, or whether blocking is performed or not.

同期のデータ入出力モデルには,例えば,readやwrite などのシステムコールを用いたデータ入出力のモデルがある。同期のデータ入出力モデルでは,アプリケーションのスレッドは,カーネルへのI/Oリクエスト発行後に,カーネルからの応答を待つ。このような同期のデータ入出力モデルには,カーネルでの入出力処理が完了するまでアプリケーションのスレッドがブロックされるブロッキングのモデルと,カーネルでの入出力が完了しなくてもアプリケーションのスレッドに処理が返される非ブロッキング(non-blocking)のモデルとがある。   The synchronous data input / output model includes, for example, a data input / output model using system calls such as read and write. In the synchronous data input / output model, an application thread waits for a response from the kernel after issuing an I / O request to the kernel. The synchronous data input / output model includes a blocking model in which the application thread is blocked until the input / output processing in the kernel is completed, and processing to the application thread even if the input / output in the kernel is not completed. There is a non-blocking model in which is returned.

非同期のデータ入出力モデルには,例えば,ブロッキングを行う多重I/Oや,ブロッキングを行わない非同期I/Oなどがある。   Asynchronous data input / output models include, for example, multiple I / O that performs blocking and asynchronous I / O that does not perform blocking.

図2は,多重I/Oを説明する図である。   FIG. 2 is a diagram for explaining multiplexed I / O.

図2において,アプリケーション500は,データ入出力処理が含まれるユーザプログラムである。カーネル600は,OSの中核として,コンピュータのハードウェアリソースの管理・制御や,ハードウェア−ソフトウェア間のやり取りの制御,プロセス間通信などの基本機能を提供する。   In FIG. 2, an application 500 is a user program including data input / output processing. The kernel 600 serves as a core of the OS, and provides basic functions such as management and control of computer hardware resources, control of hardware-software exchange, and interprocess communication.

多重I/Oは,単一のスレッドによって,read/writeでブロックすることなく,複数のI/Oを同時に扱う技術である。多重I/Oでは,アプリケーション500は,select(2) ,poll(2) ,epoll(2)などのシステムコールを実行し,カーネル600からのI/O実行可能状態の通知を待つ。   Multiplex I / O is a technique for handling a plurality of I / Os simultaneously by a single thread without blocking by read / write. In the multiple I / O, the application 500 executes system calls such as select (2), poll (2), and epoll (2), and waits for notification of an I / O executable state from the kernel 600.

例えば,図2に示すように,アプリケーション500がreadまたはwrite を実行し(S900),カーネル600からEAGAINでエラー復帰する(S901)。なお,EAGAINは,read/writeの非ブロッキングのデータ入出力において,読み取り/書き込みの準備ができたデータがないことを示す。アプリケーション500は,システムコールのselect()を発行し(S902),カーネル600からのI/O実行可能状態の通知を待つ。アプリケーション500は,カーネル600からのI/O実行可能状態の通知を受けた後(S903),readまたはwrite によりデータ転送を行う(S904)。   For example, as shown in FIG. 2, the application 500 executes read or write (S900), and returns an error from the kernel 600 with EAGAIN (S901). Note that EAGAIN indicates that there is no data ready for read / write in read / write non-blocking data input / output. The application 500 issues a system call select () (S 902) and waits for an I / O executable state notification from the kernel 600. After receiving the notification of the I / O executable state from the kernel 600 (S903), the application 500 performs data transfer by read or write (S904).

このように,多重I/Oでは,アプリケーション500は,I/O実行可能状態の通知待ちの間にブロックされ,他の処理が一切行えない。そのため,通知の待ち時間が無駄になり,データ入出力の性能向上が望めない。   As described above, in the multiplexed I / O, the application 500 is blocked while waiting for notification of the I / O executable state, and cannot perform any other processing. As a result, the waiting time for notification is wasted and data input / output performance cannot be improved.

図3は,非同期I/Oを説明する図である。   FIG. 3 is a diagram for explaining asynchronous I / O.

図3において,システムライブラリ700は,OSによって提供される関数のライブラリである。システムライブラリ700に含まれる非同期I/Oの関数としては,例えば,POSIX(Portable Operating System Interface )のAIO関数などがある。なお,POSIXは,登録商標である。   In FIG. 3, a system library 700 is a library of functions provided by the OS. As an asynchronous I / O function included in the system library 700, for example, there is a POSIX (Portable Operating System Interface) AIO function. POSIX is a registered trademark.

非同期I/Oでは,AIO関連のシステムコールやPOSIXのAIO関数などを使用し,ブロッキングすることなしに,データ入出力が実行される。ブロッキングしないため,アプリケーション500がread/write発行後も他の処理を並列に行えることが特徴である。非同期I/Oには,例えば,システムで共通にサポートされるPOSIXの非同期I/Oや,Linuxカーネルがサポートする非同期I/Oなどがある。なお,Linuxは,登録商標である。   In asynchronous I / O, AIO-related system calls and POSIX AIO functions are used, and data input / output is executed without blocking. Since it does not block, the application 500 is characterized in that it can perform other processes in parallel even after issuing read / write. Asynchronous I / O includes, for example, asynchronous POSIX I / O that is commonly supported in the system and asynchronous I / O supported by the Linux kernel. Note that Linux is a registered trademark.

図3において,アプリケーション500は,システムライブラリ700のAIO関数を呼び出す(S910)。システムライブラリ700では,AIO関数によって,カーネル600に対するデータ入出力のシステムコールが発行される(S911)。なお,このときアプリケーション500では,AIO関数の呼び出しによって処理がブロックされないため,カーネル600でのデータ入出力処理と並行に,他の処理が実行可能となる。   In FIG. 3, the application 500 calls the AIO function of the system library 700 (S910). The system library 700 issues a data input / output system call to the kernel 600 by the AIO function (S911). At this time, in the application 500, the processing is not blocked by the call of the AIO function, so that other processing can be executed in parallel with the data input / output processing in the kernel 600.

カーネル600でのデータ入出力処理が完了すると,カーネル600からシステムライブラリ700にI/O完了通知が送られ(S912),システムライブラリ700からアプリケーション500に処理が返される(S913)。   When the data input / output processing in the kernel 600 is completed, an I / O completion notification is sent from the kernel 600 to the system library 700 (S912), and the processing is returned from the system library 700 to the application 500 (S913).

このように,非同期I/Oでは,ブロッキングせずにデータの入出力を行うことが可能であるため,データ入出力処理の性能は向上する。   As described above, the asynchronous I / O can perform data input / output without blocking, so that the performance of data input / output processing is improved.

ただし,非同期I/Oでは,同時に待ち行列に入れる非同期I/Oの操作数や非同期I/O転送中にロック可能な最大メモリ容量制限が,システム全体で適用される値に依存する。非同期I/Oでは,システムリソースを他のアプリケーションと共有しているため,並行に動作する他のアプリケーションの動作によっては,待ち行列やロック可能な最大メモリ容量が制限を超えて待ち状態となり,データ入出力の性能劣化が余儀なくされる可能性がある。   However, in asynchronous I / O, the number of asynchronous I / O operations simultaneously queued and the maximum memory capacity limit that can be locked during asynchronous I / O transfer depend on the value applied to the entire system. Asynchronous I / O shares system resources with other applications, so depending on the operation of other applications that run in parallel, the queue and the maximum memory capacity that can be locked may exceed the limit and be in a wait state. Input / output performance may be degraded.

図4は,非同期I/O時のデータのバッファリングを説明する図である。   FIG. 4 is a diagram for explaining data buffering during asynchronous I / O.

データのバッファリングは,カーネル600とアプリケーション500との間でデータのやり取りを行う場合に,データをアプリケーション500側が保持するバッファに一旦コピーして,いくつかのデータをまとめる方法である。この方法を行うことにより,システムコールの発行回数を減らすことができる。   Data buffering is a method in which, when data is exchanged between the kernel 600 and the application 500, the data is temporarily copied to a buffer held by the application 500, and some data is collected. By performing this method, the number of system calls issued can be reduced.

例えば,図4において,アプリケーション500は,バッファリング処理により,ファイルに出力するデータを,メモリ領域からバッファに転送する(S920)。   For example, in FIG. 4, the application 500 transfers data to be output to a file from the memory area to the buffer by buffering processing (S920).

ファイルに出力するデータがバッファにまとめられたところで,アプリケーション500は,システムライブラリ700のAIO関数を呼び出す(S921)。システムライブラリ700では,AIO関数によって,カーネル600に対するデータ入出力のシステムコールが発行される(S922)。カーネル600の処理によって,バッファのデータがファイルに出力される。   When the data to be output to the file is collected in the buffer, the application 500 calls the AIO function of the system library 700 (S921). In the system library 700, a data input / output system call to the kernel 600 is issued by the AIO function (S922). By the processing of the kernel 600, the buffer data is output to a file.

カーネル600でのデータ出力処理が完了すると,カーネル600からシステムライブラリ700にI/O完了通知が送られ(S923),システムライブラリ700からアプリケーション500に処理が返される(S924)。   When the data output process in the kernel 600 is completed, an I / O completion notification is sent from the kernel 600 to the system library 700 (S923), and the process is returned from the system library 700 to the application 500 (S924).

このようなバッファリング処理によって,システムコールの発行回数を減らすことにより,システムコールの待ち行列を減らすことができる。ただし,非同期I/Oにおいてバッファリング処理を行う場合には,I/Oを発行してから完了待ちまでの時間が無駄になる可能性がある。   Such a buffering process can reduce the number of system call issuances, thereby reducing the number of system call queues. However, when buffering processing is performed in asynchronous I / O, there is a possibility that time from issuing the I / O to waiting for completion may be wasted.

以下では,これらのようなデータ入出力技術の問題の解決を図った,本実施の形態のデータ入出力制御の技術について,説明する。   In the following, the data input / output control technique according to the present embodiment for solving the problems of the data input / output technique as described above will be described.

図5は,本実施の形態によるコンピュータシステムの構造を示す図である。   FIG. 5 is a diagram showing the structure of a computer system according to this embodiment.

コンピュータ1は,CPU(Central Processing Unit )31,RAM(Random Access Memory)やROM(Read Only Memory)などのメモリ32,HDD(Hard Disk Drive )などのディスク33等のハードウェア30を備える。   The computer 1 includes hardware 30 such as a CPU (Central Processing Unit) 31, a memory 32 such as a RAM (Random Access Memory) and a ROM (Read Only Memory), and a disk 33 such as an HDD (Hard Disk Drive).

図5において,システム領域20は,OS21などのシステムが稼動する領域である。図5に示すシステム領域20には,OS21が提供する関数のライブラリであるシステムライブラリ22が用意されている。システム領域20のプログラムは,ハードウェア30を利用して実行される。   In FIG. 5, a system area 20 is an area where a system such as the OS 21 operates. In the system area 20 shown in FIG. 5, a system library 22 that is a library of functions provided by the OS 21 is prepared. The program in the system area 20 is executed using the hardware 30.

図5において,ユーザ領域10は,ユーザがアプリケーション11の稼動に利用できる領域である。また,図5に示すユーザ領域10では,プログラミング言語で書かれたアプリケーション11のソースプログラムから,実行形式のプログラムを作成するソフトウェアのパッケージであるコンパイラ/ライブラリ12が稼動する。本実施の形態では,コンパイラ/ライブラリ12は,Fortranでプログラミングされたソースプログラムから実行形式のプログラムを作成するコンパイラのパッケージであるものとする。ユーザ領域10のプログラムは,システム領域20のOS21等を介することにより,ハードウェア30を利用して実行される。   In FIG. 5, a user area 10 is an area that the user can use for running the application 11. In the user area 10 shown in FIG. 5, a compiler / library 12 that is a software package for creating an executable program from a source program of an application 11 written in a programming language is operated. In this embodiment, it is assumed that the compiler / library 12 is a compiler package that creates an executable program from a source program programmed in Fortran. The program in the user area 10 is executed using the hardware 30 through the OS 21 in the system area 20 or the like.

図6は,CPUの例を示す図である。   FIG. 6 is a diagram illustrating an example of a CPU.

本実施の形態のCPU31は,例えば,図6に示すようなCPUチップ310で提供される。CPUチップ310は,CPU31の物理的なパッケージである。CPUチップ310は,複数のCPUコア311を持つマルチコアプロセッサである。また,システムが提供するマルチスレッド機構により,ソフトウェアプログラムからは,1つのCPUコア311が複数の論理CPU312に見える。   The CPU 31 of the present embodiment is provided by a CPU chip 310 as shown in FIG. 6, for example. The CPU chip 310 is a physical package of the CPU 31. The CPU chip 310 is a multi-core processor having a plurality of CPU cores 311. In addition, a single CPU core 311 can be seen by a plurality of logical CPUs 312 from the software program by a multi-thread mechanism provided by the system.

図7は,本実施の形態によるコンパイルを説明する図である。   FIG. 7 is a diagram for explaining compilation according to the present embodiment.

ここでは,図5に示すアプリケーション11のソースプログラム111を,図5に示すコンパイラ/ライブラリ12を用いてコンパイルし,アプリケーション11の実行形式プログラム114を生成する例を説明する。なお,図7において,コンパイラ121,アセンブラ122,リンカ123と,実行時ライブラリ124の一部とは,図5に示すコンパイラ/ライブラリ12に含まれる。   Here, an example will be described in which the source program 111 of the application 11 shown in FIG. 5 is compiled using the compiler / library 12 shown in FIG. 5 to generate the executable program 114 of the application 11. In FIG. 7, the compiler 121, the assembler 122, the linker 123, and a part of the runtime library 124 are included in the compiler / library 12 shown in FIG.

実行時ライブラリ124は,ユーザ領域10で実行されるアプリケーション11で汎用的に用いられるプログラムの集合である。図7に示す本実施の形態の実行時ライブラリ124には,OS21が提供するシステムライブラリ22や,コンパイラ/ライブラリ12にパッケージされた言語提供ライブラリ,ユーザが過去に作成したプログラムで汎用的に使用するために保持されたアプリケーションライブラリ等が含まれる。   The runtime library 124 is a set of programs that are generally used by the application 11 executed in the user area 10. The runtime library 124 of the present embodiment shown in FIG. 7 is used for general purposes in the system library 22 provided by the OS 21, the language providing library packaged in the compiler / library 12, and programs created by the user in the past. For example, an application library held for the purpose is included.

なお,本実施の形態のデータ入出力制御機能を提供するプログラムは,実行時ライブラリ124に含まれる。例えば,本実施の形態のデータ入出力制御機能を提供するプログラムは,コンパイラ/ライブラリ12にパッケージされた言語提供ライブラリにより提供される。   The program that provides the data input / output control function of this embodiment is included in the runtime library 124. For example, the program that provides the data input / output control function of the present embodiment is provided by a language providing library packaged in the compiler / library 12.

ソースプログラム111は,アプリケーション11のソースコードである。本実施の形態では,ソースプログラム111は,Fortranでプログラミングされており,Fortranの非同期入出力文を含んでいるものとする。なお,Fortranは,科学技術計算向きに開発された手続き型のプログラミング言語である。   The source program 111 is the source code of the application 11. In the present embodiment, it is assumed that the source program 111 is programmed with Fortran and includes a Fortran asynchronous input / output statement. Fortran is a procedural programming language developed for scientific and engineering calculations.

本実施の形態では,ソースプログラム111のコンパイルが実行されると,コンパイラ121は,ソースプログラム111を,中間的にアセンブラソース112に変換する。アセンブラ122は,アセンブラソース112をアセンブルし,オブジェクトコード113を生成する。リンカ123は,アプリケーション11のオブジェクトコード113に対して,実行時ライブラリ124に含まれる必要な関数等のプログラムをリンクし,アプリケーション11の実行形式プログラム114を生成する。   In the present embodiment, when the source program 111 is compiled, the compiler 121 intermediately converts the source program 111 into an assembler source 112. The assembler 122 assembles the assembler source 112 and generates an object code 113. The linker 123 links an object code 113 of the application 11 with a program such as a necessary function included in the runtime library 124 to generate an execution format program 114 of the application 11.

なお,本実施の形態では,リンクとして,動的リンクが用いられているものとする。すなわち,本実施の形態では,リンカ123は,オブジェクトコード113に対して,実行時ライブラリ124に含まれる必要なプログラムへの呼び出し解決を行い,実行形式プログラム114を生成する。実行時ライブラリ124のプログラムは,アプリケーション11の実行形式プログラム114の実行時に,ユーザ領域10のメモリ領域上に呼び出される。   In this embodiment, it is assumed that a dynamic link is used as the link. In other words, in the present embodiment, the linker 123 performs call resolution to a necessary program included in the runtime library 124 with respect to the object code 113 to generate an executable program 114. The program of the runtime library 124 is called on the memory area of the user area 10 when the execution format program 114 of the application 11 is executed.

図8は,非同期入出力文を含むソースプログラムの例を示す図である。   FIG. 8 is a diagram illustrating an example of a source program including asynchronous input / output statements.

図8に示すソースプログラム111は,Fortranで記述されており,データの非同期入出力を指定する非同期入出力文を含んでいる。   The source program 111 shown in FIG. 8 is described in Fortran and includes an asynchronous input / output statement that specifies asynchronous input / output of data.

図8に示すソースプログラム111において,“PROGRAM MAIN”の次の2行は,変数の宣言が記述された部分である。その次の4行は,変数の初期化が記述された部分である。さらに次のOPEN文からCLOSE文までの5行が,データ入出力が記述された部分である。   In the source program 111 shown in FIG. 8, the next two lines after “PROGRAM MAIN” are portions where variable declarations are described. The next four lines describe the variable initialization. Furthermore, the next five lines from the OPEN statement to the CLOSE statement are portions where data input / output is described.

図8に示すソースプログラム111のデータ入出力の部分において,OPEN文,WRITE文,READ文に記述された“ASYNCHRONOUS='YES'”が,データの非同期入出力を指定する記述である。すなわち,図8に示すソースプログラム111において,“ASYNCHRONOUS='YES'”を含む入出力文が,非同期入出力文となる。   In the data input / output portion of the source program 111 shown in FIG. 8, “ASYNCHRONOUS = 'YES'” described in the OPEN statement, the WRITE statement, and the READ statement is a description for designating asynchronous input / output of data. That is, in the source program 111 shown in FIG. 8, an input / output statement including “ASYNCHRONOUS = 'YES'” is an asynchronous input / output statement.

図9は,本実施の形態によるデータ入出力制御機能を説明する機能構成例を示す図である。   FIG. 9 is a diagram showing a functional configuration example for explaining the data input / output control function according to the present embodiment.

コンピュータ1において,アプリケーション11のソースプログラム111は,コンパイラ121,リンカ123等により,アプリケーション11の実行形式プログラム114に変換される。このとき,アプリケーション11の実行形式プログラム114から実行時ライブラリ124の呼び出しに必要なインタフェースの生成などが行われる。また,実行形式プログラム114を起動するための実行コマンドも生成される。   In the computer 1, the source program 111 of the application 11 is converted into an execution format program 114 of the application 11 by the compiler 121, the linker 123, and the like. At this time, an interface necessary for calling the runtime library 124 is generated from the execution format program 114 of the application 11. An execution command for starting the execution format program 114 is also generated.

実行時ライブラリ124では,アプリケーション11の実行形式プログラム114から呼び出される関数等のプログラムによって,スレッド生成部125,使用データ入出力決定部126,スレッド利用入出力処理部127,システム利用入出力処理部128が実現される。本実施の形態によるデータ入出力制御機能を提供するこれらの各機能部は,コンピュータ1が備えるCPU31,メモリ32,ディスク33等のハードウェア30と,ソフトウェアプログラムとによって実現される。   In the runtime library 124, a thread generation unit 125, a use data input / output determination unit 126, a thread use input / output processing unit 127, and a system use input / output processing unit 128, depending on programs such as functions called from the execution format program 114 of the application 11. Is realized. Each of these functional units that provide the data input / output control function according to the present embodiment is realized by the hardware 30, such as the CPU 31, the memory 32, and the disk 33 provided in the computer 1, and a software program.

実行コマンドによって,アプリケーション11の実行形式プログラム114が起動されると,実行開始処理が行われる。実行形式プログラム114の実行開始処理において,実行時ライブラリ124のスレッド生成部125は,アプリケーション11の実行で利用する,所定数のスレッドを生成する。   When the execution format program 114 of the application 11 is activated by the execution command, execution start processing is performed. In the execution start process of the executable program 114, the thread generation unit 125 of the runtime library 124 generates a predetermined number of threads that are used in the execution of the application 11.

ユーザは,ソースプログラム111のコンパイル時に,アプリケーション11をマルチスレッドで実行するか,シングルスレッドで実行するかを指定する。スレッド生成部125は,コンパイル時にマルチスレッドが指定されている場合に,複数スレッドの生成を行う。スレッド生成部125により生成するスレッドの数は,CPU31やメモリ32の性能等を鑑みて妥当とされる数があらかじめ設定されている。本実施の形態では,アプリケーション11の実行形式プログラム114の実行開始処理において,スレッド生成部125によって生成するスレッドの数は,アプリケーション11のメインスレッドを含めて8個に設定されているものとする。なお,例えば実行形式プログラム114の実行時などにユーザが生成するスレッド数を指定できるようにしてもよい。   When compiling the source program 111, the user designates whether the application 11 is executed in a multi-thread or a single thread. The thread generation unit 125 generates a plurality of threads when multithreading is specified at the time of compilation. The number of threads generated by the thread generation unit 125 is set in advance as appropriate in view of the performance of the CPU 31 and the memory 32. In the present embodiment, it is assumed that the number of threads generated by the thread generation unit 125 in the execution start process of the execution format program 114 of the application 11 is set to 8 including the main thread of the application 11. For example, the number of threads generated by the user when the execution format program 114 is executed may be specified.

スレッド生成部125は,アプリケーション11の実行で利用するスレッドの管理情報を生成し,スレッド管理情報記憶部131に記憶する。スレッド管理情報記憶部131は,アプリケーション11の実行で利用するスレッドの管理情報を記憶する,コンピュータ1がアクセス可能な記憶装置である。スレッド管理情報記憶部131には,実行されたアプリケーション11のプロセスID,アプリケーション11の実行に利用するために生成されたスレッドの数,各スレッドの状態などの情報が記憶されている。   The thread generation unit 125 generates thread management information used for execution of the application 11 and stores it in the thread management information storage unit 131. The thread management information storage unit 131 is a storage device that can be accessed by the computer 1 and stores thread management information used in the execution of the application 11. The thread management information storage unit 131 stores information such as the process ID of the executed application 11, the number of threads generated for use in executing the application 11, and the state of each thread.

アプリケーション11の実行において並列処理が必要な場合には,原則として,スレッド生成部125により生成されたスレッドを利用して処理を実行する。このとき,並列処理を行うプログラムは,スレッド管理情報記憶部131に記憶されたスレッドの管理情報を参照し,未使用のスレッドを選択して並列処理を行う。このとき利用するスレッドについては,スレッド管理情報記憶部131に記憶されたスレッドの管理情報において,使用状態に設定する。例えば,図8に示すソースプログラム111において4行目〜6行目のDOループ文に対応する処理で,既生成スレッドを利用した並列処理が行われる。   When parallel processing is required in the execution of the application 11, in principle, the processing is executed using the thread generated by the thread generation unit 125. At this time, a program that performs parallel processing refers to the thread management information stored in the thread management information storage unit 131, selects an unused thread, and performs parallel processing. The thread used at this time is set to the use state in the thread management information stored in the thread management information storage unit 131. For example, in the source program 111 shown in FIG. 8, parallel processing using already generated threads is performed in the processing corresponding to the DO loop statements in the fourth to sixth lines.

アプリケーション11の実行形式プログラム114による非同期データ入出力開始処理において,実行時ライブラリ124の使用データ入出力決定部126は,使用するデータ入出力ロジックを決定する。本実施の形態では,データ入出力ロジックとして,スレッド利用入出力処理部127による既生成スレッドを利用するロジックと,システム利用入出力処理部128によるシステムコールまたはシステムライブラリの非同期I/Oを利用するロジックとが,実行時ライブラリ124で提供されている。非同期データ入出力開始処理は,例えば図8に示すソースプログラム111のOPEN文に応じた処理である。   In the asynchronous data input / output start processing by the execution format program 114 of the application 11, the used data input / output determining unit 126 of the runtime library 124 determines the data input / output logic to be used. In the present embodiment, as the data input / output logic, a logic using an already generated thread by the thread use input / output processing unit 127 and a system call by the system use input / output processing unit 128 or an asynchronous I / O of the system library are used. Logic is provided in the runtime library 124. The asynchronous data input / output start process is a process corresponding to the OPEN statement of the source program 111 shown in FIG. 8, for example.

アプリケーション11の実行形式プログラム114による非同期データ入出力実行処理において,実行時ライブラリ124のスレッド利用入出力処理部127またはシステム利用入出力処理部128は,データ入出力処理を実行する。   In asynchronous data input / output execution processing by the execution format program 114 of the application 11, the thread use input / output processing unit 127 or the system use input / output processing unit 128 of the runtime library 124 executes data input / output processing.

スレッド利用入出力処理部127は,スレッド生成部125によりすでに生成されているスレッドに空きがある場合に,その空き状態のスレッドを利用するデータ入出力処理を実行する。   When the thread already generated by the thread generation unit 125 is empty, the thread use input / output processing unit 127 executes data input / output processing using the empty thread.

システム利用入出力処理部128は,システムコールまたはシステムライブラリによって提供される非同期I/Oを利用するデータ入出力処理を実行する。   The system use input / output processing unit 128 executes data input / output processing using asynchronous I / O provided by a system call or a system library.

バッファ管理情報記憶部132は,ユーザ領域10に用意されたバッファの管理情報を記憶する,コンピュータ1がアクセス可能な記憶装置である。スレッド利用入出力処理部127またはシステム利用入出力処理部128によるデータ入出力処理において,ユーザ領域10に用意されたバッファを使用する場合がある。このとき,スレッド利用入出力処理部127やシステム利用入出力処理部128は,バッファ管理情報記憶部132に記憶されたバッファの管理情報を参照しながら,ユーザ領域10のバッファを使用する。   The buffer management information storage unit 132 is a storage device accessible by the computer 1 that stores management information of buffers prepared in the user area 10. In the data input / output processing by the thread use input / output processing unit 127 or the system use input / output processing unit 128, a buffer prepared in the user area 10 may be used. At this time, the thread use input / output processing unit 127 and the system use input / output processing unit 128 use the buffer in the user area 10 while referring to the buffer management information stored in the buffer management information storage unit 132.

図10は,本実施の形態のスレッド管理情報記憶部に格納された情報の例を示す図である。   FIG. 10 is a diagram illustrating an example of information stored in the thread management information storage unit according to the present embodiment.

図10に示すスレッド管理テーブル135は,スレッド管理情報記憶部131に記憶された,アプリケーション11の実行のために生成されたスレッドの管理情報の例である。図10に示すスレッド管理テーブル135では,プロセスIDが“01”で,生成されたスレッドの数がメインスレッドを含めてN個であるアプリケーション11についてのスレッドの情報が管理されている。なお,プロセスIDは,プロセスを一意に識別する識別情報である。   A thread management table 135 illustrated in FIG. 10 is an example of thread management information generated for execution of the application 11 and stored in the thread management information storage unit 131. The thread management table 135 shown in FIG. 10 manages thread information for the application 11 whose process ID is “01” and the number of generated threads is N including the main thread. The process ID is identification information for uniquely identifying a process.

スレッド管理テーブル135は,スレッド番号,スレッド状態などの情報を持つ。スレッド番号は,スレッドを一意に識別する識別情報である。スレッド状態は,スレッドが実行状態か,待ち状態かまたは未使用状態かを示す情報である。図10に示すスレッド管理テーブル135において,スレッド状態が“未使用”であるスレッドが,空き状態のスレッドである。   The thread management table 135 has information such as a thread number and a thread state. The thread number is identification information for uniquely identifying a thread. The thread status is information indicating whether the thread is in an execution state, a wait state, or an unused state. In the thread management table 135 shown in FIG. 10, a thread whose thread state is “unused” is a free thread.

図11は,本実施の形態のバッファ管理情報記憶部に格納された情報の例を示す図である。   FIG. 11 is a diagram illustrating an example of information stored in the buffer management information storage unit according to the present embodiment.

図11に示すバッファ管理テーブル136は,バッファ管理情報記憶部132に記憶された,アプリケーション11が利用可能なユーザ領域10のバッファを管理する情報の例である。図11に示すバッファ管理テーブル136では,M個のバッファの情報が管理されている。   The buffer management table 136 shown in FIG. 11 is an example of information for managing the buffer of the user area 10 that can be used by the application 11 and stored in the buffer management information storage unit 132. In the buffer management table 136 shown in FIG. 11, information on M buffers is managed.

バッファ管理テーブル136は,バッファ番号,バッファ使用状況などの情報を持つ。バッファ番号は,バッファを一意に識別する識別情報である。バッファ使用状況は,バッファが使用中であるか否かを示す情報である。図11に示すバッファ管理テーブル136のバッファ使用状況において,“ON”が使用中を示し,“OFF”が使用していないことを示す。   The buffer management table 136 has information such as buffer number and buffer usage status. The buffer number is identification information that uniquely identifies the buffer. The buffer usage status is information indicating whether or not the buffer is in use. In the buffer usage status of the buffer management table 136 shown in FIG. 11, “ON” indicates that it is in use, and “OFF” indicates that it is not being used.

図12は,本実施の形態の使用データ入出力決定部による使用データ入出力決定処理フローチャートである。   FIG. 12 is a use data input / output determination processing flowchart by the use data input / output determination unit of the present embodiment.

使用データ入出力決定部126は,ソースプログラム111の非同期入出力文に対応したデータ入出力処理の実行開始時に,使用するデータ入出力ロジックを決定する。例えば,図8に示すソースプログラム111では,OPEN文に非同期入出力を示す“ASYNCHRONUS='YES' ”が設定されている。このような“ASYNCHRONUS='YES' ”が設定されたOPEN文に対応した処理として,使用データ入出力決定部126は,使用するデータ入出力ロジックを決定する。   The use data input / output determination unit 126 determines the data input / output logic to be used when the execution of the data input / output process corresponding to the asynchronous input / output statement of the source program 111 is started. For example, in the source program 111 shown in FIG. 8, “ASYNCHRONUS = 'YES'” indicating asynchronous input / output is set in the OPEN statement. As a process corresponding to the OPEN statement in which “ASYNCHRONUS = 'YES'” is set, the use data input / output determination unit 126 determines the data input / output logic to be used.

使用データ入出力決定部126は,上述したように,既生成スレッドを利用するデータ入出力のロジックと,システムコールまたはシステムライブラリ22の非同期I/Oを利用するデータ入出力のロジックとから,使用するデータ入出力ロジックを決定する。以下,図12のフローチャートを用いて,使用データ入出力決定部126による使用データ入出力決定処理の一例を説明する。   As described above, the use data input / output determination unit 126 uses the data input / output logic using the already generated thread and the data input / output logic using the system call or the asynchronous I / O of the system library 22. Determine the data input / output logic to be performed. Hereinafter, an example of use data input / output determination processing by the use data input / output determination unit 126 will be described with reference to the flowchart of FIG.

使用データ入出力決定部126は,スレッド管理情報記憶部131に記憶された,スレッド管理テーブル135等のスレッドの管理情報を参照する(ステップS10)。使用データ入出力決定部126は,処理の並列実行が可能であるかを判定する(ステップS11)。ここでは,使用データ入出力決定部126は,例えば,複数スレッドが生成されているかなどを判定する。また,使用データ入出力決定部126は,空き状態のスレッドがあるかを判定する(ステップS12)。ここでは,使用データ入出力決定部126は,例えば,図10に示すスレッド管理テーブル135において,スレッド状態が“未使用”であるスレッドがあるかを判定する。   The usage data input / output determination unit 126 refers to the thread management information such as the thread management table 135 stored in the thread management information storage unit 131 (step S10). The usage data input / output determination unit 126 determines whether the processes can be executed in parallel (step S11). Here, the use data input / output determination unit 126 determines, for example, whether a plurality of threads are generated. In addition, the use data input / output determination unit 126 determines whether there is an idle thread (step S12). Here, the use data input / output determination unit 126 determines, for example, whether there is a thread whose thread state is “unused” in the thread management table 135 shown in FIG.

並列実行が可能であり(ステップS11のYES),かつ空き状態のスレッドがあれば(ステップS12のYES),使用データ入出力決定部126は,使用するデータ入出力ロジックとして,スレッド利用データ入出力処理を決定する(ステップS13)。このとき,使用データ入出力決定部126は,スレッド利用データ入出力処理を実現するモジュールのアドレス登録を行う。スレッド利用データ入出力処理は,スレッド利用入出力処理部127による既生成スレッドを利用するデータ入出力処理である。使用データ入出力決定部126は,空き状態のスレッドからデータ入出力に利用するスレッドを決定し,スレッド管理情報記憶部131に記憶されたスレッド管理テーブル135において,該当スレッドの状態を使用状態に設定する(ステップS14)。なお,スレッドを利用するデータ入出力処理の場合には,図8に示すソースプログラム111のCLOSE文に対応する処理の実行時に,スレッド管理情報記憶部131に記憶されたスレッド管理テーブル135において,該当スレッドの状態が未使用状態に戻される。   If parallel execution is possible (YES in step S11) and there is a free thread (YES in step S12), the use data input / output determination unit 126 uses the thread use data input / output as the data input / output logic to be used. Processing is determined (step S13). At this time, the use data input / output determination unit 126 performs address registration of a module that realizes thread use data input / output processing. The thread use data input / output process is a data input / output process using an already generated thread by the thread use input / output processing unit 127. The use data input / output determination unit 126 determines a thread to be used for data input / output from the idle threads, and sets the state of the corresponding thread to the use state in the thread management table 135 stored in the thread management information storage unit 131. (Step S14). Note that in the case of data input / output processing using threads, in the thread management table 135 stored in the thread management information storage unit 131 when the processing corresponding to the CLOSE statement of the source program 111 shown in FIG. The thread state is returned to the unused state.

並列実行が不可能である(ステップS11のNO),または空き状態のスレッドがない場合には(ステップS12のNO),使用データ入出力決定部126は,使用するデータ入出力処理ロジックとして,システム利用データ入出力処理を決定する(ステップS15)。このとき,使用データ入出力決定部126は,システム利用データ入出力処理を実現するモジュールのアドレス登録を行う。システム利用データ入出力処理は,システム利用入出力処理部128によるシステムコールまたはシステムライブラリ22の非同期I/Oを利用するデータ入出力処理である。   When parallel execution is impossible (NO in step S11) or there is no idle thread (NO in step S12), the used data input / output determining unit 126 uses the system as the data input / output processing logic to be used. Usage data input / output processing is determined (step S15). At this time, the use data input / output determination unit 126 registers the address of the module that realizes the system use data input / output processing. The system use data input / output process is a data input / output process using a system call by the system use input / output processing unit 128 or an asynchronous I / O of the system library 22.

本実施の形態では,既生成スレッドに空き状態のスレッドがあれば,優先的に,スレッド利用入出力処理部127によるスレッド利用データ入出力処理を選択する。データ入出力処理に利用する既生成スレッドは,自身のアプリケーション11の処理実行用に生成されたスレッドである。   In the present embodiment, if there is a free thread in the generated thread, the thread use data input / output processing by the thread use input / output processing unit 127 is preferentially selected. The already generated thread used for the data input / output process is a thread generated for executing the process of its own application 11.

上述したように,システムライブラリ22やシステムコールの非同期I/Oを利用するデータ入出力処理では,同時に待ち行列に入れる非同期I/Oの操作数や非同期I/O転送中にロック可能な最大メモリ容量制限が,システム全体で適用される値に依存する。そのため,他のアプリケーションの動作によっては,待ち行列やロック可能な最大メモリ容量が制限を超えて待ち状態となり,データ入出力の性能劣化が余儀なくされる可能性がある。   As described above, in the data input / output processing using the system library 22 and the asynchronous I / O of the system call, the maximum number of asynchronous I / O operations simultaneously queued and the maximum memory that can be locked during the asynchronous I / O transfer The capacity limit depends on the value applied throughout the system. Therefore, depending on the operation of other applications, the queue and the maximum memory capacity that can be locked exceed the limit, and there is a possibility that the performance of data input / output may be degraded.

これに対して,アプリケーション11の処理実行用に生成されたスレッドを利用したデータ入出力処理では,ロック可能な最大メモリ容量などをアプリケーション11側で管理できる。そのため,ロック可能な最大メモリ容量が制限を超えて待ち状態となってしまうことを回避でき,また処理性能が他のアプリケーションの動作に左右されることが少ない。このように,既生成スレッドに空き状態のスレッドがある場合に,そのスレッドを利用してデータ入出力を優先することで,データ入出力の性能向上を図れる。   On the other hand, in the data input / output processing using the thread generated for executing the processing of the application 11, the maximum memory capacity that can be locked can be managed on the application 11 side. Therefore, it can be avoided that the maximum memory capacity that can be locked exceeds the limit, and the processing performance is hardly affected by the operation of other applications. As described above, when there is a free thread in the generated threads, the data input / output performance can be improved by giving priority to the data input / output using the thread.

図13,図14を用いて,使用データ入出力決定部126によりスレッド利用データ入出力処理が決定された場合の,スレッド利用入出力処理部127による既生成スレッドを利用するデータ入出力処理の例を説明する。   13 and 14, an example of data input / output processing using an already generated thread by the thread use input / output processing unit 127 when the thread use data input / output processing is determined by the use data input / output determination unit 126. Will be explained.

図13は,本実施の形態による既生成スレッドを利用するデータ入出力処理の例を説明する図である。   FIG. 13 is a diagram for explaining an example of data input / output processing using an already generated thread according to the present embodiment.

図13において,メインスレッド115は,アプリケーション11のメインスレッドを示す。サブスレッドA116,サブスレッドB117,サブスレッドC118は,アプリケーション11の実行開始時に生成され,データ入出力処理の開始段階で,空き状態であったスレッドである。カーネル211は,OS21の中核として,コンピュータ1のハードウェア30の管理・制御や,ハードウェア30−ユーザ領域10間のやり取りの制御,プロセス間通信などの基本機能を提供する。なお,ユニットはファイルを示す。   In FIG. 13, the main thread 115 indicates the main thread of the application 11. The sub thread A 116, the sub thread B 117, and the sub thread C 118 are threads that are generated at the start of execution of the application 11 and are in an idle state at the start of data input / output processing. The kernel 211 provides basic functions such as management and control of the hardware 30 of the computer 1, control of exchange between the hardware 30 and the user area 10, and interprocess communication as the core of the OS 21. The unit indicates a file.

ユニットAに対する非同期入出力処理が実行されるときに,スレッド利用入出力処理部127は,メインスレッド115ではなく,空きスレッドであるサブスレッドA116を利用して,データ入出力を行う。   When the asynchronous input / output processing for the unit A is executed, the thread use input / output processing unit 127 performs data input / output using the sub thread A116 which is an empty thread instead of the main thread 115.

アプリケーション11のサブスレッドA116は,システムライブラリ22のデータ入出力処理を行う関数を呼び出す(S100)。ここでは,システムライブラリ22に含まれる同期入出力処理の関数が呼び出される。呼び出された同期入出力処理の関数によって,ユニットAに対するデータ入出力のシステムコールが発行される(S101)。   The sub thread A116 of the application 11 calls a function for performing data input / output processing of the system library 22 (S100). Here, a function of synchronous input / output processing included in the system library 22 is called. A data input / output system call for unit A is issued by the called function of synchronous input / output processing (S101).

ユニットAに対するデータ入出力処理は,サブスレッドA116によって実行されるので,アプリケーション11のメインスレッド115は,サブスレッドA116によるデータ入出力処理とは並列に,他の処理が実行できる。なお,図13に示す例ではサブスレッドA116でデータ入出力処理を行っているが,メインスレッド115でデータ入出力処理を行い,サブスレッドA116で他の処理を実行するようにしてもよい。   Since the data input / output process for the unit A is executed by the sub thread A 116, the main thread 115 of the application 11 can execute other processes in parallel with the data input / output process by the sub thread A 116. In the example shown in FIG. 13, data input / output processing is performed by the sub thread A 116, but data input / output processing may be performed by the main thread 115, and other processing may be executed by the sub thread A 116.

同様に,ユニットBに対する非同期入出力処理,ユニットCに対する非同期入出力処理が実行される場合に,空き状態のサブスレッドB117,サブスレッドC118があれば,スレッド利用入出力処理部127は,サブスレッドB117,サブスレッドC118を利用してデータ入出力を行う。すなわち,アプリケーション11のサブスレッドB117は,システムライブラリ22に含まれる同期入出力処理の関数を呼び出す(S102)。呼び出されたシステムライブラリ22に含まれる同期入出力処理の関数によって,ユニットBに対するデータ入出力のシステムコールが発行される(S103)。同様に,アプリケーション11のサブスレッドC118は,システムライブラリ22に含まれる同期入出力処理の関数を呼び出す(S104)。呼び出されたシステムライブラリ22に含まれる同期入出力処理の関数によって,ユニットCに対するデータ入出力のシステムコールが発行される(S105)。   Similarly, when asynchronous I / O processing for unit B and asynchronous I / O processing for unit C are executed, if there is a free sub thread B 117 and sub thread C 118, the thread use I / O processing unit 127 Data input / output is performed using B117, sub thread C118. That is, the sub thread B 117 of the application 11 calls a function of synchronous input / output processing included in the system library 22 (S102). A data input / output system call for the unit B is issued by the function of the synchronous input / output processing included in the called system library 22 (S103). Similarly, the sub thread C118 of the application 11 calls a function of synchronous input / output processing included in the system library 22 (S104). A data input / output system call for unit C is issued by the function of the synchronous input / output process included in the called system library 22 (S105).

サブスレッドA116,サブスレッドB117,サブスレッドC118によってデータ入出力処理を行っている間に,アプリケーションのメインスレッド115は,それらのデータ入出力処理とは並列に,他の処理が実行できる。   While the data input / output processing is being performed by the sub thread A 116, the sub thread B 117, and the sub thread C 118, the main thread 115 of the application can execute other processing in parallel with the data input / output processing.

また,データ入出力処理に,ユーザ領域10に用意されたバッファを使用してもよい。例えば,サブスレッドA116は,出力データが記憶されたアプリケーション11のメモリ領域からバッファに転送する。サブスレッドA116は,システムライブラリ22のデータ出力処理の関数を呼び出して,バッファからファイルAへのデータ出力処理を行う。サブスレッドA116は,メモリ領域上のすべての該当データを出力するまで,これらの処理を繰り返す。なお,バッファを複数個用意して,それらの複数のバッファを交互に使用しながら,バッファへのデータ転送とシステムライブラリ22の関数の呼び出しとを実行するようにしてもよい。   A buffer prepared in the user area 10 may be used for data input / output processing. For example, the sub thread A 116 transfers the output data from the memory area of the application 11 to the buffer. The sub thread A 116 calls a data output processing function of the system library 22 and performs data output processing from the buffer to the file A. The sub thread A116 repeats these processes until all corresponding data on the memory area is output. Note that a plurality of buffers may be prepared, and data transfer to the buffer and function call of the system library 22 may be executed while alternately using the plurality of buffers.

図14は,本実施の形態のスレッド利用入出力処理部によるスレッド利用データ入出力処理フローチャートである。   FIG. 14 is a thread use data input / output processing flowchart by the thread use input / output processing unit of this embodiment.

スレッド利用入出力処理部127は,図14に示すフローチャートによる処理を,データ入出力処理の実行に割り当てられた,空き状態の既生成スレッドに実行させる。ここでは,データ入出力処理の実行に割り当てられたスレッドを,データ入出力用スレッドと呼ぶものとする。なお,実行時ライブラリ124に含まれるスレッド利用入出力処理部127を実現するプログラムは,引数として,入出力を行うメモリ領域上のデータまたは変数領域のアドレス,入出力するデータの長さ,入出力する変数の数等を受ける。   The thread use input / output processing unit 127 causes the already-created thread in a free state assigned to the execution of the data input / output process to execute the process according to the flowchart shown in FIG. Here, a thread assigned to the execution of data input / output processing is referred to as a data input / output thread. The program that implements the thread use input / output processing unit 127 included in the runtime library 124 has, as arguments, the data on the memory area to be input / output, the address of the variable area, the length of the input / output data, The number of variables to be received.

実行する処理がデータ入力処理であれば(ステップS20の入力),データ入出力用スレッドは,システムコールまたはシステムライブラリ22により,ディスク33からユーザ領域10のバッファへのデータ読み出しを行う(ステップS21)。データ入出力用スレッドは,バッファ上にあるデータを,アプリケーション11のメモリ領域に転送する(ステップS22)。データ入出力用スレッドは,ステップS21,S22の処理を,全入力変数について終了するまで繰り返す(ステップS23)。   If the process to be executed is a data input process (input in step S20), the data input / output thread reads data from the disk 33 to the buffer in the user area 10 by the system call or the system library 22 (step S21). . The data input / output thread transfers the data on the buffer to the memory area of the application 11 (step S22). The data input / output thread repeats the processes of steps S21 and S22 until all input variables are completed (step S23).

実行する処理がデータ出力処理であれば(ステップS20の出力),データ入出力用スレッドは,アプリケーション11のメモリ領域上の出力対象となるデータを,ユーザ領域10のバッファに転送する(ステップS24)。データ入出力用スレッドは,システムコールまたはシステムライブラリ22により,バッファからディスク33へのデータ書き出しを行う(ステップS25)。データ入出力用スレッドは,ステップS24,S25の処理を,メモリ領域上の出力対象となる全データについて終了するまで繰り返す(ステップS26)。   If the process to be executed is a data output process (output in step S20), the data input / output thread transfers the data to be output on the memory area of the application 11 to the buffer in the user area 10 (step S24). . The data input / output thread writes data from the buffer to the disk 33 by the system call or the system library 22 (step S25). The data input / output thread repeats the processing in steps S24 and S25 until the processing is completed for all data to be output on the memory area (step S26).

本実施の形態では,スレッドを利用したデータ入出力処理の開始時に,スレッドの生成を行わない。データ入出力処理に利用するスレッドは,アプリケーション11の実行開始時に,アプリケーション11の実行で汎用的に使用するためにスレッド生成部125によって生成されたスレッドのうちの,空き状態のスレッドである。データ入出力処理の開始時に,データ入出力のためのスレッドを生成するコストが省けるため,データ入出力処理実行時の性能が向上する。また,スレッドを利用したデータ入出力処理を行うのは,既生成スレッドに空き状態のスレッドがある場合のみであり,データ入出力処理のために新たなスレッドを増やさない。そのため,データ入出力のためにスレッドを増やし過ぎて,処理性能が劣化することはない。   In this embodiment, no thread is generated when data input / output processing using a thread is started. The thread used for the data input / output processing is a free thread among the threads generated by the thread generation unit 125 for general use in the execution of the application 11 when the execution of the application 11 is started. Since the cost of generating a thread for data input / output at the start of data input / output processing can be saved, the performance when executing data input / output processing is improved. Also, data input / output processing using threads is performed only when there is a free thread in the generated threads, and no new threads are added for data input / output processing. Therefore, the processing performance does not deteriorate due to an excessive number of threads for data input / output.

図15〜図17を用いて,使用データ入出力決定部126によりシステム利用データ入出力処理が決定された場合の,システム利用入出力処理部128によるシステムコールまたはシステムライブラリ22の非同期I/Oを利用するデータ入出力の例を説明する。   A system call or asynchronous I / O of the system library 22 by the system usage input / output processing unit 128 when the system usage data input / output processing is determined by the usage data input / output determination unit 126 with reference to FIGS. An example of data input / output to be used will be described.

本実施の形態のシステム利用入出力処理部128によるシステム利用データ入出力処理では,OS21等のシステム側から提供されるシステムコールやシステムライブラリ22がサポートする非同期I/Oを利用したデータ入出力が行われる。   In the system utilization data input / output processing by the system utilization input / output processing unit 128 according to the present embodiment, system calls provided from the system side such as the OS 21 and data input / output using asynchronous I / O supported by the system library 22 are performed. Done.

ただし,本実施の形態のシステム利用入出力処理部128は,データの入力と出力とで,ユーザ領域10のバッファの使用と不使用とを使い分ける。すなわち,システムが提供する非同期I/Oを利用したデータ入力処理では複数のバッファを使用し,システムが提供する非同期I/Oを利用したデータ出力処理ではバッファを使用しない。   However, the system utilization input / output processing unit 128 according to the present embodiment uses the buffer of the user area 10 and the non-use depending on the data input and output. That is, a plurality of buffers are used in data input processing using asynchronous I / O provided by the system, and no buffer is used in data output processing using asynchronous I / O provided by the system.

システムコールやシステムライブラリ22の非同期I/Oを利用したデータ入出力処理において,データ入力とデータ出力とで,ユーザ領域10のバッファの使用と不使用とを切り替えることで,より高速なデータ入出力が可能となる。   In data input / output processing using asynchronous I / O of system calls and system library 22, data input and data output can be switched between using and not using the buffer in the user area 10 for faster data input / output Is possible.

図15は,本実施の形態によるシステムの非同期I/Oを利用したデータ入力処理の例を説明する図である。   FIG. 15 is a diagram for explaining an example of data input processing using asynchronous I / O of the system according to this embodiment.

図15に示す非同期I/Oを利用したデータ入力処理では,システムライブラリ22が提供するAIO関数と,M個のバッファとを利用することにより,バッファへのデータ入力と,バッファからアプリケーション11のメモリ領域へのデータ転送とを,並行して行う。バッファは,バッファ管理情報記憶部132に記憶されたバッファ管理テーブル136によって管理されている。   In the data input process using the asynchronous I / O shown in FIG. 15, the AIO function provided by the system library 22 and M buffers are used to input data to the buffer, and from the buffer to the memory of the application 11. Data transfer to the area is performed in parallel. The buffer is managed by a buffer management table 136 stored in the buffer management information storage unit 132.

バッファ#0を指定した非同期入力が実行されると,アプリケーション11は,システムライブラリ22のデータ入力処理を行うAIO関数を呼び出す(S110)。呼び出されたデータ入力処理を行うAIO関数によって,データ入力のシステムコールが発行される(S111)。なお,非同期I/Oなので,アプリケーション11は,バッファ#0へのデータ入力の完了を待たずに,別の処理を実行できる。   When asynchronous input specifying buffer # 0 is executed, the application 11 calls an AIO function for performing data input processing of the system library 22 (S110). A system call for data input is issued by the called AIO function for performing data input processing (S111). Since the application 11 is asynchronous I / O, the application 11 can execute another process without waiting for completion of data input to the buffer # 0.

同様に,バッファ#1〜バッファ#M−1を指定した非同期入力が順に実行されると,アプリケーション11からシステムライブラリ22のデータ入力処理を行うAIO関数の呼び出し(S112,... S114),AIO関数からデータ入力のシステムコールの発行(S113,... ,S115)が行われる。   Similarly, when asynchronous input designating buffer # 1 to buffer # M-1 is executed in sequence, an AIO function call for performing data input processing of system library 22 from application 11 (S112,... S114), AIO A system call for data input from the function is issued (S113,..., S115).

バッファ#0へのデータ入力が完了すると,カーネル211は,システムライブラリ22のAIO関数にバッファ#0についてのI/O完了通知を返す(S116)。システムライブラリ22のAIO関数は,アプリケーション11に処理を返す(S117)。   When the data input to the buffer # 0 is completed, the kernel 211 returns an I / O completion notification for the buffer # 0 to the AIO function of the system library 22 (S116). The AIO function of the system library 22 returns processing to the application 11 (S117).

バッファ#0へのデータ入力完了を受けたアプリケーション11は,他のバッファへのデータ入力処理と並行に,バッファ#0からアプリケーション11のメモリ領域へのデータ転送の処理を実行する。なお,他のバッファにも収まらない入力データがまだある場合には,バッファ#0からメモリ領域へのデータ転送完了後,バッファ#0を指定した次のデータの非同期入力が実行される。   Upon receiving the completion of data input to the buffer # 0, the application 11 executes data transfer processing from the buffer # 0 to the memory area of the application 11 in parallel with data input processing to other buffers. If there is still input data that cannot be stored in other buffers, asynchronous input of the next data specifying buffer # 0 is executed after completion of data transfer from buffer # 0 to the memory area.

同様に,バッファ#1へのデータ入力が完了すると,カーネル211は,システムライブラリ22のAIO関数にバッファ#1についてのI/O完了通知を返し(S118),AIO関数はアプリケーション11に処理を返す(S119)。バッファ#1へのデータ入力完了を受けたアプリケーション11は,他のバッファへのデータ入力処理と並行に,バッファ#1からアプリケーション11のメモリ領域へのデータ転送の処理を実行する。以下,バッファ#2以降も,同様の処理が行われる。   Similarly, when data input to the buffer # 1 is completed, the kernel 211 returns an I / O completion notification for the buffer # 1 to the AIO function of the system library 22 (S118), and the AIO function returns processing to the application 11. (S119). Upon receiving the completion of data input to the buffer # 1, the application 11 executes data transfer processing from the buffer # 1 to the memory area of the application 11 in parallel with data input processing to other buffers. Thereafter, the same processing is performed for the buffer # 2 and thereafter.

このように,本実施の形態のシステムライブラリ22の非同期I/Oを利用したデータ入力では,一度にできるだけ多くのデータをアプリケーション11側で処理するために,複数のバッファを交互に用いたデータの入力を行う。アプリケーション11はシステムライブラリ22のAIO関数に対して必要な分だけの入力要求を行い,データがバッファに転送された時点で,アプリケーション11側でデータの処理を実施することができる。これにより,例えばディスク33からバッファへのデータ入力と,アプリケーション11での入力したデータの処理とを,並列に実行することができる。そのため,システムの非同期I/Oを用いたデータ入力時の性能が,向上する。   As described above, in the data input using the asynchronous I / O of the system library 22 according to the present embodiment, in order to process as much data as possible on the application 11 side at the same time, Make input. The application 11 requests the AIO function of the system library 22 as much as necessary, and the data can be processed on the application 11 side when the data is transferred to the buffer. Thereby, for example, data input from the disk 33 to the buffer and processing of the input data by the application 11 can be executed in parallel. Therefore, the performance at the time of data input using the asynchronous I / O of the system is improved.

図16は,本実施の形態によるシステムの非同期I/Oを利用したデータ出力処理の例を説明する図である。   FIG. 16 is a diagram for explaining an example of data output processing using asynchronous I / O of the system according to the present embodiment.

図16に示す非同期I/Oを利用したデータ出力処理では,バッファを使用せずに,アプリケーション11のメモリ領域上の出力対象となるデータを,システムライブラリ22が提供するAIO関数を利用して出力する。ここでは,入力変数X,Y,Zのそれぞれについて,非同期I/Oを利用したデータ出力を行うものとする。   In the data output processing using the asynchronous I / O shown in FIG. 16, the output target data on the memory area of the application 11 is output using the AIO function provided by the system library 22 without using the buffer. To do. Here, it is assumed that data output using asynchronous I / O is performed for each of the input variables X, Y, and Z.

入力変数Xについての非同期出力が実行されると,アプリケーション11は,システムライブラリ22のデータ出力処理を行うAIO関数を呼び出す(S120)。このとき,データ出力処理を行うAIO関数には,出力対象となるデータが記憶されているメモリ領域のアドレスや出力対象となるデータの長さ等の情報が渡される。呼び出されたデータ出力処理を行うAIO関数によって,データ出力のシステムコールが発行される(S121)。なお,非同期I/Oなので,アプリケーション11は,入力変数Xについてのデータ出力の完了を待たずに,別の処理を実行できる。   When asynchronous output for the input variable X is executed, the application 11 calls an AIO function for performing data output processing of the system library 22 (S120). At this time, information such as the address of the memory area in which the data to be output is stored and the length of the data to be output is passed to the AIO function that performs the data output process. A data output system call is issued by the called AIO function for performing data output processing (S121). Since the application 11 is asynchronous I / O, the application 11 can execute another process without waiting for the completion of data output for the input variable X.

同様に,入力変数Y,入力変数Zについての非同期出力が順に実行されると,アプリケーション11からシステムライブラリ22のデータ出力処理を行うAIO関数の呼び出し(S122,... S123),AIO関数からデータ出力のシステムコールの発行(S124,... ,S125)が行われる。   Similarly, when asynchronous output for the input variable Y and the input variable Z is sequentially executed, the application 11 calls the AIO function for performing the data output processing of the system library 22 (S122,... S123), and the data from the AIO function. An output system call is issued (S124,..., S125).

入力変数Xについてのデータ出力が完了すると,カーネル211は,システムライブラリ22のAIO関数に入力変数XについてのI/O完了通知を返す(S126)。システムライブラリ22のAIO関数は,アプリケーション11に処理を返す(S127)。   When the data output for the input variable X is completed, the kernel 211 returns an I / O completion notification for the input variable X to the AIO function of the system library 22 (S126). The AIO function of the system library 22 returns processing to the application 11 (S127).

同様に,入力変数Y,入力変数Zについてのデータ出力が完了すると,カーネル211は,システムライブラリ22のAIO関数に入力変数Y,入力変数ZについてのI/O完了通知を返し(S128,S130),AIO関数はアプリケーション11に処理を返す(S129,S131)。   Similarly, when the data output for the input variable Y and the input variable Z is completed, the kernel 211 returns an I / O completion notification for the input variable Y and the input variable Z to the AIO function of the system library 22 (S128, S130). The AIO function returns processing to the application 11 (S129, S131).

このように,本実施の形態のシステムライブラリ22の非同期I/Oを利用したデータ出力では,バッファを使用せずに,アプリケーション11のメモリ領域上にあるデータをそのまま出力する。非同期I/Oを利用したデータ出力では,バッファにデータをコピーすると,コピーしたデータをシステムコールに渡す間に,待ち状態が発生する。バッファを使用せずに,アプリケーション11のメモリ領域から直接にシステムライブラリ22にデータを渡すことにより,アプリケーション11の処理待ちの状態を減らすことができる。   As described above, in the data output using the asynchronous I / O of the system library 22 of this embodiment, the data in the memory area of the application 11 is output as it is without using the buffer. In data output using asynchronous I / O, when data is copied to the buffer, a wait state occurs while the copied data is passed to the system call. By passing data directly from the memory area of the application 11 to the system library 22 without using a buffer, it is possible to reduce the processing wait state of the application 11.

図17は,本実施の形態のシステム利用入出力処理部によるシステム利用データ入出力処理フローチャートである。   FIG. 17 is a system use data input / output processing flowchart by the system use input / output processing unit of the present embodiment.

実行する処理がデータ入力処理であれば(ステップS30の入力),システム利用入出力処理部128は,バッファ管理情報記憶部132に記憶されたバッファ管理テーブル136を参照し,バッファ使用状況がOFFのバッファごとに,以下のステップS31〜S34の処理を繰り返す。   If the process to be executed is a data input process (input in step S30), the system use input / output processing unit 128 refers to the buffer management table 136 stored in the buffer management information storage unit 132, and the buffer usage status is OFF. The following steps S31 to S34 are repeated for each buffer.

システム利用入出力処理部128は,システムコールまたはシステムライブラリ22により,ディスク33からユーザ領域10の該当バッファへのデータ読み出しを行う(ステップS31)。システム利用入出力処理部128は,バッファ管理情報記憶部132に記憶されたバッファ管理テーブル136において,該当バッファのバッファ使用状況をONに設定する(ステップS32)。システム利用入出力処理部128は,バッファ上にあるデータを,アプリケーション11のメモリ領域に転送する(ステップS33)。システム利用入出力処理部128は,I/O完了通知受領後,バッファ管理情報記憶部132に記憶されたバッファ管理テーブル136において,該当バッファのバッファ使用状況をOFFに設定する(ステップS34)。   The system use input / output processing unit 128 reads data from the disk 33 to the corresponding buffer in the user area 10 by the system call or the system library 22 (step S31). The system utilization input / output processing unit 128 sets the buffer usage status of the corresponding buffer to ON in the buffer management table 136 stored in the buffer management information storage unit 132 (step S32). The system use input / output processing unit 128 transfers the data on the buffer to the memory area of the application 11 (step S33). After receiving the I / O completion notification, the system usage input / output processing unit 128 sets the buffer usage status of the corresponding buffer to OFF in the buffer management table 136 stored in the buffer management information storage unit 132 (step S34).

システム利用入出力処理部128は,ステップS31〜S34のバッファごとの処理を,全入力変数について終了するまで繰り返す(ステップS35)。   The system use input / output processing unit 128 repeats the processing for each buffer in steps S31 to S34 until all input variables are completed (step S35).

実行する処理がデータ出力処理であれば(ステップS30の出力),システム利用入出力処理部128は,システムコールまたはシステムライブラリ22により,アプリケーション11のメモリ領域にあるデータをディスク33に書き出す(ステップS36)。システム利用入出力処理部128は,ステップS36の処理を,メモリ領域上の出力対象となる全データについて終了するまで繰り返す(ステップS37)。   If the process to be executed is the data output process (the output of step S30), the system use input / output processing unit 128 writes the data in the memory area of the application 11 to the disk 33 by the system call or the system library 22 (step S36). ). The system use input / output processing unit 128 repeats the processing in step S36 until the processing is completed for all data to be output in the memory area (step S37).

以上説明した,本実施の形態の非同期入出力文に対応するデータ入出力制御の技術によって,データ入出力処理開始時に適切な実行モデルを判断して,高速にデータ入出力を実行することが可能となる。   By the data input / output control technology corresponding to the asynchronous input / output statement of this embodiment as described above, it is possible to determine an appropriate execution model at the start of data input / output processing and execute data input / output at high speed. It becomes.

以上説明した本実施の形態のアプリケーション11または実行時ライブラリ124による処理は,コンピュータが備えるCPU31,メモリ32等のハードウェア30とソフトウェアプログラムとにより実現することができ,そのプログラムをコンピュータ読み取り可能な記録媒体に記録することも,ネットワークを通して提供することも可能である。   The processing by the application 11 or the runtime library 124 of the present embodiment described above can be realized by the hardware 31 such as the CPU 31 and the memory 32 provided in the computer and the software program, and the program can be read by the computer. It can be recorded on a medium or provided through a network.

以上,本実施の形態について説明したが,本発明はその主旨の範囲において種々の変形が可能であることは当然である。   Although the present embodiment has been described above, the present invention can naturally be modified in various ways within the scope of the gist thereof.

1 コンピュータ
10 ユーザ領域
11 アプリケーション
111 ソースプログラム
112 アセンブラソース
113 オブジェクトコード
114 実行形式プログラム
12 コンパイラ/ライブラリ
121 コンパイラ
122 アセンブラ
123 リンカ
124 実行時ライブラリ
125 スレッド生成部
126 使用データ入出力決定部
127 スレッド利用入出力処理部
128 システム利用入出力処理部
131 スレッド管理情報記憶部
132 バッファ管理情報記憶部
20 システム領域
21 OS
211 カーネル
22 システムライブラリ
30 ハードウェア
31 CPU
32 メモリ
33 ディスク
DESCRIPTION OF SYMBOLS 1 Computer 10 User area 11 Application 111 Source program 112 Assembler source 113 Object code 114 Executable program 12 Compiler / library 121 Compiler 122 Assembler 123 Linker 124 Runtime library 125 Thread generation part 126 Use data input / output determination part 127 Thread use input / output Processing unit 128 System utilization input / output processing unit 131 Thread management information storage unit 132 Buffer management information storage unit 20 System area 21 OS
211 Kernel 22 System Library 30 Hardware 31 CPU
32 memory 33 disks

Claims (4)

プログラミング言語の非同期入出力文を含むソースプログラムによって作成されたアプリケーションの前記非同期入出力文に対応する処理を,コンピュータによって実現するデータ入出力制御方法であって,
前記コンピュータが,
前記アプリケーションの実行開始の際に,前記アプリケーションの実行に使用する所定数のスレッドを生成し,生成したスレッドを管理する管理情報を,前記コンピュータがアクセス可能な記憶装置に記憶する処理と,
前記アプリケーションにおける前記非同期入出力文に対応するデータ入出力処理の開始の際に,前記管理情報を参照して,前記生成したスレッド中に未使用状態のスレッドがある場合には,スレッド利用データ入出力処理を行うと決定し,前記生成したスレッド中に未使用状態のスレッドがない場合には,非同期I/O利用データ入出力処理を行うと決定する処理と,
スレッド利用データ入出力処理を行うと決定した場合に,前記管理情報においてデータ入出力処理に利用する前記未使用状態のスレッドの状態をデータ入出力処理が終了するまで使用状態に設定し,前記未使用状態のスレッドを利用するデータ入出力処理を実行する処理と,
非同期I/O利用データ入出力処理を行うと決定した場合に,システムコールまたはシステムライブラリにより提供される非同期I/Oを利用するデータ入出力処理を実行する処理とを実行する
ことを特徴とするデータ入出力制御方法。
A data input / output control method for realizing, by a computer, processing corresponding to the asynchronous input / output statement of an application created by a source program including an asynchronous input / output statement of a programming language,
The computer is
A process of generating a predetermined number of threads used to execute the application at the start of execution of the application, and storing management information for managing the generated threads in a storage device accessible by the computer;
At the start of data input / output processing corresponding to the asynchronous input / output statement in the application, referring to the management information, if there is an unused thread in the generated thread, thread utilization data is input. If it is determined that output processing is to be performed and there is no unused thread among the generated threads, processing to determine to perform asynchronous I / O utilization data input / output processing,
If it is determined that thread input / output data input / output processing is to be performed, the state of the unused thread to be used for data input / output processing in the management information is set to the use state until the data input / output processing is completed. Processing to execute data input / output processing using the thread in use,
When it is decided to perform data input / output processing using asynchronous I / O, a process for executing data input / output processing using asynchronous I / O provided by a system call or system library is executed. Data input / output control method.
前記システムコールまたはシステムライブラリにより提供される非同期I/Oを利用するデータ入出力処理を実行する処理では,データ入力処理では前記コンピュータのユーザ領域に用意された複数のバッファを使用したデータの入力を行い,データ出力処理では前記コンピュータのユーザ領域に用意されたバッファを使用しないデータの出力を行う
ことを特徴とするデータ入出力制御方法。
In the process of executing the data input / output process using the asynchronous I / O provided by the system call or the system library, the data input process inputs data using a plurality of buffers prepared in the user area of the computer. A data input / output control method comprising: performing data output without outputting a buffer prepared in a user area of the computer.
プログラミング言語の非同期入出力文を含むソースプログラムによって作成されたアプリケーションの前記非同期入出力文に対応する処理を,コンピュータに実行させるためのプログラムであって,
前記コンピュータに,
前記アプリケーションの実行開始の際に,前記アプリケーションの実行に使用する所定数のスレッドを生成し,生成したスレッドを管理する管理情報を,前記コンピュータがアクセス可能な記憶装置に記憶する手順と,
前記アプリケーションにおける前記非同期入出力文に対応するデータ入出力処理の開始の際に,前記管理情報を参照して,前記生成したスレッド中に未使用状態のスレッドがある場合には,スレッド利用データ入出力処理を行うと決定し,前記生成したスレッド中に未使用状態のスレッドがない場合には,非同期I/O利用データ入出力処理を行うと決定する手順と,
スレッド利用データ入出力処理を行うと決定した場合に,前記管理情報においてデータ入出力処理に利用する前記未使用状態のスレッドの状態をデータ入出力処理が終了するまで使用状態に設定し,前記未使用状態のスレッドを利用するデータ入出力処理を実行する手順と,
非同期I/O利用データ入出力処理を行うと決定した場合に,システムコールまたはシステムライブラリにより提供される非同期I/Oを利用するデータ入出力処理を実行する手順とを
実行させるためのデータ入出力制御プログラム。
A program for causing a computer to execute processing corresponding to an asynchronous input / output statement of an application created by a source program including an asynchronous input / output statement of a programming language,
In the computer,
A procedure for generating a predetermined number of threads used to execute the application at the start of execution of the application, and storing management information for managing the generated threads in a storage device accessible by the computer;
At the start of data input / output processing corresponding to the asynchronous input / output statement in the application, referring to the management information, if there is an unused thread in the generated thread, thread utilization data is input. A procedure for deciding to perform output processing and, if there are no unused threads among the generated threads, determining to perform asynchronous I / O utilization data input / output processing;
If it is determined that thread input / output data input / output processing is to be performed, the state of the unused thread to be used for data input / output processing in the management information is set to the use state until the data input / output processing is completed. A procedure for executing data input / output processing using a thread in use;
Data input / output to execute data input / output processing using asynchronous I / O provided by a system call or system library when it is decided to perform data input / output processing using asynchronous I / O Control program.
プログラミング言語の非同期入出力文を含むソースプログラムによって作成されたアプリケーションの前記非同期入出力文に対応する処理を実行するデータ入出力制御装置であって,
前記アプリケーションの実行開始の際に,前記アプリケーションの実行に使用する所定数のスレッドを生成するスレッド生成部と,
前記生成したスレッドを管理する管理情報を記憶するスレッド管理情報記憶部と,
前記アプリケーションにおける前記非同期入出力文に対応するデータ入出力処理の開始の際に,前記管理情報を参照して,前記生成したスレッド中に未使用状態のスレッドがある場合には,スレッド利用データ入出力処理を行うと決定し,前記生成したスレッド中に未使用状態のスレッドがない場合には,非同期I/O利用データ入出力処理を行うと決定する使用データ入出力決定部と,
スレッド利用データ入出力処理を行うと決定した場合に,前記管理情報においてデータ入出力処理に利用する前記未使用状態のスレッドの状態をデータ入出力処理が終了するまで使用状態に設定し,前記未使用状態のスレッドを利用するデータ入出力処理を実行するスレッド利用入出力処理部と,
非同期I/O利用データ入出力処理を行うと決定した場合に,システムコールまたはシステムライブラリにより提供される非同期I/Oを利用するデータ入出力処理を実行するシステム利用入出力処理部とを備える
ことを特徴とするデータ入出力制御装置。
A data input / output control device for executing processing corresponding to an asynchronous input / output statement of an application created by a source program including an asynchronous input / output statement of a programming language,
A thread generation unit that generates a predetermined number of threads used to execute the application at the start of execution of the application;
A thread management information storage unit for storing management information for managing the generated thread;
At the start of data input / output processing corresponding to the asynchronous input / output statement in the application, referring to the management information, if there is an unused thread in the generated thread, thread utilization data is input. A use data input / output determination unit that determines to perform an asynchronous I / O use data input / output process when there is no unused thread among the generated threads;
If it is determined that thread input / output data input / output processing is to be performed, the state of the unused thread to be used for data input / output processing in the management information is set to the use state until the data input / output processing is completed. A threaded input / output processing unit that executes data input / output processing using threads in use;
A system usage I / O processing unit that executes data I / O processing using asynchronous I / O provided by a system call or system library when it is decided to perform asynchronous I / O usage data I / O processing A data input / output control device.
JP2010064417A 2010-03-19 2010-03-19 Data input / output control method, data input / output control program, and data input / output control device Expired - Fee Related JP5540799B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010064417A JP5540799B2 (en) 2010-03-19 2010-03-19 Data input / output control method, data input / output control program, and data input / output control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010064417A JP5540799B2 (en) 2010-03-19 2010-03-19 Data input / output control method, data input / output control program, and data input / output control device

Publications (2)

Publication Number Publication Date
JP2011198063A true JP2011198063A (en) 2011-10-06
JP5540799B2 JP5540799B2 (en) 2014-07-02

Family

ID=44876171

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010064417A Expired - Fee Related JP5540799B2 (en) 2010-03-19 2010-03-19 Data input / output control method, data input / output control program, and data input / output control device

Country Status (1)

Country Link
JP (1) JP5540799B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170071180A (en) * 2015-12-15 2017-06-23 삼성전자주식회사 Storage system and method for connection-based load balancing
JP2018106472A (en) * 2016-12-27 2018-07-05 日立オートモティブシステムズ株式会社 Control device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0251740A (en) * 1988-08-15 1990-02-21 Fujitsu Ltd Control system for process allocation
JPH06110813A (en) * 1992-09-28 1994-04-22 Nec Corp Asynchronous data input/output system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0251740A (en) * 1988-08-15 1990-02-21 Fujitsu Ltd Control system for process allocation
JPH06110813A (en) * 1992-09-28 1994-04-22 Nec Corp Asynchronous data input/output system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20170071180A (en) * 2015-12-15 2017-06-23 삼성전자주식회사 Storage system and method for connection-based load balancing
KR102509988B1 (en) * 2015-12-15 2023-03-14 삼성전자주식회사 Storage system and method for connection-based load balancing
JP2018106472A (en) * 2016-12-27 2018-07-05 日立オートモティブシステムズ株式会社 Control device
WO2018123707A1 (en) * 2016-12-27 2018-07-05 日立オートモティブシステムズ株式会社 Control device

Also Published As

Publication number Publication date
JP5540799B2 (en) 2014-07-02

Similar Documents

Publication Publication Date Title
JP6294586B2 (en) Execution management system combining instruction threads and management method
JP5658365B2 (en) Method, system and program for high throughput computing in a hybrid computing environment
JP2009265963A (en) Information processing system and task execution control method
EP3425502A1 (en) Task scheduling method and device
JP5245722B2 (en) Scheduler, processor system, program generation device, and program generation program
US8402470B2 (en) Processor thread load balancing manager
KR100958303B1 (en) A System and A Method for Dynamic Loading and Execution of Module Devices using Inter-Core-Communication Channel in Multicore system environment
WO2017070900A1 (en) Method and apparatus for processing task in a multi-core digital signal processing system
KR101640848B1 (en) Job Allocation Method on Multi-core System and Apparatus thereof
JP2010079622A (en) Multi-core processor system and task control method thereof
KR20090018068A (en) Virtual machine for operating n-core application on m-core processor
JP2015504226A (en) Multi-threaded computing
KR100883655B1 (en) System and method for switching context in reconfigurable processor
WO2016092856A1 (en) Information processing device, information processing system, task processing method, and storage medium for storing program
US10545890B2 (en) Information processing device, information processing method, and program
KR20070090649A (en) Apparatus and method for providing cooperative scheduling on multi-core system
JP5030647B2 (en) Method for loading a program in a computer system including a plurality of processing nodes, a computer readable medium containing the program, and a parallel computer system
EP3067796A1 (en) Information processing device, information processing method, recording medium, calculation processing device, calculation processing method
JP5540799B2 (en) Data input / output control method, data input / output control program, and data input / output control device
JP6368452B2 (en) Improved scheduling of tasks performed by asynchronous devices
JP5678347B2 (en) IT system configuration method, computer program thereof, and IT system
KR101332839B1 (en) Host node and memory management method for cluster system based on parallel computing framework
Suzuki et al. Real-time GPU resource management with loadable kernel modules
US9619277B2 (en) Computer with plurality of processors sharing process queue, and process dispatch processing method
JP4017005B2 (en) Arithmetic unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130108

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20131210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131217

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140217

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140408

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140421

R150 Certificate of patent or registration of utility model

Ref document number: 5540799

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees