KR20080059934A - A thread management method and system of the server using non-blocking input and output - Google Patents

A thread management method and system of the server using non-blocking input and output Download PDF

Info

Publication number
KR20080059934A
KR20080059934A KR1020060133882A KR20060133882A KR20080059934A KR 20080059934 A KR20080059934 A KR 20080059934A KR 1020060133882 A KR1020060133882 A KR 1020060133882A KR 20060133882 A KR20060133882 A KR 20060133882A KR 20080059934 A KR20080059934 A KR 20080059934A
Authority
KR
South Korea
Prior art keywords
thread
client
connection
server
threads
Prior art date
Application number
KR1020060133882A
Other languages
Korean (ko)
Other versions
KR100874403B1 (en
Inventor
박길철
김용태
신현호
Original Assignee
학교법인 대전기독학원
박길철
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 학교법인 대전기독학원, 박길철 filed Critical 학교법인 대전기독학원
Priority to KR1020060133882A priority Critical patent/KR100874403B1/en
Publication of KR20080059934A publication Critical patent/KR20080059934A/en
Application granted granted Critical
Publication of KR100874403B1 publication Critical patent/KR100874403B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30076Arrangements for executing specific machine instructions to perform miscellaneous control operations, e.g. NOP
    • G06F9/3009Thread control instructions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus

Abstract

A method and a system for managing threads in a server using non-blocking I/O(Input/Output) are provided to improve server access/response times for a client request by changing the user thread into a waiting state promptly executed again in response to the client request without blocking the thread from transmitting data to a client or receiving the data from the client. A server(100) processes a request of clients(200-20n) through a communication agent(120) using a thread pool(110) and non-blocking I/O. The thread pool stores the prepared threads(112-114) in a thread repository(111) having a stack structure and removes the unnecessary thread through a thread manager(115). The communication agent includes a connector(122) and a connection processor(121) using the non-blocking I/O. The connector receives first connection of the client, and the connection processor transfers the client request to the thread pool by generating client information or transmitting data received from the client to the thread pool when the client is connected. A connector repository(123) transfers client connection between the connector and the connection processor. A selector(130) selects the threads suitable for a job requested from the client.

Description

논 블록킹 입출력을 이용한 서버의 쓰레드 관리 방법 및 시스템{A thread management method and system of the server using non-blocking input and output}A thread management method and system of the server using non-blocking input and output}

도 1은 본 발명의 바람직한 실시예에 따른 시스템 구성도.1 is a system configuration according to a preferred embodiment of the present invention.

도 2는 클라이언트가 서버에 접속하는 과정의 흐름도.2 is a flowchart of a process of a client connecting to a server.

도 3은 클라이언트가 서버에 작업을 요청하는 과정을 나타낸 흐름도.3 is a flowchart illustrating a process in which a client requests a job from a server.

도 4은 본 발명에 따라 쓰레드 풀로 전달된 클라이언트 요청을 처리하는 과정의 흐름도.4 is a flow diagram of a process for processing a client request sent to a thread pool in accordance with the present invention.

도 4a는 쓰레드를 생성하는 단계(S_322)를 나타낸 흐름도.4A is a flowchart illustrating a step S_322 of creating a thread.

도 4b는 쓰레드가 클라이언트의 작업요청에 따라 작업을 수행하는 단계를 나타낸 흐름도.4B is a flow diagram illustrating a step in which a thread performs a task in accordance with a client's work request.

도 5는 클라이언트가 접속 종료하는 과정을 나타낸 흐름도.5 is a flowchart illustrating a process in which a client terminates connection.

도 6은 쓰레드 풀에서 쓰레드를 관리하는 과정을 나타낸 흐름도.6 is a flowchart illustrating a process of managing threads in a thread pool.

** 도면의 주요부분에 대한 부호의 설명 **** Explanation of symbols for main parts of drawings **

100...서버 200, 201, 202, 20n...클라이언트100 ... server 200, 201, 202, 20n ... client

110...쓰레드 관리자 112, 113, 114...쓰레드110 ... Thread Manager 112, 113, 114 ... Threads

120...통신에이전트 121...연결처리부120 Communication Agent 121 Connection Processing Unit

122...접속부 123...연결저장소122 ... Connection 123 ... Connection storage

130...셀렉터 300...인터넷130 ... Selector 300 ... Internet

본 발명은 쓰레드 서버 시스템에 있어서 클라이언트의 작업요청을 수행하는 서버의 쓰레드 관리 방법에 관한 것으로, 보다 구체적으로는 쓰레드(thread) 서버 환경에서 클라이언트의 요청(접속, 실행)에 대해 사용된 쓰레드가 다시 클라이언트의 요청에 대해 바로 실행할 수 있는 대기상태(wait)로 전환하여 클라이언트의 요청에 대한 서버의 접속 시간과 응답 시간을 향상하는 방법에 관한 것이다.The present invention relates to a thread management method of a server performing a client's work request in a thread server system. More specifically, a thread used for a client's request (connection, execution) in a thread server environment is again used. The present invention relates to a method of improving the connection time and response time of a server for a client request by switching to a wait state that can be executed immediately for the client request.

인터넷이 생활화 되어 많은 사람들이 개인적인 오락의 목적, 사업 목적, 또는 둘 다 때문에 매일 인터넷을 사용하는데, 전자적인 정보와 비즈니스 서비스의 고객으로서, 사람들은 이제 전 세계적인 차원에서 소스(source)를 쉽게 액세스할 수 있다. 사용자가 인터넷을 통하여 소프트웨어 애플리케이션과 서로 상호 작용하고 콘텐츠를 요청할 때, 돌아오는 응답의 지연 또는 비효율성은 사용자의 만족도에 매우 부정적인 영향을 줄 수 있고, 심지어는 사용자들이 다른 소스로 옮겨가도록 할 수도 있다. 따라서 요청된 콘텐츠를 신속히 그리고 효율적으로 전달하는 것은 사용자의 만족도에 있어 매우 중요하고, 따라서 네트워크의 서버 측의 시스템이 가능한 한 효율적으로 동작하도록 보장하는 것이 중요해 지고 있다.The Internet has become so popular that many people use it every day for personal entertainment purposes, business purposes, or both. As customers of electronic information and business services, people now have easy access to sources on a global scale. Can be. When a user interacts with a software application and requests content over the Internet, the delay or inefficiency of the return response can have a very negative impact on the user's satisfaction and even cause the user to move to another source. . Therefore, the delivery of requested content quickly and efficiently is very important for user satisfaction, and therefore, it is important to ensure that the system on the server side of the network operates as efficiently as possible.

즉, 서비스가 많아지고 사용자가 늘어나게 되면서 이전의 서버성능으로는 시스템의 요구사항을 만족시킬 수 없게 되기 때문에 동일한 하드웨어 사양에서도 안정적이고 향상된 성능이 필요하게 되었다.In other words, as the number of services increases and the number of users increases, the previous server performance cannot satisfy the system requirements. Therefore, stable and improved performance is required in the same hardware specification.

