JP2011198063A - Method, program and device for controlling data input/output - Google Patents
Method, program and device for controlling data input/output Download PDFInfo
- 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
Links
Images
Abstract
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.
上述のシステムが提供するシステムコールやシステムライブラリなどを利用したデータ入出力において,多重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.
以下,本実施の形態について,図を用いて説明する。 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
多重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
例えば,図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
このように,多重I/Oでは,アプリケーション500は,I/O実行可能状態の通知待ちの間にブロックされ,他の処理が一切行えない。そのため,通知の待ち時間が無駄になり,データ入出力の性能向上が望めない。
As described above, in the multiplexed I / O, the
図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
非同期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
図3において,アプリケーション500は,システムライブラリ700のAIO関数を呼び出す(S910)。システムライブラリ700では,AIO関数によって,カーネル600に対するデータ入出力のシステムコールが発行される(S911)。なお,このときアプリケーション500では,AIO関数の呼び出しによって処理がブロックされないため,カーネル600でのデータ入出力処理と並行に,他の処理が実行可能となる。
In FIG. 3, the
カーネル600でのデータ入出力処理が完了すると,カーネル600からシステムライブラリ700にI/O完了通知が送られ(S912),システムライブラリ700からアプリケーション500に処理が返される(S913)。
When the data input / output processing in the
このように,非同期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
例えば,図4において,アプリケーション500は,バッファリング処理により,ファイルに出力するデータを,メモリ領域からバッファに転送する(S920)。
For example, in FIG. 4, the
ファイルに出力するデータがバッファにまとめられたところで,アプリケーション500は,システムライブラリ700のAIO関数を呼び出す(S921)。システムライブラリ700では,AIO関数によって,カーネル600に対するデータ入出力のシステムコールが発行される(S922)。カーネル600の処理によって,バッファのデータがファイルに出力される。
When the data to be output to the file is collected in the buffer, the
カーネル600でのデータ出力処理が完了すると,カーネル600からシステムライブラリ700にI/O完了通知が送られ(S923),システムライブラリ700からアプリケーション500に処理が返される(S924)。
When the data output process in the
このようなバッファリング処理によって,システムコールの発行回数を減らすことにより,システムコールの待ち行列を減らすことができる。ただし,非同期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
図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
図5において,ユーザ領域10は,ユーザがアプリケーション11の稼動に利用できる領域である。また,図5に示すユーザ領域10では,プログラミング言語で書かれたアプリケーション11のソースプログラムから,実行形式のプログラムを作成するソフトウェアのパッケージであるコンパイラ/ライブラリ12が稼動する。本実施の形態では,コンパイラ/ライブラリ12は,Fortranでプログラミングされたソースプログラムから実行形式のプログラムを作成するコンパイラのパッケージであるものとする。ユーザ領域10のプログラムは,システム領域20のOS21等を介することにより,ハードウェア30を利用して実行される。
In FIG. 5, a
図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
図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
実行時ライブラリ124は,ユーザ領域10で実行されるアプリケーション11で汎用的に用いられるプログラムの集合である。図7に示す本実施の形態の実行時ライブラリ124には,OS21が提供するシステムライブラリ22や,コンパイラ/ライブラリ12にパッケージされた言語提供ライブラリ,ユーザが過去に作成したプログラムで汎用的に使用するために保持されたアプリケーションライブラリ等が含まれる。
The
なお,本実施の形態のデータ入出力制御機能を提供するプログラムは,実行時ライブラリ124に含まれる。例えば,本実施の形態のデータ入出力制御機能を提供するプログラムは,コンパイラ/ライブラリ12にパッケージされた言語提供ライブラリにより提供される。
The program that provides the data input / output control function of this embodiment is included in the
ソースプログラム111は,アプリケーション11のソースコードである。本実施の形態では,ソースプログラム111は,Fortranでプログラミングされており,Fortranの非同期入出力文を含んでいるものとする。なお,Fortranは,科学技術計算向きに開発された手続き型のプログラミング言語である。
The
本実施の形態では,ソースプログラム111のコンパイルが実行されると,コンパイラ121は,ソースプログラム111を,中間的にアセンブラソース112に変換する。アセンブラ122は,アセンブラソース112をアセンブルし,オブジェクトコード113を生成する。リンカ123は,アプリケーション11のオブジェクトコード113に対して,実行時ライブラリ124に含まれる必要な関数等のプログラムをリンクし,アプリケーション11の実行形式プログラム114を生成する。
In the present embodiment, when the
なお,本実施の形態では,リンクとして,動的リンクが用いられているものとする。すなわち,本実施の形態では,リンカ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
図8は,非同期入出力文を含むソースプログラムの例を示す図である。 FIG. 8 is a diagram illustrating an example of a source program including asynchronous input / output statements.
図8に示すソースプログラム111は,Fortranで記述されており,データの非同期入出力を指定する非同期入出力文を含んでいる。
The
図8に示すソースプログラム111において,“PROGRAM MAIN”の次の2行は,変数の宣言が記述された部分である。その次の4行は,変数の初期化が記述された部分である。さらに次のOPEN文からCLOSE文までの5行が,データ入出力が記述された部分である。
In the
図8に示すソースプログラム111のデータ入出力の部分において,OPEN文,WRITE文,READ文に記述された“ASYNCHRONOUS='YES'”が,データの非同期入出力を指定する記述である。すなわち,図8に示すソースプログラム111において,“ASYNCHRONOUS='YES'”を含む入出力文が,非同期入出力文となる。
In the data input / output portion of the
図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
実行時ライブラリ124では,アプリケーション11の実行形式プログラム114から呼び出される関数等のプログラムによって,スレッド生成部125,使用データ入出力決定部126,スレッド利用入出力処理部127,システム利用入出力処理部128が実現される。本実施の形態によるデータ入出力制御機能を提供するこれらの各機能部は,コンピュータ1が備えるCPU31,メモリ32,ディスク33等のハードウェア30と,ソフトウェアプログラムとによって実現される。
In the
実行コマンドによって,アプリケーション11の実行形式プログラム114が起動されると,実行開始処理が行われる。実行形式プログラム114の実行開始処理において,実行時ライブラリ124のスレッド生成部125は,アプリケーション11の実行で利用する,所定数のスレッドを生成する。
When the
ユーザは,ソースプログラム111のコンパイル時に,アプリケーション11をマルチスレッドで実行するか,シングルスレッドで実行するかを指定する。スレッド生成部125は,コンパイル時にマルチスレッドが指定されている場合に,複数スレッドの生成を行う。スレッド生成部125により生成するスレッドの数は,CPU31やメモリ32の性能等を鑑みて妥当とされる数があらかじめ設定されている。本実施の形態では,アプリケーション11の実行形式プログラム114の実行開始処理において,スレッド生成部125によって生成するスレッドの数は,アプリケーション11のメインスレッドを含めて8個に設定されているものとする。なお,例えば実行形式プログラム114の実行時などにユーザが生成するスレッド数を指定できるようにしてもよい。
When compiling the
スレッド生成部125は,アプリケーション11の実行で利用するスレッドの管理情報を生成し,スレッド管理情報記憶部131に記憶する。スレッド管理情報記憶部131は,アプリケーション11の実行で利用するスレッドの管理情報を記憶する,コンピュータ1がアクセス可能な記憶装置である。スレッド管理情報記憶部131には,実行されたアプリケーション11のプロセスID,アプリケーション11の実行に利用するために生成されたスレッドの数,各スレッドの状態などの情報が記憶されている。
The
アプリケーション11の実行において並列処理が必要な場合には,原則として,スレッド生成部125により生成されたスレッドを利用して処理を実行する。このとき,並列処理を行うプログラムは,スレッド管理情報記憶部131に記憶されたスレッドの管理情報を参照し,未使用のスレッドを選択して並列処理を行う。このとき利用するスレッドについては,スレッド管理情報記憶部131に記憶されたスレッドの管理情報において,使用状態に設定する。例えば,図8に示すソースプログラム111において4行目〜6行目のDOループ文に対応する処理で,既生成スレッドを利用した並列処理が行われる。
When parallel processing is required in the execution of the
アプリケーション11の実行形式プログラム114による非同期データ入出力開始処理において,実行時ライブラリ124の使用データ入出力決定部126は,使用するデータ入出力ロジックを決定する。本実施の形態では,データ入出力ロジックとして,スレッド利用入出力処理部127による既生成スレッドを利用するロジックと,システム利用入出力処理部128によるシステムコールまたはシステムライブラリの非同期I/Oを利用するロジックとが,実行時ライブラリ124で提供されている。非同期データ入出力開始処理は,例えば図8に示すソースプログラム111のOPEN文に応じた処理である。
In the asynchronous data input / output start processing by the
アプリケーション11の実行形式プログラム114による非同期データ入出力実行処理において,実行時ライブラリ124のスレッド利用入出力処理部127またはシステム利用入出力処理部128は,データ入出力処理を実行する。
In asynchronous data input / output execution processing by the
スレッド利用入出力処理部127は,スレッド生成部125によりすでに生成されているスレッドに空きがある場合に,その空き状態のスレッドを利用するデータ入出力処理を実行する。
When the thread already generated by the
システム利用入出力処理部128は,システムコールまたはシステムライブラリによって提供される非同期I/Oを利用するデータ入出力処理を実行する。
The system use input /
バッファ管理情報記憶部132は,ユーザ領域10に用意されたバッファの管理情報を記憶する,コンピュータ1がアクセス可能な記憶装置である。スレッド利用入出力処理部127またはシステム利用入出力処理部128によるデータ入出力処理において,ユーザ領域10に用意されたバッファを使用する場合がある。このとき,スレッド利用入出力処理部127やシステム利用入出力処理部128は,バッファ管理情報記憶部132に記憶されたバッファの管理情報を参照しながら,ユーザ領域10のバッファを使用する。
The buffer management
図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
スレッド管理テーブル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
バッファ管理テーブル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 /
使用データ入出力決定部126は,上述したように,既生成スレッドを利用するデータ入出力のロジックと,システムコールまたはシステムライブラリ22の非同期I/Oを利用するデータ入出力のロジックとから,使用するデータ入出力ロジックを決定する。以下,図12のフローチャートを用いて,使用データ入出力決定部126による使用データ入出力決定処理の一例を説明する。
As described above, the use data input /
使用データ入出力決定部126は,スレッド管理情報記憶部131に記憶された,スレッド管理テーブル135等のスレッドの管理情報を参照する(ステップS10)。使用データ入出力決定部126は,処理の並列実行が可能であるかを判定する(ステップS11)。ここでは,使用データ入出力決定部126は,例えば,複数スレッドが生成されているかなどを判定する。また,使用データ入出力決定部126は,空き状態のスレッドがあるかを判定する(ステップS12)。ここでは,使用データ入出力決定部126は,例えば,図10に示すスレッド管理テーブル135において,スレッド状態が“未使用”であるスレッドがあるかを判定する。
The usage data input /
並列実行が可能であり(ステップ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 /
並列実行が不可能である(ステップ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 /
本実施の形態では,既生成スレッドに空き状態のスレッドがあれば,優先的に,スレッド利用入出力処理部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 /
上述したように,システムライブラリ22やシステムコールの非同期I/Oを利用するデータ入出力処理では,同時に待ち行列に入れる非同期I/Oの操作数や非同期I/O転送中にロック可能な最大メモリ容量制限が,システム全体で適用される値に依存する。そのため,他のアプリケーションの動作によっては,待ち行列やロック可能な最大メモリ容量が制限を超えて待ち状態となり,データ入出力の性能劣化が余儀なくされる可能性がある。
As described above, in the data input / output processing using the
これに対して,アプリケーション11の処理実行用に生成されたスレッドを利用したデータ入出力処理では,ロック可能な最大メモリ容量などをアプリケーション11側で管理できる。そのため,ロック可能な最大メモリ容量が制限を超えて待ち状態となってしまうことを回避でき,また処理性能が他のアプリケーションの動作に左右されることが少ない。このように,既生成スレッドに空き状態のスレッドがある場合に,そのスレッドを利用してデータ入出力を優先することで,データ入出力の性能向上を図れる。
On the other hand, in the data input / output processing using the thread generated for executing the processing of the
図13,図14を用いて,使用データ入出力決定部126によりスレッド利用データ入出力処理が決定された場合の,スレッド利用入出力処理部127による既生成スレッドを利用するデータ入出力処理の例を説明する。
13 and 14, an example of data input / output processing using an already generated thread by the thread use input /
図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
ユニットAに対する非同期入出力処理が実行されるときに,スレッド利用入出力処理部127は,メインスレッド115ではなく,空きスレッドであるサブスレッドA116を利用して,データ入出力を行う。
When the asynchronous input / output processing for the unit A is executed, the thread use input /
アプリケーション11のサブスレッドA116は,システムライブラリ22のデータ入出力処理を行う関数を呼び出す(S100)。ここでは,システムライブラリ22に含まれる同期入出力処理の関数が呼び出される。呼び出された同期入出力処理の関数によって,ユニットAに対するデータ入出力のシステムコールが発行される(S101)。
The sub thread A116 of the
ユニットAに対するデータ入出力処理は,サブスレッドA116によって実行されるので,アプリケーション11のメインスレッド115は,サブスレッドA116によるデータ入出力処理とは並列に,他の処理が実行できる。なお,図13に示す例ではサブスレッドA116でデータ入出力処理を行っているが,メインスレッド115でデータ入出力処理を行い,サブスレッドA116で他の処理を実行するようにしてもよい。
Since the data input / output process for the unit A is executed by the
同様に,ユニット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
サブスレッドA116,サブスレッドB117,サブスレッドC118によってデータ入出力処理を行っている間に,アプリケーションのメインスレッド115は,それらのデータ入出力処理とは並列に,他の処理が実行できる。
While the data input / output processing is being performed by the
また,データ入出力処理に,ユーザ領域10に用意されたバッファを使用してもよい。例えば,サブスレッドA116は,出力データが記憶されたアプリケーション11のメモリ領域からバッファに転送する。サブスレッドA116は,システムライブラリ22のデータ出力処理の関数を呼び出して,バッファからファイルAへのデータ出力処理を行う。サブスレッドA116は,メモリ領域上のすべての該当データを出力するまで,これらの処理を繰り返す。なお,バッファを複数個用意して,それらの複数のバッファを交互に使用しながら,バッファへのデータ転送とシステムライブラリ22の関数の呼び出しとを実行するようにしてもよい。
A buffer prepared in the
図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 /
実行する処理がデータ入力処理であれば(ステップ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
実行する処理がデータ出力処理であれば(ステップ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
本実施の形態では,スレッドを利用したデータ入出力処理の開始時に,スレッドの生成を行わない。データ入出力処理に利用するスレッドは,アプリケーション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
図15〜図17を用いて,使用データ入出力決定部126によりシステム利用データ入出力処理が決定された場合の,システム利用入出力処理部128によるシステムコールまたはシステムライブラリ22の非同期I/Oを利用するデータ入出力の例を説明する。
A system call or asynchronous I / O of the
本実施の形態のシステム利用入出力処理部128によるシステム利用データ入出力処理では,OS21等のシステム側から提供されるシステムコールやシステムライブラリ22がサポートする非同期I/Oを利用したデータ入出力が行われる。
In the system utilization data input / output processing by the system utilization input /
ただし,本実施の形態のシステム利用入出力処理部128は,データの入力と出力とで,ユーザ領域10のバッファの使用と不使用とを使い分ける。すなわち,システムが提供する非同期I/Oを利用したデータ入力処理では複数のバッファを使用し,システムが提供する非同期I/Oを利用したデータ出力処理ではバッファを使用しない。
However, the system utilization input /
システムコールやシステムライブラリ22の非同期I/Oを利用したデータ入出力処理において,データ入力とデータ出力とで,ユーザ領域10のバッファの使用と不使用とを切り替えることで,より高速なデータ入出力が可能となる。
In data input / output processing using asynchronous I / O of system calls and
図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
バッファ#0を指定した非同期入力が実行されると,アプリケーション11は,システムライブラリ22のデータ入力処理を行うAIO関数を呼び出す(S110)。呼び出されたデータ入力処理を行うAIO関数によって,データ入力のシステムコールが発行される(S111)。なお,非同期I/Oなので,アプリケーション11は,バッファ#0へのデータ入力の完了を待たずに,別の処理を実行できる。
When asynchronous input specifying
同様に,バッファ#1〜バッファ#M−1を指定した非同期入力が順に実行されると,アプリケーション11からシステムライブラリ22のデータ入力処理を行うAIO関数の呼び出し(S112,... S114),AIO関数からデータ入力のシステムコールの発行(S113,... ,S115)が行われる。
Similarly, when asynchronous input designating
バッファ#0へのデータ入力が完了すると,カーネル211は,システムライブラリ22のAIO関数にバッファ#0についてのI/O完了通知を返す(S116)。システムライブラリ22のAIO関数は,アプリケーション11に処理を返す(S117)。
When the data input to the
バッファ#0へのデータ入力完了を受けたアプリケーション11は,他のバッファへのデータ入力処理と並行に,バッファ#0からアプリケーション11のメモリ領域へのデータ転送の処理を実行する。なお,他のバッファにも収まらない入力データがまだある場合には,バッファ#0からメモリ領域へのデータ転送完了後,バッファ#0を指定した次のデータの非同期入力が実行される。
Upon receiving the completion of data input to the
同様に,バッファ#1へのデータ入力が完了すると,カーネル211は,システムライブラリ22のAIO関数にバッファ#1についてのI/O完了通知を返し(S118),AIO関数はアプリケーション11に処理を返す(S119)。バッファ#1へのデータ入力完了を受けたアプリケーション11は,他のバッファへのデータ入力処理と並行に,バッファ#1からアプリケーション11のメモリ領域へのデータ転送の処理を実行する。以下,バッファ#2以降も,同様の処理が行われる。
Similarly, when data input to the
このように,本実施の形態のシステムライブラリ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
図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
入力変数Xについての非同期出力が実行されると,アプリケーション11は,システムライブラリ22のデータ出力処理を行うAIO関数を呼び出す(S120)。このとき,データ出力処理を行うAIO関数には,出力対象となるデータが記憶されているメモリ領域のアドレスや出力対象となるデータの長さ等の情報が渡される。呼び出されたデータ出力処理を行うAIO関数によって,データ出力のシステムコールが発行される(S121)。なお,非同期I/Oなので,アプリケーション11は,入力変数Xについてのデータ出力の完了を待たずに,別の処理を実行できる。
When asynchronous output for the input variable X is executed, the
同様に,入力変数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
入力変数Xについてのデータ出力が完了すると,カーネル211は,システムライブラリ22のAIO関数に入力変数XについてのI/O完了通知を返す(S126)。システムライブラリ22のAIO関数は,アプリケーション11に処理を返す(S127)。
When the data output for the input variable X is completed, the
同様に,入力変数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
このように,本実施の形態のシステムライブラリ22の非同期I/Oを利用したデータ出力では,バッファを使用せずに,アプリケーション11のメモリ領域上にあるデータをそのまま出力する。非同期I/Oを利用したデータ出力では,バッファにデータをコピーすると,コピーしたデータをシステムコールに渡す間に,待ち状態が発生する。バッファを使用せずに,アプリケーション11のメモリ領域から直接にシステムライブラリ22にデータを渡すことにより,アプリケーション11の処理待ちの状態を減らすことができる。
As described above, in the data output using the asynchronous I / O of the
図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 /
システム利用入出力処理部128は,システムコールまたはシステムライブラリ22により,ディスク33からユーザ領域10の該当バッファへのデータ読み出しを行う(ステップS31)。システム利用入出力処理部128は,バッファ管理情報記憶部132に記憶されたバッファ管理テーブル136において,該当バッファのバッファ使用状況をONに設定する(ステップS32)。システム利用入出力処理部128は,バッファ上にあるデータを,アプリケーション11のメモリ領域に転送する(ステップS33)。システム利用入出力処理部128は,I/O完了通知受領後,バッファ管理情報記憶部132に記憶されたバッファ管理テーブル136において,該当バッファのバッファ使用状況をOFFに設定する(ステップS34)。
The system use input /
システム利用入出力処理部128は,ステップS31〜S34のバッファごとの処理を,全入力変数について終了するまで繰り返す(ステップS35)。
The system use input /
実行する処理がデータ出力処理であれば(ステップ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 /
以上説明した,本実施の形態の非同期入出力文に対応するデータ入出力制御の技術によって,データ入出力処理開始時に適切な実行モデルを判断して,高速にデータ入出力を実行することが可能となる。 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
以上,本実施の形態について説明したが,本発明はその主旨の範囲において種々の変形が可能であることは当然である。 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
32
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.
ことを特徴とするデータ入出力制御方法。 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.
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)
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)
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 |
-
2010
- 2010-03-19 JP JP2010064417A patent/JP5540799B2/en not_active Expired - Fee Related
Patent Citations (2)
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)
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 |