KR101134464B1 - Method and apparatus for providing network asynchronous input/output processing - Google Patents
Method and apparatus for providing network asynchronous input/output processing Download PDFInfo
- Publication number
- KR101134464B1 KR101134464B1 KR1020090043470A KR20090043470A KR101134464B1 KR 101134464 B1 KR101134464 B1 KR 101134464B1 KR 1020090043470 A KR1020090043470 A KR 1020090043470A KR 20090043470 A KR20090043470 A KR 20090043470A KR 101134464 B1 KR101134464 B1 KR 101134464B1
- Authority
- KR
- South Korea
- Prior art keywords
- asynchronous
- input
- output
- event
- request
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/545—Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/542—Event management; Broadcasting; Multicasting; Notifications
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Stored Programmes (AREA)
Abstract
본 발명은 사용자 수준에서의 네트워크 비동기 입출력 처리 방법을 제시한다. 특히, 커널 수준에서 제공하는 이벤트 통지 서브 시스템을 활용하여 사용자 수준에서 비동기 송신 기능 및 수신 기능을 수행하는 비동기 입출력 처리 방법을 제공하는 것이다. 본 발명의 실시예에 의하면, 사용자 수준에서의 네트워크 비동기 입출력 처리를 통해 운영체제의 안정성을 해치지 않고 효율적인 네트워크 통신을 수행할 수 있다.The present invention proposes a method for processing network asynchronous I / O at the user level. In particular, it provides an asynchronous I / O processing method that performs asynchronous send and receive functions at the user level by utilizing the event notification subsystem provided at the kernel level. According to the embodiment of the present invention, the network asynchronous I / O processing at the user level enables efficient network communication without compromising the stability of the operating system.
비동기 입출력 송신, 비동기 입출력 수신 Asynchronous I / O Send, Asynchronous I / O Receive
Description
본 발명은 네트워크 비동기(asynchronous) 입출력 처리 기술에 관한 것으로, 특히 커널 수준(kernel level)에서 제공하는 이벤트 통지 서브 시스템을 활용하여 사용자 수준(user level)에서 비동기 송신 및 수신 기능을 수행하는데 적합한 네트워크 비동기 입출력 방법 및 장치에 관한 것이다.The present invention relates to a network asynchronous input and output processing technology, in particular network asynchronous suitable for performing asynchronous transmission and reception at the user level by utilizing the event notification subsystem provided at the kernel level (kernel level) An input / output method and apparatus are provided.
본 발명은 지식경제부 및 정보통신연구진흥원의 IT원천기술개발사업의 일환으로 수행한 연구로부터 도출된 것이다[2008-F-026-01, 공개 SW 플랫폼 고도화를 위한 리눅스 커널 기술개발].The present invention is derived from a study conducted as part of the IT source technology development project of the Ministry of Knowledge Economy and the Ministry of Information and Communication Research and Development.
컴퓨터 시스템에서의 입출력 방식은, 사용자 프로세스에서 데이터 입출력 작업 시 입출력 작업을 즉시 완료할 수 없을 때 사용자 프로세스의 진행을 처리하는 방식에 따라 동기(synchronous) 입출력 방식과 비동기(asynchronous) 입출력 방식으로 구분될 수 있다.The input / output method in a computer system can be divided into synchronous and asynchronous input / output methods according to a method of processing a user process when an input / output operation cannot be completed immediately. Can be.
동기 입출력 방식은 사용자 프로세스에서 데이터 입출력 수행 시에 입출력 작업을 즉시 완료할 수 없을 때, 해당 프로세스를 대기시키고 입출력 작업이 완료될 때까지 대기하는 방식이다. 즉, 해당 프로세스는 입출력 작업이 완료될 때까지 남은 다른 작업을 수행하지 않고 대기한다.The synchronous I / O method waits for the process and waits until the I / O operation is completed when the I / O operation cannot be completed immediately when performing data I / O in the user process. That is, the process waits without performing any remaining work until the I / O operation is completed.
반면, 비동기 입출력 방식의 경우에는, 입출력 작업을 완료할 수 없더라도 해당 프로세스의 남은 작업을 수행하도록 하고, 입출력 작업이 완료되었을 때 그 결과를 해당 프로세스에게 알려주는 방식이다.On the other hand, in the asynchronous I / O method, even if the I / O operation cannot be completed, the remaining work of the corresponding process is performed, and the result is notified to the corresponding process when the I / O operation is completed.
여러 운영체제에서 동시에 실행되는 수많은 입출력 작업을 효과적으로 처리하기 위해서 비동기 입출력 방식이 주로 채택되고 있는데, 특히 인터넷이 확산되면서 네트워크 환경에서의 비동기 입출력 방식이 더욱 각광을 받고 있다. 네트워크 비동기 입출력 방식을 사용하면 프로그램이 입출력 작업이 완료될 때까지 대기하지 않아도 되기 때문에 시스템 성능을 크게 개선할 수 있다.Asynchronous I / O is mainly adopted to effectively handle a large number of I / O operations executed simultaneously in various operating systems. Especially, as the Internet spreads, asynchronous I / O is gaining more attention in the network environment. Network asynchronous I / O can significantly improve system performance because the program does not have to wait for I / O to complete.
그러나 현재 리눅스 운영체제에서는 네트워크 비동기 입출력 방식이 제대로 지원되지 못하고 있는 실정이다. 예컨대, 리눅스 상에서 네트워크 비동기 입출력을 지원하는 기술로는 사용자 수준에서 수행하도록 고안된 POSIX(Portable Operating System Interface) API(Application Program Interface) 방식과 커널 수준에서 수행하도록 고안된 몇 가지 방식이 있는데, POSIX API 방식은 비동기 입출력 요청이 있을 때마다 쓰레드(thread)를 생성해서 처리하기 때문에 고성능 네트워크 입출력을 필요로 하는 환경에 적합하지 않고, 커널 수준에서 수행하도록 고안된 기술들은 운영체제의 안정성에 대한 검증이 어렵다는 단점이 있다.However, the current network asynchronous I / O method is not properly supported in the Linux operating system. For example, there are two technologies for supporting network asynchronous I / O on Linux: the Portable Operating System Interface (POSIX) application program interface (API) method designed to be performed at the user level, and several methods designed to be executed at the kernel level. Since a thread is created and processed whenever there is an asynchronous I / O request, it is not suitable for an environment requiring high-performance network I / O, and technologies designed to execute at the kernel level have difficulty in verifying the stability of the operating system.
종래의 네트워크 비동기 입출력 기술은, 리눅스 운영체제에서의 안정성에 대 한 검증이 어렵기 때문에 리눅스 운영체제에 반영되지 않고 있으므로 사용자들이 네트워크 비동기 입출력 방식으로 서버 응용프로그램을 개발할 때 GNU(Gnu is Not Unix) C 라이브러리에서 제공하는 POSIX API를 이용하여 개발해야 하는데, GNU C 라이브러리에서 제공하는 POSIX API는 성능 문제로 인해 거의 사용되지 않고 있는 실정이다.The conventional network asynchronous I / O technology is not reflected in the Linux operating system because it is difficult to verify the stability of the Linux operating system. Therefore, when users develop server applications using the network asynchronous I / O method, the GNU (Gnu is Not Unix) C library is used. It should be developed using POSIX API provided by. The POSIX API provided by the GNU C library is rarely used due to performance problems.
이에 본 발명에서는, 사용자 수준에서의 네트워크 비동기 입출력 방법을 제공하여 리눅스 운영체제의 안정성을 해치지 않으면서 서버 응용프로그램의 성능을 향상시킬 수 있는 네트워크 비동기 입출력 기술을 제안하고자 한다.Accordingly, the present invention provides a network asynchronous I / O technology that can improve the performance of a server application program without impairing the stability of the Linux operating system by providing a network asynchronous I / O method at the user level.
본 발명의 과제를 해결하기 위한 일 실시예에 따르면, 네트워크 비동기 입출력 라이브러리 계층을 생성하는 과정과, 상기 네트워크 비동기 입출력 라이브러리 계층으로 사용자 쓰레드로부터의 비동기 입출력이 요청되면, 상기 네트워크 비동기 입출력 라이브러리 계층의 입력 요청 구조체 및 출력 요청 구조체를 각각 할당하여 입력 요청 큐 구조체 및 출력 요청 큐 구조체에 각각 등록하는 과정과, 커널 수준의 커널 이벤트 통지 서브 시스템 계층으로부터 특정 파일에 대한 입출력 가능 이벤트가 발생되면, 상기 입력 요청 큐 구조체 및 출력 요청 큐 구조체에서 특정 파 일에 대한 입출력 요청이 있는지를 검색하는 과정과, 상기 입출력 요청이 있으면 읽기 또는 쓰기 요청에 대한 입출력 작업을 수행한 후 작업 수행 완료 결과를 입출력 완료 큐 구조체에 등록하는 과정을 포함하는 네트워크 비동기 입출력 방법을 제공할 수 있다.According to an embodiment of the present invention, a process of generating a network asynchronous I / O library layer, and when asynchronous I / O from a user thread is requested to the network asynchronous I / O library layer, input of the network asynchronous I / O library layer Allocating a request structure and an output request structure, respectively, and registering the request structure and the output request structure in the input request queue structure and the output request queue structure, and when an input / output enabled event for a specific file is generated from the kernel-level kernel event notification subsystem layer. Searching whether there is an I / O request for a specific file in the queue structure and the output request queue structure, and if the I / O request exists, perform an I / O operation for a read or a write request and then display the completion result of the operation. Can provide asynchronous IO network comprises the process of registration.
본 발명의 과제를 해결하기 위한 다른 실시예에 따르면, 사용자의 네트워크 비동기 입출력 요청에 대해 비동기 입출력 읽기 함수/비동기 입출력 쓰기 함수를 호출하며, 사용자 수준의 네트워크 비동기 입출력 기능을 위한 사용자 응용 프로그램을 수행하는 사용자 응용 프로그램 수행부와, 상기 사용자 응용 프로그램 수행부에서 사용자 수준의 네트워크 비동기 입출력 기능을 사용할 수 있게 하며, 상기 사용자 응용 프로그램 수행부의 비동기 입출력 읽기/쓰기 함수에 따라 다수의 입출력 요청 구조체 및 입출력 완료 구조체를 관리하는 네트워크 비동기 입출력 라이브러리 처리부와, 커널 수준에서 사용자 수준의 네트워크 비동기 입출력 기능을 구현 및 동작시키며, 임의의 이벤트를 발생시켜 상기 네트워크 비동기 입출력 라이브러리 처리부로 제공하는 커널 수준 이벤트 처리부를 포함하는 네트워크 비동기 입출력 장치를 제공할 수 있다.According to another exemplary embodiment of the present invention, an asynchronous I / O read function / asynchronous I / O write function is called for a network asynchronous I / O request of a user, and a user application program for a user level network asynchronous I / O function is executed. A user application execution unit and the user application execution unit may use a user-level network asynchronous I / O function, and a plurality of I / O request structures and I / O completion structures according to the asynchronous I / O read / write function of the user application execution unit. Network asynchronous I / O library processing unit that manages and implements and operates a user level network asynchronous I / O function at kernel level, and generates arbitrary events and provides them to the network asynchronous I / O library processing unit. It may provide an asynchronous network input-output device including a kernel-level event processing.
본 발명의 실시예에 의하면, 사용자 수준에서의 네트워크 비동기 입출력 기능을 제공함으로써, 서버 응용프로그램 개발 시 리눅스 운영체제의 안정성을 해치지 않으면서 보다 우수한 성능의 네트워크 비동기 입출력 기능을 활용할 수 있다.According to the embodiment of the present invention, by providing the network asynchronous I / O function at the user level, it is possible to utilize the network asynchronous I / O function of higher performance without compromising the stability of the Linux operating system when developing server applications.
본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 도면부호는 동일 구성 요소를 지칭한다.Advantages and features of the present invention and methods for achieving them will be apparent with reference to the embodiments described below in detail with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below, but can be implemented in various different forms, and only the embodiments make the disclosure of the present invention complete, and the general knowledge in the art to which the present invention belongs. It is provided to fully inform the person having the scope of the invention, which is defined only by the scope of the claims. Like numbers refer to like elements throughout.
본 발명의 실시예들을 설명함에 있어서 공지 기능 또는 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략할 것이다. 그리고 후술되는 용어들은 본 발명의 실시예에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례 등에 따라 달라질 수 있다. 그러므로 그 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다. In describing the embodiments of the present invention, if it is determined that a detailed description of a known function or configuration may unnecessarily obscure the gist of the present invention, the detailed description thereof will be omitted. In addition, terms to be described below are terms defined in consideration of functions in the embodiments of the present invention, which may vary according to intentions or customs of users and operators. Therefore, the definition should be based on the contents throughout this specification.
첨부된 블록도의 각 블록과 흐름도의 각 단계의 조합들은 컴퓨터 프로그램 인스트럭션들에 의해 수행될 수도 있다. 이들 컴퓨터 프로그램 인스트럭션들은 범용 컴퓨터, 특수용 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서에 탑재될 수 있으므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비의 프로세서를 통해 수행되는 그 인스트럭션들이 블록도의 각 블록 또는 흐름도의 각 단계에서 설명된 기능들을 수행하는 수단을 생성하게 된다. 이들 컴퓨터 프로그램 인스트럭션들은 특정 방식으로 기능을 구현하기 위해 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 지향할 수 있는 컴퓨터 이용 가능 또는 컴퓨터 판독 가능 메모리에 저장되는 것도 가능하므로, 그 컴퓨터 이용가능 또는 컴퓨터 판독 가능 메모리에 저장된 인스트럭션들은 블록도의 각 블록 또는 흐름도 각 단계에서 설명된 기능을 수행하는 인스트럭션 수단을 내포하는 제조 품목을 생산하는 것도 가능하다. 컴퓨터 프로그램 인스트럭션들은 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에 탑재되는 것도 가능하므로, 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비 상에서 일련의 동작 단계들이 수행되어 컴퓨터로 실행되는 프로세스를 생성해서 컴퓨터 또는 기타 프로그램 가능한 데이터 프로세싱 장비를 수행하는 인스트럭션들은 블록도의 각 블록 및 흐름도의 각 단계에서 설명된 기능들을 실행하기 위한 단계들을 제공하는 것도 가능하다. Each block of the accompanying block diagrams and combinations of steps of the flowchart may be performed by computer program instructions. These computer program instructions may be mounted on a processor of a general purpose computer, special purpose computer, or other programmable data processing equipment such that instructions executed through the processor of the computer or other programmable data processing equipment may not be included in each block or flowchart of the block diagram. It will create means for performing the functions described in each step. These computer program instructions may be stored in a computer usable or computer readable memory that can be directed to a computer or other programmable data processing equipment to implement functionality in a particular manner, and thus the computer usable or computer readable memory. It is also possible for the instructions stored in to produce an article of manufacture containing instruction means for performing the functions described in each block or flowchart of each step of the block diagram. Computer program instructions may also be mounted on a computer or other programmable data processing equipment, such that a series of operating steps may be performed on the computer or other programmable data processing equipment to create a computer-implemented process to create a computer or other programmable data. Instructions that perform processing equipment may also provide steps for performing the functions described in each block of the block diagram and in each step of the flowchart.
또한, 각 블록 또는 각 단계는 특정된 논리적 기능(들)을 실행하기 위한 하나 이상의 실행 가능한 인스트럭션들을 포함하는 모듈, 세그먼트 또는 코드의 일부를 나타낼 수 있다. 또, 몇 가지 대체 실시예들에서는 블록들 또는 단계들에서 언급된 기능들이 순서를 벗어나서 발생하는 것도 가능함을 주목해야 한다. 예컨대, 잇달아 도시되어 있는 두 개의 블록들 또는 단계들은 사실 실질적으로 동시에 수행되는 것도 가능하고 또는 그 블록들 또는 단계들이 때때로 해당하는 기능에 따라 역순으로 수행되는 것도 가능하다.In addition, each block or step may represent a portion of a module, segment or code that includes one or more executable instructions for executing a specified logical function (s). It should also be noted that in some alternative embodiments, the functions noted in the blocks or steps may occur out of order. For example, the two blocks or steps shown in succession may in fact be executed substantially concurrently or the blocks or steps may sometimes be performed in the reverse order, depending on the functionality involved.
도 1은 본 실시예에 따른 사용자 수준(user level)에서의 네트워크 비동기 입출력 방법을 수행하기 위한 시스템 운영체제의 계층 구조를 예시한 도면이다.1 is a diagram illustrating a hierarchical structure of a system operating system for performing a network asynchronous input and output method at a user level according to the present embodiment.
도 1에 예시한 바와 같이, 본 실시예에 따른 네트워크 비동기 입출력 방법을 수행하기 위한 시스템 운영체제의 계층 구조는, 사용자 수준에서의 네트워크 비동기 입출력 라이브러리 계층(10) 및 사용자 응용 프로그램(12)과, 커널 수준(kernel level)에서의 커널 이벤트 통지 서브 시스템 계층(14)을 포함할 수 있다.As illustrated in FIG. 1, the hierarchical structure of the system operating system for performing the network asynchronous I / O method according to the present embodiment includes a network asynchronous I /
본 실시예에 따른 네트워크 비동기 입출력 라이브러리 계층(10)을 통해 사용자 수준의 네트워크 비동기 입출력 기능이 사용자 응용 프로그램(12)에 제공되고, 이러한 사용자 수준의 네트워크 비동기 입출력 기능은 커널 수준(kernel level)의 커널 이벤트 통지 서브 시스템 계층(14), 예컨대 이벤트 폴(event poll) 서브 시스템 상에서 구현 및 동작될 수 있다. 즉, 프로그램 개발 시점에 해당 프로그램에서 본 실시예에 따른 비동기 입출력 기능을 사용할 수 있도록 한다.Through the network asynchronous I /
따라서, 사용자 수준에서 동작하는 본 실시예에 따른 네트워크 비동기 입출력 장치는 리눅스 운영체제의 안정성에 영향을 미치지 않는다.Therefore, the network asynchronous I / O device according to the present embodiment operating at the user level does not affect the stability of the Linux operating system.
도 2는 본 발명의 실시예에 따른 사용자 수준에서의 네트워크 비동기 입출력 방법을 수행하기 위한 시스템 운영체제의 계층 구조를 보다 상세히 예시한 도면으로서, 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)과, 사용자 수준의 사용자 쓰레드(thread)(1), 네트워크 비동기 입출력 라이브러리 계층(100)을 포함할 수 있다.FIG. 2 is a diagram illustrating in more detail a hierarchical structure of a system operating system for performing a network asynchronous input / output method at a user level according to an embodiment of the present invention. Level of user thread (1), network asynchronous I / O library layer (100).
도 2에 예시한 바와 같이, 본 실시예에 따른 네트워크 비동기 입출력 라이브러리 계층(100)은 사용자 수준에서 동작하는 네트워크 비동기 입출력 라이브러리 계층(10)의 일 형태로서, 입출력 정보 구조체(102), 다수의 입력 요청 구조체(104a ~104e)를 갖는 입력 요청 큐(queue) 구조체(104), 다수의 출력 요청 구조체(106a~106e)를 갖는 출력 요청 큐 구조체(106), 다수의 입출력 완료 구조체(108a~108e)를 갖는 입출력 완료 큐 구조체(108), 이벤트 통지 대기 쓰레드(thread)(110)를 포함할 수 있다.As illustrated in FIG. 2, the network asynchronous I /
입출력 정보 구조체(102)는 네트워크 비동기 입출력 기능을 활용하고자 하는 사용자 프로그램의 수행을 위해 필요한 각종 정보들을 관리하는 역할을 한다.The input /
입력 요청 큐 구조체(104)와 출력 요청 큐 구조체(106)는 다수의 입력 요청 구조체(104a~104e)와 다수의 출력 요청 구조체(106a~106e)를 관리하는 역할을 한다.The input
입출력 완료 큐 구조체(108)는 다수의 입출력 완료 구조체(108a~108e)를 관리하는 역할을 한다.The input / output
이벤트 통지 대기 쓰레드(110)는 커널 수준의 커널 이벤트 통지 서브 시스템계층(14), 예컨대 이벤트 폴 서브 시스템의 이벤트 폴 대기 함수(epoll_wait())를 호출하여 커널 이벤트 통지 서브 시스템 계층(14)을 통해 발생하는 이벤트를 대기하는 역할을 한다.The event
이러한 네트워크 비동기 입출력 라이브러리 계층(100)에서의 입출력 처리에 대해 살펴보면 다음과 같다.Looking at the input and output processing in the network asynchronous I /
먼저, 사용자 쓰레드(1)로부터 비동기 입출력 읽기 함수(aio_read())/비동기 입출력 쓰기 함수(aio_write()) 호출을 통한 비동기 입출력이 요청되면, 네트워크 비동기 입출력 라이브러리 계층(100)에서는 다수의 입력 요청 구조체(104a~104e) 와 다수의 출력 요청 구조체(106a~106e)를 각각 할당하여 입력 요청 큐 구조체(104)와 출력 요청 큐 구조체(106)에 각각 등록한다.First, when asynchronous I / O is requested through the asynchronous I / O read function (aio_read ()) / asynchronous I / O write function (aio_write ()) call from the user thread 1, the network asynchronous I /
이후, 이벤트 통지 대기 쓰레드(110)를 통해 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)으로부터 특정 파일에 대한 입출력 가능 이벤트가 제공되면, 네트워크 비동기 입출력 라이브러리 계층(100)에서는 입력 요청 큐 구조체(104)와 출력 요청 큐 구조체(106)에서 특정 파일에 대한 입출력 요청이 있는지를 검색하고, 입출력 요청이 있으면 해당 요청 작업을 수행한다.Thereafter, when an input / output capable event for a specific file is provided from the kernel-level kernel event notification subsystem layer 14 through the event
요청 작업에 대한 수행 결과는 다수의 입출력 완료 구조체(108a~108e)를 할당하여 입출력 완료 큐 구조체(108)에 등록된다.The result of performing the request operation is allocated to the input / output
그리고 사용자 쓰레드(1)는 비동기 입출력 완료 획득 함수(aio_get_completion())를 네트워크 비동기 입출력 라이브러리 계층(100)으로 호출하여 자신이 요청한 읽기 또는 쓰기 요청에 대한 작업 결과를 입출력 완료 큐 구조체(108)를 통해 확인할 수 있다.In addition, the user thread 1 calls the asynchronous I / O completion acquisition function (aio_get_completion ()) to the network asynchronous I /
이하, 상술한 구성과 함께, 본 발명의 실시예에 따른 네트워크 비동기 입출력 방법을 첨부한 도 3의 흐름도를 참조하여 예시적으로 설명하기로 한다.Hereinafter, with reference to the configuration described above, with reference to the flowchart of Figure 3 attached to the network asynchronous input and output method according to an embodiment of the present invention will be described by way of example.
도 3에 예시한 바와 같이, 네트워크 비동기 입출력 라이브러리 계층(100)은 커널 이벤트 통지 서브 시스템 계층(14)의 사용을 등록하고(S300), 이벤트 통지 대기 쓰레드(110)를 생성하며(S302), 입출력 정보 구조체(102), 입력 요청 큐 구조체(104), 출력 요청 큐 구조체(106) 및 입출력 완료 큐 구조체(108)를 할당하고 초기화한다(S304).As illustrated in FIG. 3, the network asynchronous I /
이러한 입출력 정보 구조체(102), 입력 요청 큐 구조체(104), 출력 요청 큐 구조체(106) 및 입출력 완료 큐 구조체(108)의 할당 및 초기화는 비동기 입출력 계층 생성 함수(aio_create())의 호출을 통해 수행될 수 있으며, 이는 곧 네트워크 비동기 입출력 라이브러리 계층이 생성되는 것을 의미한다.The allocation and initialization of the input /
이후, 사용자 쓰레드(1)로부터 비동기 입출력 읽기 함수(aio_read())/비동기 입출력 쓰기 함수(aio_write()) 호출을 통한 비동기 입출력이 요청되면, 네트워크 비동기 입출력 라이브러리 계층(100)은 다수의 입력 요청 구조체(104a~104e)와 다수의 출력 요청 구조체(106a~106e)를 각각 할당하여 입력 요청 큐 구조체(104)와 출력 요청 큐 구조체(106)에 각각 등록한다(S306). 이때, 이벤트 폴 제어 함수(epoll_ctl())의 호출을 통해 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)에 해당 파일 디스크립터(file descriptor)를 등록할 수 있다.Thereafter, when asynchronous I / O is requested from the user thread 1 through an asynchronous I / O read function (aio_read ()) / asynchronous I / O write function (aio_write ()) call, the network asynchronous I /
이후, 이벤트 통지 대기 쓰레드(110)를 통해 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)으로부터 특정 파일에 대한 입출력(예를 들어, 읽기 또는 쓰기) 가능 이벤트가 제공되면, 네트워크 비동기 입출력 라이브러리 계층(100)은 입력 요청 큐 구조체(104)와 출력 요청 큐 구조체(106)에서 특정 파일에 대한 입출력 요청(읽기 또는 쓰기 요청)이 있는지를 검색하고, 입출력 요청이 있으면 해당 요청 작업, 즉 읽기 또는 쓰기 요청에 대한 입출력 작업을 수행한다. 작업 수행이 완료되면 그 결과는 입출력 완료 큐 구조체(108)에 등록될 수 있다(S308).Thereafter, when an I / O (eg, read or write) capable event for a specific file is provided from the kernel-level kernel event notification subsystem layer 14 through the event
완료된 입출력 요청에 대한 입출력 완료 큐 확인은, 비동기 입출력 완료 획득 함수(aio_get_completion())의 호출을 통해 수행될 수 있으며(S310), 사용자는 이를 통해 자신이 요청한 읽기 또는 쓰기 요청에 대한 작업 결과를 확인할 수 있다. 이러한 과정은 사용자가 더 이상 입출력 요청을 필요로 하지 않을 때까지 반복된다(S312).Checking the I / O completion queue for the completed I / O request may be performed through a call to the asynchronous I / O completion acquisition function (aio_get_completion ()) (S310), and the user may check the operation result for the read or write request requested by the user. Can be. This process is repeated until the user no longer needs the input / output request (S312).
사용자의 입출력 요청이 존재하지 않아 네트워크 비동기 입출력 라이브러리 계층이 더 이상 필요 없게 될 경우에는, 네트워크 비동기 입출력 라이브러리 계층(100)은 비동기 입출력 계층 해제 함수(aio_destroy())의 호출을 통해 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)의 사용을 해제하고(S314), 이벤트 통지 대기 쓰레드(110)를 종료한다(S316).If the user's I / O request does not exist and the network asynchronous I / O library layer is no longer needed, the network asynchronous I /
이에 따라, 입출력 정보 구조체(102)와 입력 요청 큐 구조체(104), 출력 요청 큐 구조체(106), 입출력 완료 큐 구조체(108)를 해제할 수 있을 것이다(S318).Accordingly, the input /
도 4는 본 실시예에 따른 네트워크 비동기 입출력 처리에 있어서 입출력 요청을 빠르게 찾기 위한 입력 요청 큐 구조체 및 출력 요청 큐 구조체에 대한 구성 예시도이다.4 is an exemplary configuration diagram of an input request queue structure and an output request queue structure for quickly finding an input / output request in the network asynchronous I / O process according to the present embodiment.
도 4에 예시한 바와 같이, 입출력 요청들을 관리하기 위해 입력 요청을 관리하는 입력 요청 큐 구조체(40)와, 출력 요청을 관리하는 출력 요청 큐 구조체(42)를 포함할 수 있다.As illustrated in FIG. 4, an input
각각의 입력 요청 큐 구조체(40) 및 출력 요청 큐 구조체(42)에는 입력 요청 구조체(40a)와 출력 요청 구조체(42a)가 각각 등록되어 관리될 수 있다. 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)이 이벤트를 알려줄 때, 보다 빠르게 해당 입력과 출력 요청의 존재 여부를 파악하기 위해서 입력 요청 큐 구조체(40)와 출력 요청 큐 구조체(42)는 파일 디스크립터의 값을 기준으로 해시 테이블(hash table)로 구성되어 해시 엔트리(hash entry)가 결정될 수 있을 것이다. 동일한 해시 값을 갖는 서로 다른 파일 디스크립터가 있을 수 있고, 하나의 파일 디스크립터에 다수의 입력 또는 출력 요청이 발생할 수 있으므로, 하나의 해시 값에 대해서 다수의 입력 또는 출력 요청 구조체가 할당될 수 있을 것이다.An
도 5는 입력 요청 큐 구조체 및 출력 요청 큐 구조체의 등록, 검색, 삭제 과정을 예시한 흐름도이다.5 is a flowchart illustrating a process of registering, searching, and deleting an input request queue structure and an output request queue structure.
도 5에 예시한 바와 같이, 사용자에 의해 네트워크 비동기 입출력 수행을 위한 비동기 입출력 읽기 함수(aio_read()) 및 비동기 입출력 쓰기 함수(aio_write())가 네트워크 비동기 입출력 장치(100)로 호출되면(S500), 해당 요청에 대응하는 입력 요청 구조체 또는 출력 요청 구조체를 할당한다(S502).As illustrated in FIG. 5, when the asynchronous I / O read function (aio_read ()) and the asynchronous I / O write function (aio_write ()) for performing network asynchronous I / O are called by the user to the network asynchronous I / O device 100 (S500). In operation S502, an input request structure or an output request structure corresponding to the request is allocated.
그리고 입출력을 원하는 파일 디스크립터의 함수값을 기준으로 해시 값을 계산하여 해당 해시 엔트리를 탐색해 낸다(S504).In operation S504, a hash value is calculated based on a function value of a file descriptor desired for input / output, and the corresponding hash entry is searched for (S504).
그리고 탐색된 해시 엔트리에 할당된 입력 요청 구조체 또는 출력 요청 구조체를 등록한다(S506).The input request structure or the output request structure allocated to the found hash entry is registered (S506).
이후, 이벤트 통지 대기 쓰레드(110)를 통해 커널 수준의 커널 이벤트 통지 서브 시스템 계층(14)에서 이벤트가 발생하였는지를 파악한다(S508).Thereafter, it is determined whether an event occurs in the kernel event notification subsystem layer 14 at the kernel level through the event notification waiting thread 110 (S508).
만일, 이벤트가 발생하였으면 해당 이벤트가 읽기(입력)인지 쓰기(출력)인지 구분하여 입력 요청 큐 구조체(104) 또는 출력 요청 큐 구조체(106)에서 해당 요청이 있었는지를 검색한다(S510). 이러한 과정은 입력 요청 구조체(104a~104e) 또 는 출력 요청 구조체(106a~106e)를 등록할 때와 마찬가지로, 이벤트가 발생한 파일 디스크립터의 값을 기준으로 해시 값을 계산하여 해당 해시 엔트리를 알아내고, 해당 해시 엔트리에 할당된 입력 요청 구조체(104a~104e) 또는 출력 요청 구조체(106a~106e)를 순차적으로 검색하여 읽기 또는 쓰기 요청이 있는지를 조사할 수 있다.If an event occurs, it is determined whether the corresponding event is read (input) or write (output), and whether the request has been found in the input
입력 요청 큐 구조체(104) 또는 출력 요청 큐 구조체(106)의 요청 여부 검색 결과, 읽기 또는 쓰기 요청이 검색되었으면(S512), 해당 파일 디스크립터에 대한 입출력 작업을 수행한다(S514).When a read result or a read or write request is found in the request result of the input
이와 같은 입출력 작업 수행이 완료되면(S516), 입출력 완료 구조체(108a~108e)를 할당하여 그 수행 결과를 저장하고, 해당 입출력 완료 구조체(108a~108e)를 입출력 완료 큐 구조체(108)에 등록하여 사용자가 그 결과를 확인할 수 있도록 한다(S518).When the execution of such an input / output operation is completed (S516), the input /
이러한 방법으로 리눅스 운영체제에서 네트워크 비동기 입출력 기능을 제공함으로써, 다수의 네트워크 입출력을 요하는 고성능 서버의 성능을 향상시키고, 보다 손쉽게 서버 프로그램을 개발할 수 있다. 또한, 이를 통해 리눅스 운영체제의 활용 범위를 넓힐 수 있다.In this way, by providing the network asynchronous I / O function in the Linux operating system, it is possible to improve the performance of a high performance server requiring a large number of network I / O, and to develop a server program more easily. It also extends the reach of the Linux operating system.
한편, 도 6은 본 실시예에 따른 네트워크 비동기 입출력 장치를 예시한 구성 블록도로서, 사용자 응용 프로그램 수행부(602), 네트워크 비동기 입출력 라이브러리 처리부(604), 커널 수준 이벤트 처리부(606)를 포함한다.6 is a block diagram illustrating a network asynchronous I / O device according to the present embodiment, and includes a user application
도 6에 예시한 바와 같이, 사용자 응용 프로그램 수행부(602)는 사용자의 네 트워크 비동기 입출력 요청에 대해 비동기 입출력 읽기 함수/비동기 입출력 쓰기 함수를 호출하며, 본 실시예에 따른 사용자 수준의 네트워크 비동기 입출력 기능을 위한 사용자 응용 프로그램을 수행한다.As illustrated in FIG. 6, the user
네트워크 비동기 입출력 라이브러리 처리부(604)는 사용자 응용 프로그램 수행부(602)에서 사용자 수준의 네트워크 비동기 입출력 기능을 사용할 수 있게 하며, 사용자 응용 프로그램 수행부(602)의 비동기 입출력 읽기/쓰기 함수에 따라 다수의 입출력 요청 구조체 및 입출력 완료 구조체를 관리하고, 후술하는 커널 수준 이벤트 처리부(606)의 이벤트 폴 대기 함수(epoll_wait())를 호출하여 커널 수준 이벤트 처리부(606)를 통해 발생하는 이벤트를 대기하는 역할을 한다.The network asynchronous I / O
커널 수준 이벤트 처리부(606)는 커널 수준에서 사용자 수준의 네트워크 비동기 입출력 기능을 구현 및 동작시키며, 임의의 이벤트, 예컨대 특정 파일에 대한 입출력 가능 이벤트를 발생시켜 네트워크 비동기 입출력 라이브러리 처리부(604)로 제공하는 역할을 한다.The kernel level
이상 설명한 바와 같이, 본 실시예에 따르면, 사용자 수준에서의 네트워크 비동기 입출력 기능을 제공함으로써, 서버 응용프로그램 개발 시 리눅스 운영체제의 안정성을 해치지 않으면서 보다 우수한 성능의 네트워크 비동기 입출력 기능을 활용할 수 있게 구현한 것이다.As described above, according to the present embodiment, by providing the network asynchronous I / O function at the user level, it is possible to implement the network asynchronous I / O function of higher performance without compromising the stability of the Linux operating system when developing server applications. will be.
도 1은 본 실시예에 따른 사용자 수준(user level)에서의 네트워크 비동기 입출력 방법을 수행하기 위한 시스템 운영체제의 계층 구조를 예시한 도면,1 is a diagram illustrating a hierarchical structure of a system operating system for performing a network asynchronous input / output method at a user level according to the present embodiment;
도 2는 도 1의 시스템 운영체제의 계층 구조의 상세 예시도,2 is a detailed illustration of the hierarchical structure of the system operating system of FIG. 1;
도 3은 본 실시예에 따른 네트워크 비동기 입출력 방법을 예시한 흐름도,3 is a flowchart illustrating a network asynchronous input and output method according to the present embodiment;
도 4는 본 실시예에 따른 네트워크 비동기 입출력 방법에서의 입력 요청 큐 구조체 및 출력 요청 큐 구조체에 대한 구성 예시도,4 is an exemplary configuration diagram of an input request queue structure and an output request queue structure in the network asynchronous I / O method according to the present embodiment;
도 5는 본 실시예에 따른 입력 요청 큐 구조체 및 출력 요청 큐 구조체의 등록, 검색, 삭제 과정을 예시한 흐름도,5 is a flowchart illustrating a process of registering, searching, and deleting an input request queue structure and an output request queue structure according to the present embodiment;
도 6은 본 실시예에 따른 네트워크 비동기 입출력 장치를 예시한 구성 블록도.6 is a block diagram illustrating a network asynchronous I / O device according to the present embodiment.
<도면의 주요 부분에 대한 부호의 설명><Explanation of symbols for the main parts of the drawings>
1 : 사용자 쓰레드 14 : 커널 이벤트 통지 서브 시스템1: user thread 14: kernel event notification subsystem
102 : 입출력 정보 구조체 104 : 입력 요청 큐 구조체102: input / output information structure 104: input request queue structure
106 : 출력 요청 큐 구조체 108 : 입출력 완료 큐 구조체106: output request queue structure 108: I / O completion queue structure
110 : 이벤트 통지 대기 쓰레드110: event notification waiting thread
602 : 사용자 응용 프로그램 수행부602 user application execution unit
604 : 네트워크 비동기 입출력 라이브러리 처리부604: network asynchronous I / O library processing unit
606 : 커널 수준 이벤트 처리부606 kernel level event processing unit
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020090043470A KR101134464B1 (en) | 2009-05-19 | 2009-05-19 | Method and apparatus for providing network asynchronous input/output processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020090043470A KR101134464B1 (en) | 2009-05-19 | 2009-05-19 | Method and apparatus for providing network asynchronous input/output processing |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20100124455A KR20100124455A (en) | 2010-11-29 |
KR101134464B1 true KR101134464B1 (en) | 2012-04-13 |
Family
ID=43408655
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020090043470A KR101134464B1 (en) | 2009-05-19 | 2009-05-19 | Method and apparatus for providing network asynchronous input/output processing |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101134464B1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102504274B1 (en) * | 2020-06-08 | 2023-02-28 | 한국전자통신연구원 | Server, apparatus and method for accelating file input-output offload for unikernel |
KR102449016B1 (en) * | 2020-12-29 | 2022-09-29 | 주식회사 코난테크놀로지 | Method of reducing resources through asynchronous parallel processing without supporting events and its parallel processing apparatus |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100594430B1 (en) * | 2004-12-14 | 2006-06-30 | 한국전자통신연구원 | Asynchronous I/O method in the network |
JP2007328597A (en) * | 2006-06-08 | 2007-12-20 | Mitsubishi Electric Corp | Computer system, trace data storage method of computer system, and trace data storing program |
-
2009
- 2009-05-19 KR KR1020090043470A patent/KR101134464B1/en not_active IP Right Cessation
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100594430B1 (en) * | 2004-12-14 | 2006-06-30 | 한국전자통신연구원 | Asynchronous I/O method in the network |
JP2007328597A (en) * | 2006-06-08 | 2007-12-20 | Mitsubishi Electric Corp | Computer system, trace data storage method of computer system, and trace data storing program |
Also Published As
Publication number | Publication date |
---|---|
KR20100124455A (en) | 2010-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11868785B2 (en) | Application program page processing method and device | |
US9229759B2 (en) | Virtual machine provisioning using replicated containers | |
CN106663021B (en) | Intelligent GPU scheduling in virtualized environments | |
LiKamWa et al. | Starfish: Efficient concurrency support for computer vision applications | |
US9015672B2 (en) | Interface simulator for test rig in data distribution service | |
CN107851060B (en) | Probabilistic computation in offloading data analysis applications | |
CN108351783A (en) | The method and apparatus that task is handled in multinuclear digital information processing system | |
CN107203465B (en) | System interface testing method and device | |
KR20120054027A (en) | Mapping processing logic having data parallel threads across processors | |
US10467052B2 (en) | Cluster topology aware container scheduling for efficient data transfer | |
KR20130084659A (en) | System and method for managing resources of a portable computing device | |
US20200356406A1 (en) | Framework-agnostic agile container launches through lateral reuse of capabilities in standard runtimes | |
Ghasemi et al. | Accelerating apache spark with fpgas | |
US11175919B1 (en) | Synchronization of concurrent computation engines | |
KR101134464B1 (en) | Method and apparatus for providing network asynchronous input/output processing | |
CN113625998A (en) | Request processing method and device | |
US10922146B1 (en) | Synchronization of concurrent computation engines | |
CN111767059A (en) | Deployment method and device of deep learning model, electronic equipment and storage medium | |
US20120066415A1 (en) | Methods and systems for direct memory access (dma) in-flight status | |
US11061654B1 (en) | Synchronization of concurrent computation engines | |
CN107220101B (en) | Container creation method and device | |
CN112041817A (en) | Method and node for managing requests for hardware acceleration by means of an accelerator device | |
US20150067071A1 (en) | Managing message distribution in a networked environment | |
CN109561146A (en) | Document down loading method, device, terminal device | |
CN103823707A (en) | Hyper-threading based rebalancing method for equipment to process business |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
LAPS | Lapse due to unpaid annual fee |