종래에는 클라이언트가 서버에 접속할 때마다 클라이언트의 요청을 처리할 쓰레드를 실시간으로 생성하여 접속을 처리하였으나, 실시간으로 쓰레드를 생성하는데 시간과 자원을 많이 사용하게 되어 다수의 클라이언트가 동시에 접속을 하게 될 경우 정상적인 동작이 불가능하였다. Conventionally, whenever a client connects to a server, a thread is processed to process a client's request in real time, but the connection is processed. However, when a large number of clients are connected at the same time because they use a lot of time and resources to create a thread in real time Normal operation was not possible.

이러한 문제점을 해결하기 위해서 쓰레드 풀(thread pool) 모델이 개발되었다.To solve this problem, a thread pool model was developed.

쓰레드 풀이란 다수개의 쓰레드를 미리 만들어 두고 필요한 상황에서 하나씩 사용할 수 있도록 하는 것이다.Thread pools allow you to create multiple threads in advance and use them one at a time when needed.

상기 쓰레드 풀 환경의 서버에서는 블록킹 입출력(blocking i/o)을 사용하여 클라이언트와 서버간의 통신을 하므로, 서버가 클라이언트의 데이터를 받거나 클라이언트로 데이터를 보내는 과정에서 쓰레드가 블록킹(blocking)되는 경우가 발생하여 많은 수의 클라이언트의 요청을 원활히 처리할 수 없었다.Since the server in the thread pool environment communicates between the client and the server by using blocking i / o, a thread may be blocked while the server receives or sends data to the client. It could not handle a large number of client requests smoothly.

상기의 블록킹 입출력 방법은 클라이언트의 요청에 대해 사용된 쓰레드가 메모리에서 제외되는 것으로, 상기 제외된 쓰레드가 클라이언트의 요청에 대해 다시 활성화되기 위해서는 대기상태(wait)가 되어야 하는 데, 상기 활성화(메모리에서 다시 로딩하여 대기상태로 변환)되기까지 많은 시간이 소요되고 리소스가 필요하게 되어 결국 클라이언트의 요청에 대한 접속시간과 응답시간이 길어지는 단점이 있다.In the blocking input / output method, a thread used for a client's request is excluded from memory, and the thread must be waited for the excluded thread to be activated again for the client's request. It takes a lot of time and resources to be reloaded and converted to a standby state, which results in a long connection time and response time for a client request.

따라서 본 발명은 상기의 문제점을 해결하고자 하는 것으로, 쓰레드 서버 환경에서 클라이언트가 서버에 접속할 때의 접속속도와 응답속도를 개선하고자 하는데 그 목적이 있다.Accordingly, an object of the present invention is to solve the above problem, and to improve the connection speed and response speed when a client accesses a server in a thread server environment.

상기의 목적을 이루고자 본 발명에서는 클라이언트에서 사용된 쓰레드를 논-블록킹(non-blocking)상태로 유지하여 클라이언트에서 데이터를 받거나 클라이언트로 데이터를 보내는데 쓰레드가 불록킹(blocking)되지 않고, 즉시 처리 가능한 작업을 하고 나머지 작업을 할 수 있을 때까지 대기상태(wait)를 유지할 수 있게 한다.In order to achieve the above object, the present invention maintains a thread used in a client in a non-blocking state so that the thread can receive data from the client or send data to the client. This allows you to keep waiting until you can do the rest.

본 발명은 네트워크 상에서 서버와 클라이언트의 연결 방법에 관한 것으로 보다 구체적으로는 쓰레드(thread) 서버 환경에서 클라이언트의 요청(접속, 실행)에 대해 사용된 쓰레드가 다시 클라이언트의 요청에 대해 바로 실행할 수 있는 대기상태(wait)로 전환되도록 하여 클라이언트의 요청에 대한 서버의 접속 시간과 응답 시간을 향상하는 방법에 관한 것이다.The present invention relates to a method of connecting a server and a client in a network. More specifically, a thread used for a client's request (connection, execution) in a thread server environment can be executed immediately for the client's request. The present invention relates to a method of improving the connection time and response time of a server for a client request by allowing a transition to a wait.

이하 본 발명에 대해서 상세히 설명한다.Hereinafter, the present invention will be described in detail.

쓰레드 서버 환경에서, 클라이언트가 서버에 접속하면 서버는 접속을 인증하고, 인증된 접속의 연결을 연결 저장소에 저장한다.In a threaded server environment, when a client connects to the server, the server authenticates the connection and stores the connection for the authenticated connection in the connection store.

상기에서 저장되는 연결이 있으면 상기 연결을 셀렉터에 등록시키고 접속 완료임을 클라이언트에 전달한다.If there is a connection stored in the above, the connection is registered with the selector and the connection completion is transmitted to the client.

상기 서버는 클라이언트의 작업 요청에 따라 클라이언트가 보낸 데이터를 읽을 수 있는 연결이 있을 때까지 기다리다가 데이터를 읽어 들일 수 있는 연결을 가져와 클라이언트가 보낸 데이터를 로딩한다. The server waits until there is a connection capable of reading data sent by the client according to the client's work request, and loads the data sent by the client by obtaining a connection capable of reading data.

데이터를 한번에 모두 로딩할 수 없을 수도 있으므로 모든 데이터를 로딩할 때가지 반복한다.You may not be able to load all the data at once, so repeat until you have loaded all the data.

상기 데이터를 모두 로딩하면 쓰레드 풀에서 쓰레드를 가져온다.Loading all the above data pulls a thread from the thread pool.

상기 쓰레드 풀에서 로딩할 수 있는 쓰레드가 없으면 가능한 범위내에서 새로 쓰레드를 생성하여 사용한다. If no thread can be loaded from the thread pool, a new thread is created and used as far as possible.

상기 로딩된 쓰레드에 클라이언트가 요청한 작업을 수행하도록 한다.Allows the client to perform the requested task on the loaded thread.

상기 로딩된 쓰레드가 클라이언트가 요청한 작업을 모두 수행하면 작업의 결과를 클라이언트로 보내고 쓰레드는 대기상태(wait)가 되어 다시 쓰레드 풀에 저장된다.When the loaded thread performs all the tasks requested by the client, the result of the operation is sent to the client, and the thread is waited and stored in the thread pool again.

상기 클라이언트가 서버로 접속종료요청을 보내면 서버는 셀렉터에서 접속종료요청을 한 클라이언트와 서버간의 연결에 대한 등록을 해제한다.When the client sends a connection termination request to the server, the server releases the registration for the connection between the client and the server that made the connection termination request at the selector.

본 발명에서는 쓰레드 풀 모델을 사용한다. In the present invention, the thread pool model is used.

상기 쓰레드 풀의 구조는 DEQUE(Double Ended Queue)를 사용하는데 상기 큐(Queue)는 삽입과 삭제가 목록의 양쪽 끝에서 허용되는 선형 목록(스택)의 형태이다.The structure of the thread pool uses a double ended queue (DEQUE), which is in the form of a linear list (stack) where insertions and deletions are allowed at both ends of the list.

상기 선형 목록의 큐에서 한쪽 끝은 클라이언트의 요청에 따른 쓰레드에 사용하고, 반대쪽 끝은 쓰레드 개수를 제한하는 쓰레드 관리에 사용한다. In the linear list queue, one end is used for threads upon client's request, and the other end is used for thread management, which limits the number of threads.

예를 들어 클라이언트의 요청에 따른 쓰레드가 필요하게 되면 쓰레드 풀의 선형 목록 맨 좌측에서 쓰레드를 로드하고 사용된 쓰레드는 다시 맨 좌측부터 적재된다. 이러한 경우에 선형 목록의 맨 우측은 클라이언트의 요청이 없을 경우 거의 사용이 되지 않을 수 있다. 따라서 선형 목록의 쓰레드 중에서 맨 우측의 쓰레드가 사용된 시간을 검사하여 일정시간이 경과된 이후에 사용되지 아니한 쓰레드는 소멸하는 것이 서버 자원을 줄일 수 있다.For example, if a thread is required at the request of a client, the thread is loaded from the far left of the linear list of thread pools, and the used thread is loaded from the far left. In this case, the far right of the linear list may be rarely used without a client's request. Therefore, by checking the time when the rightmost thread is used among the threads in the linear list, destroying the unused thread after a certain time has elapsed can reduce server resources.

선형 목록, 즉 스택(stack)처럼 동작하여 마지막에 사용되었던 쓰레드를 다시 사용하는 것은, 최근에 사용된 쓰레드를 다시 동작상태(run)로 하는 것이 더 빠르기 때문이다.Reusing threads that were last used by acting like a linear list, or stack, is faster because a recently used thread can be run again.

본 발명에서는 상기의 쓰레드 풀을 하나의 스택처럼 사용하였으므로, 맨 하위(=맨 우측)의 쓰레드를 검사하면 상기 쓰레드가 언제 사용되었는지 알 수 있다.In the present invention, since the thread pool is used as a stack, the bottommost (= rightmost) thread can be inspected to know when the thread is used.

따라서 맨 하위의 쓰레드를 하나씩 로딩하여 지정한 시간 이상 사용하지 않았으면 쓰레드를 삭제되게 설정한다.Therefore, the lowest thread is loaded one by one and the thread is deleted if it has not been used for more than the specified time.

상기에서 선형 목록이라 함은 일반적으로 가로 방향으로 길게 이루어진 형태의 구조이고, 스택은 상하로 길게 이루어진 형태의 구조이다. 이러한 선형 목록 또는 스택(stack)의 구조에서 적재방법은 각각 우측에서 좌측으로, 아래에서 위로 적재되는 것이 일반적인 상식이므로 선형 목록에서는 맨 우측의 쓰레드가 자주 사용하지 않게 되고, 스택에서는 맨 하위의 쓰레드가 자주 사용되지 않는다. 따라서 선형 목록이라고 기술한 부분에서는 맨 우측의 쓰레드를 검사해야 하고, 스택에서는 맨 하위의 쓰레드를 검사해야 한다.In the above, the linear list is generally a structure having a shape extending in the horizontal direction, and the stack is a structure having a shape formed up and down. In this linear list or stack structure, it is common sense that the stacking method is loaded from right to left and bottom to top, respectively, so the rightmost thread is not used frequently in the linear list, and the lowest thread is used in the stack. Not often used Therefore, the part described as a linear list should check the rightmost thread, and the stack must check the lowest thread.

상기 클라이언트의 접속이 많아서 상기 쓰레드 풀에서 더 이상 로드할 쓰레드가 없을 경우에는 새로운 쓰레드를 생성하여 상기 클라이언트의 요청을 수행하는 것이 바람직하나, 쓰레드 풀에서 생성할 수 있는 쓰레드의 개수는 일정 수 이상으로 한정하는 것이 바람직하다. When there are not many threads to be loaded from the thread pool due to the large number of client connections, it is preferable to create a new thread to execute the client's request, but the number of threads that can be created in the thread pool is greater than a certain number. It is preferable to limit.

쓰레드를 필요한 만큼 계속 만들다보면 각 쓰레드의 문맥교환 시간이 늘어나 서비스에 영향을 줄 수 있기 때문이다.If you keep creating as many threads as you need, you can increase the context exchange time for each thread and affect the service.

본 발명에서는 사용된 쓰레드를 블록처리하지 않는다.In the present invention, the used thread is not blocked.

즉, 쓰레드 풀 서버 환경에서 사용된 쓰레드를 논-블록킹(non-blocking)처리하여 읽기/쓰기(read/write)시 쓰레드가 블록킹 되지 않도록 하여 클라이언트의 작업 요청에 따라 바로 쓰레드를 로딩하여 작업을 수행할 수 있다.In other words, non-blocking the threads used in the thread pool server environment so that the threads are not blocked at the time of read / write and load the threads immediately according to the client's work request. can do.

상기의 쓰레드는 클라이언트의 접속을 받아들이는 쓰레드와 클라이언트가 보내는 데이터를 받는 쓰레드를 별도로 두어 즉각적인 접속처리를 가능하게 한다.The above thread separates the thread that accepts the client's connection from the thread that receives the client's data for immediate connection processing.

또한 상기의 쓰레드는 클라이언트의 데이터를 받는 부분을 따로 두어 한 클라이언트 연결이 하나의 쓰레드를 계속 사용하지 않고 필요할 때만 쓰레드를 쓰레드 풀에 요청하여 사용하게 하여 동작상태(run)의 쓰레드 수를 줄일 수 있다.In addition, the above thread can separate the receiving part of the client data, so that one client connection can use the thread pool only when necessary without requesting the continuous use of one thread, thereby reducing the number of run threads. .

상기에서 셀렉터는 등록된 서버와 클라이언트의 네트워크 연결에서 발생하는 I/O Event(connect, accept, read, write)를 감지하여 즉각 처리 가능한 I/O Event가 발생한 서버와 클라이언트의 네트워크 연결을 알려준다.The selector detects an I / O event (connect, accept, read, write) occurring in a network connection between the registered server and the client, and informs the network connection between the server and the client where an immediate I / O event occurs.

상기 셀렉터에서 알려준 연결에 대해서 즉각적인 처리가 가능하므로 이전의 읽기/쓰기(read/write) 동작이 가능할 때까지 블록킹(blocking)되던 현상을 없앨 수 있다.Since the connection can be immediately processed by the selector, it is possible to eliminate the blocking until the previous read / write operation is possible.

상기에서 셀렉터에 등록시킨다는 의미는 셀렉터에서 그 연결의 I/O Event를 감지할 수 있도록 한다는 의미이다.In the above, registering with the selector means that the selector can detect the I / O event of the connection.

본 발명에서 클라이언트가 서버로 보내는 데이터는 모두 논-블록킹 입출력(non-blocking i/o)을 사용하여 하나의 쓰레드에서 수신하기 때문에, 종래의 클라이언트 연결에 대해 하나의 쓰레드가 계속 사용되었던 방법 대신, 클라이언트가 요청한 하나의 작업에 대해서 쓰레드를 쓰레드 풀에서 가져와 사용하고 다시 쓰레드 풀로 반환하는 방법이다.In the present invention, since the data sent from the client to the server is all received in one thread using non-blocking i / o, instead of the method in which one thread was continuously used for a conventional client connection, For a task requested by a client, a thread is taken from the thread pool, used, and returned to the thread pool.

쓰레드 환경에서 쓰레드를 생성하는 데에는 많은 자원을 소모하는데, 본 발명의 쓰레드 풀에 저장된 쓰레드는 클라이언트가 서버로 보낸 데이터를 받아오는 시간동안 쓰레드가 동작상태(run)가 아니라 대기상태(wait)이므로, 접속과 동시에 쓰레드를 생성하는 것보다 미리 쓰레드를 생성하고 사용하는 방법으로 반응속도, 즉 응답속도를 줄일 수 있다.Creating a thread in a threaded environment consumes a lot of resources, but the thread stored in the thread pool of the present invention is a wait state rather than a run during the time a client receives data sent to the server. Rather than creating a thread at the same time as the connection, you can reduce the response, or response, by creating and using the thread in advance.

이하 첨부된 도면에 따라 상세히 설명한다.Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 바람직한 실시예에 따른 시스템 구성도이다.1 is a system configuration according to a preferred embodiment of the present invention.

서버(100)는 쓰레드 풀(110)과 논-블록킹 입출력(non blocking i/o)을 사용하는 통신에이전트(120)를 통해 인터넷(300)을 통한 클라이언트(200)의 요청을 처리한다.The server 100 processes a request of the client 200 through the Internet 300 through the communication agent 120 using the thread pool 110 and non-blocking input / output (non blocking i / o).

쓰레드 풀(110)은 스택구조로 된 쓰레드 저장소(111)에 미리 준비된 쓰레드(112, 113, 114)를 담고 있으며, 쓰레드 관리자(115)를 통해 불필요한 쓰레드를 제거한다.The thread pool 110 contains threads 112, 113, and 114 prepared in advance in the stack storage 111 having a stack structure, and removes unnecessary threads through the thread manager 115.

통신에이전트(120)는 논-블록킹 입출력(non blocking i/o)을 사용하는 접속부(122)와 연결처리부(121)를 가지고 있다. 상기 접속부(122)는 클라이언트의 첫 접속을 받아들이는 역할을 하고, 상기 연결처리부(121)는 클라이언트 접속시 클라이언트 정보를 생성하거나 클라이언트가 보낸 데이터를 받아 쓰레드 풀(110)로 클라이언트의 요청을 전달하는 역할을 한다. 접속부(122)와 연결 처리부(121) 간의 클라이언트 연결 전달은 연결저장소(123)를 통한다.The communication agent 120 has a connection unit 122 and a connection processing unit 121 using non-blocking input / output (non blocking i / o). The connection unit 122 serves to accept a client's first connection, and the connection processing unit 121 generates client information or receives data sent by the client when the client connects, and transmits a client's request to the thread pool 110. Play a role. Client connection transfer between the connection unit 122 and the connection processing unit 121 is through the connection storage 123.

셀렉터(130)는 등록된 서버와 클라이언트의 네트워크 연결에서 발생하는 I/O Event(connect, accept, read, write)를 감지하여 즉각 처리 가능한 I/O Event가 발생한 서버와 클라이언트의 네트워크 연결을 알려주는 것으로, 클라이언트(300)의 작업요청에 적합한 쓰레드(112, 113, 114)를 선택하는 것이다.The selector 130 detects an I / O event (connect, accept, read, write) occurring in a network connection between the registered server and the client, and informs the network connection between the server and the client where an immediate I / O event occurs. In this case, the threads 112, 113, and 114 suitable for the work request of the client 300 are selected.

도 2는 클라이언트가 서버에 접속하는 과정의 흐름도이다.2 is a flowchart of a process of a client connecting to a server.

클라이언트(300)가 접속을 요청하는 단계(S_100);Requesting connection by the client 300 (S_100);

서버(100)의 접속부(122)에서 접속을 수락하는 단계(S_110);Accepting the connection at the connection unit 122 of the server 100 (S_110);

상기 접속을 수락한 클라이언트(200)와의 연결을 서버의 연결저장소(123)에 저장하는 단계(S_120);Storing the connection with the client 200 which has accepted the connection in a connection storage 123 of a server (S_120);

상기 연결저장소(123)에 저장 후 연결 처리부로(121)로 wake-up message를 전송하는 단계(S_130);Transmitting the wake-up message to the connection processing unit 121 after storing the connection storage 123 (S_130);

상기의 wake-up message가 수신되면 서버(100)의 연결저장소(123)로부터 클라이언트(200)와의 연결을 가져와 허용된 접속 수가 초과되었는지 확인하는 단계(S_130);When the wake-up message is received, obtaining a connection with the client 200 from the connection storage 123 of the server 100 and checking whether the number of allowed connections is exceeded (S_130);

상기에서 접속 수를 초과하지 않았으면 셀렉터(130)에 클라이언트와의 연결을 등록하는 단계(S_140);Registering the connection with the client in the selector 130 if the number of connections is not exceeded (S_140);

상기 연결이 등록되면 접속 완료를 처리하고 상기 클라이언트(200)로 접속 성공을 전송하는 단계(S_150);If the connection is registered, processing connection completion and transmitting a connection success to the client 200 (S_150);

상기의 S_140 단계에서 접속 수를 초과하였으면 클라이언트와의 연결을 종료시키고 클라이언트는 접속에 실패를 전송하는 단계(S_160);Terminating the connection with the client if the number of connections is exceeded in step S_140 and transmitting a failure to the connection (S_160);

로 이루어진다.Is made of.

다음으로 접속된 클라이언트에서 서버에 작업을 요청하는 단계를 흐름도로 설명한다.Next, the steps for requesting a task from the connected client to the server will be described in a flowchart.

도 3은 클라이언트가 서버에 작업을 요청하는 과정을 나타낸 흐름도이다.3 is a flowchart illustrating a process in which a client requests a job from a server.

클라이언트(200)가 서버(100)로 작업을 요청하는 단계(S_200);Requesting a job from the client 200 to the server 100 (S_200);

상기 서버(200)의 셀렉터(130)로부터 데이터를 읽어 올 수 있는 클라이언트 연결이 있음이 확인되면 상기 클라이언트의 작업 요청에 따라 데이터를 로딩할 준비가 된 클라이언트 연결을 로딩하는 단계(S_210);Loading a client connection ready to load data according to a work request of the client when it is confirmed that there is a client connection capable of reading data from the selector 130 of the server 200 (S_210);

상기 연결이 로딩되고 상기 클라이언트가 보낸 데이터를 로딩하는 단계(S_220);Loading the connection and loading data sent by the client (S_220);

상기 클라이언트에서 데이터가 모두 로딩되었는지 확인하는 단계(S_230);Confirming whether all data is loaded in the client (S_230);

상기 클라이언트가 보낸 데이터를 모두 로딩되면 쓰레드 풀에 작업 수행을 요청하는 단계(S_240);Requesting to perform a task to a thread pool when all data sent by the client is loaded (S_240);

로 이루어진다.Is made of.

상기 요청에 따라 작업을 처리하게 되는데 작업에 대해서 처리하는 과정은 도 4를 통하여 설명한다.The job is processed according to the request, and the process of processing the job will be described with reference to FIG. 4.

도 4는 본 발명에 따라 쓰레드 풀로 전달된 클라이언트 요청을 처리하는 과정을 흐름도로 나타낸 것이다.4 is a flowchart illustrating a process of processing a client request delivered to a thread pool according to the present invention.

상기 서버의 쓰레드 풀(110)에서 클라이언트의 작업수행 요청을 수신하는 단계(S_300);Receiving a task execution request of the client in the thread pool (110) of the server (S_300);

상기 작업수행 요청에 대해 사용할 수 있는 쓰레드가 존재하는지 확인하는 단계(S_310);Checking whether there is a thread available for the work execution request (S_310);

사용할 수 있는 쓰레드가 존재하지 않으면, 현재 쓰레드의 수를 허용된 쓰레드 수와 비교하는 단계(S_320);If there are no available threads, comparing the number of current threads with the number of allowed threads (S_320);

상기에서 쓰레드를 더 만들 수 있으면 허용된 쓰레드 수를 넘지 않는 일정 개수만큼 쓰레드를 새로 생성하는 단계(S_321);Generating new threads by a predetermined number not exceeding the allowed number of threads, if the additional threads can be created (S_321);

상기 생성된 쓰레드를 동작상태로 실행하는 단계(S_325);Executing the created thread in an operating state (S_325);

상기 실행된 쓰레드를 대기상태로 전환하여 쓰레드 풀의 쓰레드 저장소(111)에 저장하는 단계(S_326);Switching the executed thread to a standby state and storing the executed thread in a thread storage 111 of a thread pool (S_326);

상기에서 쓰레드를 더 만들 수 없으면 클라이언트의 요청을 처리할 수 없다는 메시지를 생성(S_330) 클라이언트로 처리 불가 메시지를 전송하는 단계(S_331);Generating a message indicating that the client's request cannot be processed (S_330) if the thread cannot be created further (S_331);

상기에서 사용할 수 있는 쓰레드가 있으면 쓰레드 저장소(111)에 쓰레드를 요청하는 단계(S_340);Requesting a thread from the thread storage 111 if there is a thread available in the above (S_340);

상기 요청에 의해 로딩된 쓰레드에 처리할 작업을 전달하는 단계(S_350);Transferring a job to be processed to a thread loaded by the request (S_350);

상기 쓰레드에 wake-up 메시지를 전달하는 단계(S_360);Delivering a wake-up message to the thread (S_360);

상기 쓰레드가 상기 클라이언트가 요청한 작업을 수행하는 단계(S_370);The thread performing a task requested by the client (S_370);

상기 쓰레드가 작업을 수행한 결과를 클라이언트에 전송하는 단계(S_380);Transmitting a result of the thread performing a task to a client (S_380);

상기에서 작업을 수행한 쓰레드를 쓰레드 풀의 쓰레드 저장소(111)에 저장하는 단계(S_390);Storing the thread on which the operation is performed in the thread storage 111 of the thread pool (S_390);

로 이루어진다.Is made of.

본 발명에서 처음 서버를 구동할 때 무한대로 쓰레드를 생성할 수 없으므로 설정된 수만큼 생성하고, 필요하면 더 생성하고 사용하지 않으면 삭제한다.In the present invention, when the server is first started, threads cannot be created indefinitely.

상기에서 생성된 쓰레드를 동작상태로 실행하는 것은 쓰레드를 생성하면 Tm레드는 준비상태(ready)가 된다. 그래서 쓰레드를 실행시켜주어야 쓰레드가 동작하게 되고, 다시 대기상태(wait)로 전환하여 쓰레드 풀의 쓰레드 저장소에 저장하여야 요청된 쓰레드가 클라이언트의 작업 요청에 대해 즉시 실행할 수 있다.Running the created thread in the operating state causes the thread to be ready when the thread is created. Therefore, the thread must be executed to run the thread, and then switch back to the wait state and store it in the thread pool of the thread pool so that the requested thread can immediately execute the client's work request.

상기의 과정에서 상기 쓰레드를 생성하는 단계(S_322)를 도 4a를 통하여 설명한다.A step (S_322) of generating the thread in the above process will be described with reference to FIG. 4A.

일정 개수만큼 쓰레드를 생성가능 한지 확인하는 단계(S_322);Checking whether a predetermined number of threads can be created (S_322);

일정 개수만큼 쓰레드를 생성할 수 없으면 생성할 수 있는 최대 쓰레드의 개수로 수정하는 단계(S_323);If it is not possible to create a predetermined number of threads, modifying the maximum number of threads that can be created (S_323);

상기에서 일정 개수만큼 쓰레드를 생성할 수 있으면 상기 일정 수만큼의 쓰레드를 생성하고, 일정 개수만큼 쓰레드를 생성할 수 없으면 수정된 개수만큼의 쓰레드를 생성하는 단계(S_324);Generating a predetermined number of threads if a predetermined number of threads can be created, and generating a modified number of threads if a predetermined number of threads cannot be generated (S_324);

로 이루어진다.Is made of.

상기의 과정에서 상기 쓰레드가 클라이언트의 작업요청에 따라 작업을 수행하는 단계(S_370)를 도 4b를 통하여 설명한다.In the above process, the step (S_370) in which the thread performs the work according to the work request of the client will be described with reference to FIG. 4B.

클라이언트의 작업요청을 처리하도록 한 쓰레드는 wake-up 메시지를 확인하는 단계(S_371);The thread for processing the work request of the client checks the wake-up message (S_371);

wake-up 메시지를 받으면 클라이언트의 작업요청에 따른 작업을 수행하는 단계(S_372);performing a work according to a work request of a client when receiving a wake-up message (S_372);

상기의 쓰레드에 사용된 시간을 저장하고 상기 쓰레드를 대기상태로 전환하는 단계(S_373);Storing the time used for the thread and transitioning the thread to a standby state (S_373);

로 이루어진다.Is made of.

상기에서 사용할 쓰레드가 없을 때에는 새로운 쓰레드를 생성해 주어야 하는데 쓰레드가 부족할 때마다 하나씩 생성하면 자주 쓰레드를 생성하게 된다. 그렇기 때문에 한번에 일정한 개수만큼씩 생성해 준다. 상기의 일정한 수는 당업자에 의해서 조정됨이 바람직하다.If there is no thread to use above, you should create a new thread. If you run out of threads, create one each time. Therefore, it creates a certain number at a time. It is preferred that the above constant number be adjusted by one skilled in the art.

상기의 쓰레드는 대기상태(wait)로 작업을 처리하기를 기다리고 있어서 wake-up 메시지로 상태를 동작상태(run)로 바꾸어 주어야 작업을 처리할 수 있다.The thread is waiting for the task to be processed in a wait state, so the task can be processed by changing the state to a run state with a wake-up message.

쓰레드를 관리하는 과정에서 일정시간 이상 사용하지 않은 쓰레드를 삭제해 주어야 하기 때문에 마지막으로 사용한 시간(=유휴시간)을 저장한다.The last time used (= idle time) is saved because the thread that has not been used for a certain time must be deleted during the thread management process.

상기와 같이 본 발명의 논-블로킹 입출력(non-blocking i/o) 상에서는 로딩 준비가 된 클라이언트 연결이라고 해도 전체 데이터를 모두 로딩할 수 있는 상태가 아닐 수 있기 때문에 전체 데이터를 받았는지 확인하여 다음 진행을 결정하여야 한다.As described above, even if the client connection is ready for loading on the non-blocking i / o of the present invention, it may not be able to load all the data. Should be determined.

도 5는 클라이언트가 접속 종료하는 과정을 나타낸 흐름도이다.5 is a flowchart illustrating a process of terminating connection by a client.

클라이언트가 서버에 접속 종료를 요청하는 단계(S_400);Requesting, by the client, to terminate the connection to the server (S_400);

서버에서는 상기 클라이언트의 접속 종료 요청을 수신하는 단계(S_410);Receiving a connection termination request of the client at a server (S_410);

서버는 접속 종료 요청을 수신하면 상기 접속 종료를 요청한 클라이언트의 연결을 셀렉터(130)에서 등록을 해제하고 종료하는 단계(S_420);Receiving a connection termination request from the server, deregistering and terminating the connection of the client requesting the termination from the selector (130) (S_420);

로 이루어진다.Is made of.

본 발명에서는 서버와 클라이언트의 연결이 종료되었다 하더라도 셀렉터(130)에서는 계속 관리하게 된다. 따라서 종료된 클라이언트 연결에 대해서는 등록을 해제하는 과정이 필요하다.In the present invention, even if the connection between the server and the client is terminated, the selector 130 continues to manage. Therefore, it is necessary to unregister the terminated client connection.

일정시간 이상을 사용하지 않은 쓰레드는 쓰레드 풀에서 삭제해야 서버의 과부하를 방지하고 자원을 효율적으로 관리할 수 있다. 도 6은 쓰레드 풀에서 쓰레드를 관리하는 과정을 나타낸 흐름도이다.Threads that have not been used for a certain amount of time should be deleted from the thread pool to prevent server overload and to manage resources efficiently. 6 is a flowchart illustrating a process of managing threads in a thread pool.

지정된 시간을 경과하였는지 확인하는 단계(S_500);Checking whether a predetermined time has elapsed (S_500);

지정된 시간이 경과하였으면 쓰레드 풀의 스택에서 맨 우측의 쓰레드부터 하나씩 검사하는 단계(S_510);If the specified time has elapsed, checking each thread from the rightmost thread in the stack of the thread pool (S_510);

상기 검사에서 쓰레드를 로딩할 수 있는지 판단하는 단계(S_520);Determining whether the thread can be loaded in the check (S_520);

상기 쓰레드를 로딩할 수 있으면 쓰레드의 유휴시간이 설정된 타임아웃시간 보다 큰지 판단하는 단계(S_530);Determining whether the thread idle time is greater than a set timeout time when the thread can be loaded (S_530);

상기 판단에서 타임아웃시간보다 더 오래 되었다면 쓰레드를 종료하고 삭제하는 단계(S_540);Terminating and deleting the thread if it is older than the timeout time in the determination (S_540);

상기 쓰레드를 로딩할 수 없거나 타임아웃시간보다 더 오래되지 않았다면 상기 S_500 단계로 이동하여 다음 체크 시간까지 대기한다.If the thread cannot be loaded or is older than the timeout time, go to step S_500 and wait until the next check time.

상기에서 유휴시간은 클라이언트의 요청에 따라 최종적으로 쓰레드가 사용된 시간을 의미한다.In the above, the idle time means a time when a thread is finally used according to a client's request.

상기의 과정은 서버의 쓰레드 풀 관리자(115)에서 실행한다.The above process is executed by the thread pool manager 115 of the server.

본 발명의 쓰레드 풀의 구조는 상기에서 언급하였듯이 DEQUE(Double Ended Queue) 형태이고, 풀의 한쪽에서만 꺼내어 쓰고 다시 넣고 하기 때문에 사용하는 쪽의 반대쪽에서 하나씩 로딩하여 체크하면 쓰레드 유휴시간이 가장 오래된 쓰레드부터 가져올 수 있다. 상기 로딩된 쓰레드의 유휴시간이 타임아웃시간을 넘지 않았으면 상기 쓰레드 이후의 쓰레드는 모두 유휴시간을 넘지 않기 때문에 바로 다음번 체크시간을 기다리면 된다.As mentioned above, the thread pool structure of the present invention has a DEQUE (Double Ended Queue) type, and since only one side of the pool is pulled out and reinserted, the thread pool has the longest idle time when loaded and checked one by one from the other side of the pool. I can bring it. If the idle time of the loaded thread does not exceed the timeout time, all the threads after the thread do not exceed the idle time, so the next check time may be waited for.

본 발명에 의하면 클라이언트의 작업요청에 의해 사용된 쓰레드를 논-블록킹(non-blocking)상태로 유지하여 즉시 처리 가능한 작업을 하고 나머지 작업을 할 수 있을 때까지 대기상태(wait)로 기다릴 수 있게 된다. 따라서 클라이언트의 작업요청에 대해 응답속도가 빠르다.According to the present invention, a thread used by a client's work request can be kept in a non-blocking state so that the task can be processed immediately and wait in the wait until the rest can be done. . Therefore, it responds quickly to the client's work request.

또한 설정시간동안 사용되지 아니한 쓰레드는 삭제하여 서버의 과부하를 방지하고 자원을 효율적으로 관리할 수 있다.Also, by deleting threads that have not been used during the configuration time, you can prevent server overload and manage resources efficiently.

Claims (5)

쓰레드 환경의 서버 시스템에서,On a server system in a threaded environment, 쓰레드 풀(110)과 논-블록킹 입출력(non blocking i/o)을 사용하는 통신에이전트(120)를 통해 인터넷(300)을 통한 클라이언트(200)의 요청을 처리하는 서버(100); A server 100 for processing a request of a client 200 through the Internet 300 through a communication agent 120 using a thread pool 110 and non-blocking input / output (non blocking i / o); 스택구조로 된 쓰레드 저장소(111)에 미리 준비된 쓰레드(112, 113, 114)를 담고 있으며, 쓰레드 관리자(115)를 통해 불필요한 쓰레드를 제거하는 쓰레드 풀(110);A thread pool 110 containing threads 112, 113, and 114 prepared in advance in the thread storage 111 having a stack structure, and removing unnecessary threads through the thread manager 115; 논-블록킹 입출력(non blocking i/o)을 사용하는 접속부(122)와 연결처리부(121)를 포함하고 상기 접속부(122)는 클라이언트의 첫 접속을 받아들이는 역할을 하고, 상기 연결처리부(121)는 클라이언트 접속시 클라이언트 정보를 생성하거나 클라이언트가 보낸 데이터를 받아 쓰레드 풀(110)로 클라이언트의 요청을 전달하는 역할을 가지는 통신에이전트(120);And a connection unit 122 and a connection processing unit 121 using non-blocking input / output (non blocking i / o), and the connection unit 122 serves to accept a first connection of a client, and the connection processing unit 121 The communication agent 120 has a role of generating client information or receiving data sent by the client and forwarding the client's request to the thread pool 110 when the client is connected; 접속부(122)와 연결 처리부(121) 간의 클라이언트 연결 전달을 수행하는 연결저장소(123);A connection storage 123 which performs client connection transfer between the connection unit 122 and the connection processing unit 121; 등록된 서버와 클라이언트의 네트워크 연결에서 발생하는 I/O Event(connect, accept, read, write)를 감지하여 즉각 처리 가능한 I/O Event가 발생한 서버와 클라이언트의 네트워크 연결을 알려주는 것으로, 클라이언트(300)의 작업요청에 적합한 쓰레드(112, 113, 114)를 선택하는 셀렉터(130);By detecting the I / O event (connect, accept, read, write) occurring in the network connection between the registered server and the client, it informs the network connection between the server and the client where the immediate I / O event occurred, and the client 300 Selector 130 for selecting threads 112, 113, and 114 suitable for the work request of the < RTI ID = 0.0 > 로 구성됨을 특징으로 하는 논 블록킹 입출력을 이용한 서버의 쓰레드 관리 시스템.Server thread management system using non-blocking input and output, characterized in that consisting of. 쓰레드 환경의 서버 시스템에서,On a server system in a threaded environment, 클라이언트(200)가 서버(100)에 접속하면 상기 서버(100)는 접속을 인증하고, 인증된 접속의 연결을 연결 저장소(111)에 저장하고,When the client 200 connects to the server 100, the server 100 authenticates the connection, stores the connection of the authenticated connection in the connection storage 111, 상기에서 저장되는 연결이 있으면 상기 연결을 셀렉터(130)에 등록시키고 접속 완료임을 클라이언트(200)에 전달하고, If there is a connection stored in the register the connection to the selector 130 and delivers the connection completion to the client 200, 상기 서버(100)는 클라이언트의 작업 요청에 따라 클라이언트가 보낸 데이터를 읽을 수 있는 연결이 있을 때까지 기다리다가 데이터를 읽어 들일 수 있는 연결을 가져와 클라이언트가 보낸 데이터를 로딩하고,The server 100 waits until there is a connection for reading data sent by the client according to a client's work request, and loads the data sent by the client by obtaining a connection for reading data. 상기 데이터를 모두 로딩하면 쓰레드 풀(110)에서 쓰레드(112, 113, 114)를 가져오되, 상기 쓰레드 풀(110)에서 로딩할 수 있는 쓰레드가 없으면 가능한 범위 내에서 새로운 쓰레드를 생성하고,Loading all of the data brings the threads 112, 113, and 114 from the thread pool 110. If there are no threads that can be loaded from the thread pool 110, a new thread is created within the range possible. 상기 로딩된 쓰레드에 클라이언트가 요청한 작업을 수행하고,Perform the operation requested by the client on the loaded thread, 상기 쓰레드가 요청한 작업을 모두 수행하면 작업의 결과를 클라이언트로 보내고 쓰레드는 대기상태(wait)가 되어 다시 쓰레드 풀(110)에 저장됨을 특징으로 하는 논 블록킹 입출력을 이용한 서버의 쓰레드 관리 방법.When the thread performs all of the requested operation, the result of the operation is sent to the client, the thread is a wait state (wait) and stored in the thread pool (110), characterized in that the server thread management method using non-blocking input and output. 클라이언트가 서버에 접속하면 서버는 접속을 인증하고, 인증된 접속의 연결을 연결 저장소에 저장하는 쓰레드 환경의 서버시스템에 있어서,In a threaded server system where a client connects to a server, the server authenticates the connection and stores the connection for the authenticated connection in the connection repository. 상기 서버의 쓰레드 풀(110)에서 클라이언트의 작업수행 요청을 수신하는 단계(S_300);Receiving a task execution request of the client in the thread pool (110) of the server (S_300); 상기 작업수행 요청에 대해 사용할 수 있는 쓰레드가 존재하는지 확인하는 단계(S_310);Checking whether there is a thread available for the work execution request (S_310); 사용할 수 있는 쓰레드가 존재하지 않으면, 현재 쓰레드의 수를 허용된 쓰레드 수와 비교하는 단계(S_320);If there are no available threads, comparing the number of current threads with the number of allowed threads (S_320); 상기에서 쓰레드를 더 만들 수 있으면 허용된 쓰레드 수를 넘지 않는 일정 개수만큼 쓰레드를 새로 생성하는 단계(S_321);Generating new threads by a predetermined number not exceeding the allowed number of threads, if the additional threads can be created (S_321); 상기 생성된 쓰레드를 동작상태로 실행하는 단계(S_325);Executing the created thread in an operating state (S_325); 상기 실행된 쓰레드를 대기상태로 전환하여 쓰레드 풀(110)의 쓰레드 저장소(111)에 저장하는 단계(S_326);Switching the executed thread to a standby state and storing the executed thread in a thread storage 111 of a thread pool 110 (S_326); 상기에서 쓰레드를 더 만들 수 없으면 클라이언트의 요청을 처리할 수 없다는 메시지를 생성(S_330) 클라이언트로 처리 불가 메시지를 전송하는 단계(S_331);Generating a message indicating that the client's request cannot be processed (S_330) if the thread cannot be created further (S_331); 상기에서 사용할 수 있는 쓰레드가 있으면 쓰레드 저장소(111)에 쓰레드를 요청하는 단계(S_340);Requesting a thread from the thread storage 111 if there is a thread available in the above (S_340); 상기 요청에 의해 로딩된 쓰레드에 처리할 작업을 전달하는 단계(S_350);Transferring a job to be processed to a thread loaded by the request (S_350); 상기 쓰레드에 wake-up 메시지를 전달하는 단계(S_360);Delivering a wake-up message to the thread (S_360); 상기 쓰레드가 상기 클라이언트가 요청한 작업을 수행하는 단계(S_370);The thread performing a task requested by the client (S_370); 상기 쓰레드가 작업을 수행한 결과를 클라이언트에 전송하는 단계(S_380);Transmitting a result of the thread performing a task to a client (S_380); 상기에서 작업을 수행한 쓰레드를 쓰레드 풀(110)의 쓰레드 저장소(111)에 저장하는 단계(S_390);Storing the thread on which the work is performed in the thread storage 111 of the thread pool 110 (S_390); 를 포함하는 것을 특징으로 하는 논 블록킹 입출력을 이용한 서버의 쓰레드 관리 방법.Thread management method of the server using non-blocking input and output, characterized in that it comprises a. 청구항 제 3항에 있어서,The method of claim 3, wherein 상기의 쓰레드를 생성하는 단계(S_322)는,Creating a thread (S_322), 일정 개수만큼 쓰레드를 생성가능 한지 확인하는 단계(S_322);Checking whether a predetermined number of threads can be created (S_322); 일정 개수만큼 쓰레드를 생성할 수 없으면 생성할 수 있는 최대 쓰레드의 개수로 수정하는 단계(S_323);If it is not possible to create a predetermined number of threads, modifying the maximum number of threads that can be created (S_323); 상기에서 일정 개수만큼 쓰레드를 생성할 수 있으면 상기 일정 수만큼의 쓰레드를 생성하고, 일정 개수만큼 쓰레드를 생성할 수 없으면 수정된 개수만큼의 쓰레드를 생성하는 단계(S_324);Generating a predetermined number of threads if a predetermined number of threads can be created, and generating a modified number of threads if a predetermined number of threads cannot be generated (S_324); 를 더 포함하는 것을 특징으로 하는 논 블록킹 입출력을 이용한 서버의 쓰레드 관리 방법.Thread management method of the server using non-blocking input and output, characterized in that it further comprises. 청구항 제 3항에 있어서,The method of claim 3, wherein 상기 쓰레드가 클라이언트의 작업요청에 따라 작업을 수행하는 단계(S_370)는,In operation S_370, the thread performs a work according to a work request of a client. 클라이언트의 작업요청을 처리하도록 한 쓰레드는 wake-up 메시지를 확인하는 단계(S_371);The thread for processing the work request of the client checks the wake-up message (S_371); wake-up 메시지를 받으면 클라이언트의 작업요청에 따른 작업을 수행하는 단계(S_372);performing a work according to a work request of a client when receiving a wake-up message (S_372); 상기의 쓰레드에 사용된 시간을 저장하고 상기 쓰레드를 대기상태로 전환하는 단계(S_373);Storing the time used for the thread and transitioning the thread to a standby state (S_373); 를 더 포함하는 것을 특징으로 하는 논 블록킹 입출력을 이용한 서버의 쓰레드 관리 방법.Thread management method of the server using non-blocking input and output, characterized in that it further comprises.
KR1020060133882A 2006-12-26 2006-12-26 Server thread management method and system using non-blocking I / O KR100874403B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060133882A KR100874403B1 (en) 2006-12-26 2006-12-26 Server thread management method and system using non-blocking I / O

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060133882A KR100874403B1 (en) 2006-12-26 2006-12-26 Server thread management method and system using non-blocking I / O

Publications (2)

Publication Number Publication Date
KR20080059934A true KR20080059934A (en) 2008-07-01
KR100874403B1 KR100874403B1 (en) 2008-12-16

Family

ID=39812639

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060133882A KR100874403B1 (en) 2006-12-26 2006-12-26 Server thread management method and system using non-blocking I / O

Country Status (1)

Country Link
KR (1) KR100874403B1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101067848B1 (en) * 2009-06-24 2011-09-27 에스지네트워크(주) An entry management method of binding table using multi-thread for multimedia service stablity
JP2017130189A (en) * 2016-01-20 2017-07-27 株式会社リコー Information processing system, information processing device, and information processing method
CN111722944A (en) * 2020-06-15 2020-09-29 哈工大机器人(合肥)国际创新研究院 NIO-based AIRT-ROS communication method and system
KR102307641B1 (en) * 2021-04-30 2021-10-01 나무기술 주식회사 Parallel processing control system for cloud operation data analysis

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101067848B1 (en) * 2009-06-24 2011-09-27 에스지네트워크(주) An entry management method of binding table using multi-thread for multimedia service stablity
JP2017130189A (en) * 2016-01-20 2017-07-27 株式会社リコー Information processing system, information processing device, and information processing method
CN111722944A (en) * 2020-06-15 2020-09-29 哈工大机器人(合肥)国际创新研究院 NIO-based AIRT-ROS communication method and system
CN111722944B (en) * 2020-06-15 2023-04-18 合肥哈工轩辕智能科技有限公司 NIO-based AIRT-ROS communication method and system
KR102307641B1 (en) * 2021-04-30 2021-10-01 나무기술 주식회사 Parallel processing control system for cloud operation data analysis

Also Published As

Publication number Publication date
KR100874403B1 (en) 2008-12-16

Similar Documents

Publication Publication Date Title
US11689489B2 (en) Message history display system and method
JP4569846B2 (en) I / O node control method and method
US8874780B2 (en) Data buffering and notification system and methods thereof
CN100424647C (en) System and method for increasing data throughput using thread scheduling
US6477569B1 (en) Method and apparatus for computer network management
US8359595B2 (en) Generic application server and method of operation therefor
CN108595282A (en) A kind of implementation method of high concurrent message queue
US20080177973A1 (en) Determining on demand right size buffering within a socket server implementation
US20040122953A1 (en) Communication multiplexor for use with a database system implemented on a data processing system
JPH10124470A (en) Mechanism for calling processing of multiplexed message with small overhead of low context switching
US10409656B2 (en) Efficiently receiving messages across a large number of messaging entities
CN112328362B (en) Method for realizing function calculation service based on container technology
KR100874403B1 (en) Server thread management method and system using non-blocking I / O
US7970814B2 (en) Method and apparatus for providing a synchronous interface for an asynchronous service
US8448182B2 (en) System and method for pause and resume message operations on destinations
CN108984290B (en) Task scheduling method and system
US20050198127A1 (en) Systems and methods that facilitate in-order serial processing of related messages
CN105830029B (en) system and method for supporting adaptive busy-wait in a computing environment
WO2020006903A1 (en) Financial data interaction method, apparatus computer device and storage medium
US20060242258A1 (en) File sharing system, file sharing program, management server and client terminal
CN117093387B (en) Message processing method, device, electronic equipment and storage medium
US20100042679A1 (en) Method and interprocess communication driver for managing requests of a database client to a database server
CN114296916B (en) Method, device and medium for improving RDMA release performance
US8620991B2 (en) Technologies for detecting erroneous resumptions in a continuation based runtime
CN117411932A (en) Message pushing method and device, electronic equipment and computer storage medium

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
N231 Notification of change of applicant
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20121207

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20131206

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee