KR101725408B1 - Tasks scheduling method for realtime operating system - Google Patents

Tasks scheduling method for realtime operating system Download PDF

Info

Publication number
KR101725408B1
KR101725408B1 KR1020120016133A KR20120016133A KR101725408B1 KR 101725408 B1 KR101725408 B1 KR 101725408B1 KR 1020120016133 A KR1020120016133 A KR 1020120016133A KR 20120016133 A KR20120016133 A KR 20120016133A KR 101725408 B1 KR101725408 B1 KR 101725408B1
Authority
KR
South Korea
Prior art keywords
task
time
new
queue
scheduling method
Prior art date
Application number
KR1020120016133A
Other languages
Korean (ko)
Other versions
KR20130094889A (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 KR1020120016133A priority Critical patent/KR101725408B1/en
Publication of KR20130094889A publication Critical patent/KR20130094889A/en
Application granted granted Critical
Publication of KR101725408B1 publication Critical patent/KR101725408B1/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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명에 따른 태스크 스케줄링 방법이 개시된다. 본 발명에 따른 태스크 스케줄링 방법은 태스크들을 순차적으로 실행시키기 위하여 준비 큐에 태스크를 배치하기 위한 태스크 스케줄링 방법으로, 실행 준비상태의 새로운 태스크의 실행 우선순위를 확인하는 단계, 상기 준비 큐에 존재하는 각 태스크의 실행 우선순위를 순차적으로 조사하여, 상기 새로운 태스크의 실행 우선순위보다 작은 실행 우선순위를 갖는 태스크를 도출하는 단계 및 상기 도출된 태스크의 앞에 상기 새로운 태스크를 추가하는 단계를 포함하여 구성된다.A task scheduling method according to the present invention is disclosed. A task scheduling method according to the present invention is a task scheduling method for arranging a task in a preparation queue to sequentially execute tasks, the method comprising the steps of: confirming execution priority of a new task in an execution ready state; Sequentially examining execution priorities of the tasks to derive a task having an execution priority smaller than the execution priority of the new task and adding the new task before the derived task.

Description

실시간 운영체제의 태스크 스케줄링 방법{TASKS SCHEDULING METHOD FOR REALTIME OPERATING SYSTEM}TECHNICAL FIELD [0001] The present invention relates to a task scheduling method for a real-time operating system,

본 발명은 태스크 스케줄링 방법에 관한 것으로, 더욱 상세하게는 실행 준비 중인 태스크 및 대기중인 태스크를 배치하기 위한 태스크 스케줄링 방법에 관한 것이다.The present invention relates to a task scheduling method, and more particularly, to a task scheduling method for arranging a task in preparation for execution and a waiting task.

실시간 운영 체제(Real Time Operating System)는 실시간 응용 프로그램을 위해 개발된 운영 체제로서, 운영 체제의 기능 중 CPU 시간 관리 부분에 초점을 맞추어 설계되었다. 실시간 운영체제의 태스크 스케줄링 방법으로, 두가지 기본적인 설계 방식이 존재하는데, 첫째는, 우선 순위 기반 스케줄링 또는 선점형 스케줄링 이라고 불리는 이벤트 구동(event-driven) 방식으로, 현재 수행중인 태스크보다 높은 우선 순위를 갖는 이벤트가 서비스를 요청할 경우에 태스크(task) 전환이 발생한다. 둘째는, 시분할(time-sharing) 스케줄링 방식으로 클럭 인터럽트나 라운드 로빈과 같은 주기적인 이벤트가 발생할 때 태스크의 전환이 발생한다.Real Time Operating System (OS) is an operating system developed for real-time applications. It is designed to focus on the CPU time management part of the operating system functions. There are two basic design schemes for real-time operating system task scheduling. First, there are two types of scheduling methods: priority-based scheduling or event-driven scheduling. A task transition occurs when a service request is made. Second, a task switching occurs when a periodic event such as a clock interrupt or a round-robin occurs in a time-sharing scheduling method.

일반적으로, 태스크는 수행(running), 준비(ready), 블록(blocked)의 세 가지 상태 중 한 가지 상태로 존재하는데, 대부분의 태스크가 블록상태이고, 오직 한 개의 태스크만 수행상태이다. 간단한 시스템 일수록 준비 상태의 태스크 목록이 짧으며, 많은 경우도 2~3개 정도이다. 새로운 태스크가 생성되면 일단 준비 상태가 된다. 스케줄러는 현재 수행중인 태스크 역시 준비 상태로 변경하고, 두 개의 태스크를 준비 상태 태스크 목록(준비 큐)에 집어 넣는다. 그 후, 가장 우선 순위가 높은 태스크를 다시 수행하게 된다.In general, a task exists in one of three states: running, ready, and blocked. Most tasks are in a block state, and only one task is in execution. The simpler the system, the shorter the task list in the ready state, and in many cases it is about 2 ~ 3. Once a new task is created, it is ready. The scheduler also changes the current task to ready state and puts the two tasks into the ready state task list (preparation queue). Then, the highest priority task is performed again.

종래의 태스크 스케줄링 방법은 우선 순위가 가장 높은 태스크를 찾기 위하여 준비 테이블과 언맵 테이블 등을 사용하기 한다. 우선순위 변환용 언맵 테이블은 여러 개의 태스크들이 존재할 때 가장 우선순위가 높은 태스크의 위치를 정해 놓은 일종의 우선순위 변환 테이블이다. 따라서, 우선 순위 값을 테이블의 인덱스로 활용하여 상수의 시간 결정 시간을 갖지만 큰 메모리 용량을 요구한다. 특히 우선 순위의 개수가 증가할 경우 필요한 메모리 공간은 기하급수적으로 늘어난다. 또한 인덱스를 활용하여 우선 순위가 제일 높은 태스크를 찾는 과정에서 일정한 연산을 필요로 하는 문제가 있다.In the conventional task scheduling method, a preparation table and an unmapped table are used to find the task having the highest priority. The unmap table for priority conversion is a kind of priority conversion table that determines the position of the highest priority task when there are several tasks. Therefore, it uses a priority value as an index of a table, and has a constant time determination time, but requires a large memory capacity. Especially when the number of priorities increases, the memory space required increases exponentially. Also, there is a problem that a certain operation is required in finding a task having the highest priority by utilizing an index.

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은, 우선 순위가 제일 높은 태스크를 찾기 위한 연산을 필요로 하지 않는 태스크 스케줄링 방법을 제공하는 데 있다.An object of the present invention is to provide a task scheduling method that does not require an operation for finding a task having the highest priority.

상기 목적을 달성하기 위한 본 발명의 일 측면은 태스크들을 순차적으로 실행시키기 위하여 준비 큐에 태스크를 배치하기 위한 태스크 스케줄링 방법으로, 실행 준비상태의 새로운 태스크의 실행 우선순위를 확인하는 단계, 상기 준비 큐에 존재하는 각 태스크의 실행 우선순위를 순차적으로 조사하여, 상기 새로운 태스크의 실행 우선순위보다 작은 실행 우선순위를 갖는 태스크를 도출하는 단계 및 상기 도출된 태스크의 앞에 상기 새로운 태스크를 추가하는 단계를 포함하는 태스크 스케줄링 방법을 제공한다.According to an aspect of the present invention, there is provided a task scheduling method for arranging tasks in a preparation queue to sequentially execute tasks, the method comprising: confirming execution priorities of new tasks in a ready state; Sequentially extracting a task having an execution priority smaller than the execution priority of the new task, and adding the new task before the derived task A task scheduling method is provided.

상기 목적을 달성하기 위한 본 발명의 다른 측면은, 대기 상태의 태스크를 순차적으로 깨우기 위하여 대기 큐에 태스크를 배치하기 위한 태스크 스케줄링 방법으로, 새로운 태스크가 대기 상태로 진입하는 경우, 상기 새로운 태스크가 대기 상태에서 깨어날 시간을 확인하는 단계, 상기 대기 큐에 존재하는 각 태스크가 대기 상태에서 깨어날 시간을 순차적으로 조사하여, 상기 새로운 태스크보다 늦게 깨어날 태스크를 도출하는 단계, 및 상기 도출된 태스크의 앞에 상기 새로운 태스크를 추가하는 단계를 포함하는 태스크 스케줄링 방법을 제공한다.According to another aspect of the present invention, there is provided a task scheduling method for disposing a task in a wait queue so as to wake up a task in a waiting state sequentially. In the case of a new task entering a wait state, Determining a time to wake up in a waiting state, sequentially examining a time at which each task in the waiting queue wakes up in a waiting state to derive a task to wake up later than the new task, And adding a task.

상기와 같은 본 발명에 따른 태스크 스케줄링 방법을 이용할 경우에는 태스크의 우선순위에 따라 태스크를 준비 큐에 순차적으로 배치함으로써, 우선 순위를 관리하기 위한 추가적인 메모리 공간이 필요 없고, 새로운 태스크가 추가되지 않는 한 스케줄링이 연산이 거의 필요 없다는 장점이 있다. 또한 대기 상태에 진입한 태스크를 깨어날 시간에 따라 순차적으로 대기 큐에 배치함으로써, 스케줄러는 매 타임 틱에 대기 큐의 제일 앞에 있는 태스크 대해서만 깨어날 시간이 되었는지 확인하면 되므로, 좀 더 효율적인 스케줄링을 할 수 있다.When the task scheduling method according to the present invention as described above is used, it is unnecessary to allocate an additional memory space for managing priorities by sequentially arranging tasks in a preparation queue according to the priority of tasks, and as long as a new task is not added Scheduling has the advantage that it requires little computation. In addition, by placing the task that enters the waiting state sequentially in the waiting queue according to the time to wake up, the scheduler can check the time to wake up only the task at the front of the waiting queue at every time tick, so that more efficient scheduling can be performed .

도 1은 본 발명의 일 실시예에 따른 준비 큐에 태스크를 배치하는 예를 보여주는 블록도이다.
도 2는 본 발명의 일 실시예에 따른 준비 큐에 실행 준비된 태스크를 배치하는 과정을 보여주는 순서도이다.
도 3은 본 발명의 일 실시예에 따른 대기 큐에 태스크를 배치하는 예를 보여주는 블록도이다.
도 4는 본 발명의 일 실시예에 따른 대기 큐에 대기상태의 태스크를 배치하는 과정을 보여주는 순서도이다.
1 is a block diagram showing an example of arranging a task in a preparation queue according to an embodiment of the present invention.
2 is a flowchart showing a process of arranging a task ready for execution in a preparation queue according to an embodiment of the present invention.
3 is a block diagram illustrating an example of placing a task in a wait queue according to an embodiment of the present invention.
4 is a flowchart illustrating a process of placing a task in a wait state in a wait queue according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. While the invention is susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that the invention is not intended to be limited to the particular embodiments, but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. Like reference numerals are used for like elements in describing each drawing.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다. The terms first, second, A, B, etc. may be used to describe various elements, but the elements should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component. And / or < / RTI > includes any combination of a plurality of related listed items or any of a plurality of related listed items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. It is to be understood that when an element is referred to as being "connected" or "connected" to another element, it may be directly connected or connected to the other element, . On the other hand, when an element is referred to as being "directly connected" or "directly connected" to another element, it should be understood that there are no other elements in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used in this application is used only to describe a specific embodiment and is not intended to limit the invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. In the present application, the terms "comprises" or "having" and the like are used to specify that there is a feature, a number, a step, an operation, an element, a component or a combination thereof described in the specification, But do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.
Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Terms such as those defined in commonly used dictionaries are to be interpreted as having a meaning consistent with the contextual meaning of the related art and are to be interpreted as either ideal or overly formal in the sense of the present application Do not.

이하, 본발명에 따른 바람직한 실시예를 첨부한 도면들을 참조하여 상세하게 설명한다. 본 발명을 설명함에 있어 전체적인 이해를 용이하게 하기 위하여 도면상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고 동일한 구성요소에 대해서 중복된 설명은 생략한다. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In order to facilitate the understanding of the present invention, the same reference numerals are used for the same constituent elements in the drawings and redundant explanations for the same constituent elements are omitted.

도 1은 본 발명의 일 실시예에 따른 준비 큐에 태스크를 배치하는 예를 보여주는 블록도이다.1 is a block diagram showing an example of arranging a task in a preparation queue according to an embodiment of the present invention.

도 1을 참조하면, 태스크들은 준비 큐에 연결 리스트로 관리되며, 선점형 우선순위 방식을 기본으로 할 수 있다. 도 1의 (a)는 태스크들이 준비 큐에 배치되어 있는 상태를 보여주며, 도 1의 (b)는 도 1의 (a)의 준비 큐에 새로운 태스크(130)가 추가된 상태를 보여준다.Referring to FIG. 1, tasks are managed in a connection list in a preparation queue, and can be based on a preemptive priority scheme. FIG. 1 (a) shows a state in which tasks are arranged in a preparation queue, and FIG. 1 (b) shows a state in which a new task 130 is added to the preparation queue in FIG.

새로운 태스크(130)가 추가 될 위치를 정하기 위해, 새로운 태스크(130)보다 우선 순위가 작은 태스크가 나올 때까지 준비 큐의 앞에서부터 차례대로 태스크들(110, 120, 140)을 검색한 후, 우선순위가 더 작은 태스크인 태스크3(140)의 앞에 새로운 태스크(130)를 추가할 수 있다.In order to determine a position to which a new task 130 is to be added, the tasks 110, 120, and 140 are searched sequentially from the front of the preparation queue until a task having a priority lower than that of the new task 130 is found, A new task 130 can be added in front of task 3 140, which is a smaller task.

만일, 이러한 방법을 통해, 우선 순위가 제일 높은 태스크(110)가 종료 되면, 준비 큐에서 해당 태스크(110)가 제외되고, 별다른 연산(예를 들면, 우선순위의 확인)이 필요 없이 바로 다음 위치의 태스크(120)를 앞으로 당겨서 수행되도록 할 수 있다.
If the task 110 having the highest priority is terminated through this method, the corresponding task 110 is excluded from the preparation queue, and the next task (e.g., The task 120 of FIG.

도 2는 본 발명의 일 실시예에 따른 준비 큐에 실행 준비된 태스크를 배치하는 과정을 보여주는 순서도이다.2 is a flowchart showing a process of arranging a task ready for execution in a preparation queue according to an embodiment of the present invention.

도 2를 참조하면, 본 발명의 일 실시예에 따른 준비 큐에 실행 준비된 태스크를 배치하는 과정은 실행 준비된 태스크들을 순차적으로 실행시키기 위하여 준비 큐에 태스크를 배치하는 방법으로, 새로운 태스크의 우선순위 확인 단계(S210), 우선순위가 낮은 태스크 도출단계(S220), 새로운 태스크 추가단계(S230)를 포함하여 구성될 수 있다.Referring to FIG. 2, a process of arranging a task ready for execution in a preparation queue according to an embodiment of the present invention is a method of arranging a task in a preparation queue to sequentially execute tasks ready for execution, Step S210, a low priority task deriving step S220, and a new task adding step S230.

또한 도 2를 참조하면, 본 발명의 일 실시예에 따른 준비 큐에 실행 준비된 태스크를 배치하는 과정의 각 단계는 다음과 같이 설명될 수 있다.Referring to FIG. 2, the steps of arranging a task ready for execution in a preparation queue according to an embodiment of the present invention can be described as follows.

새로운 태스크의 우선순위 확인 단계(S210)는 새로이 실행 준비상태가 된 태스크에 대한 태스크의 실행 우선순위를 확인하는 단계일 수 있다. 즉 도 1을 통해 설명한 바와 같이, 실행 우선순위에 따라 태스크를 준비 큐에 배치하기 위해서 추가될 태스크의 우선순위를 확인하는 단계이다.The step of confirming the priority of a new task (S210) may be a step of confirming the execution priority of the task for the newly prepared task. That is, as described with reference to FIG. 1, it is a step of confirming the priority of the task to be added in order to arrange the task in the preparation queue according to the execution priority.

우선순위가 낮은 태스크 도출단계(S120)는 준비 큐에 존재하는 각 태스크의 우선순위를 순차적으로 조사하여, 상기 새로운 태스크의 우선순위보다 작은 우선순위를 갖는 태스크를 도출하는 단계일 수 있다. 즉, 준비 큐의 태스크들은 준비 큐내에 실행 우선순위가 큰 순서로 태스크들이 배치되어 있기 때문에, 큐의 앞에서부터 태스크들의 우선순위를 순차적으로 비교한 후, 새로운 태스크보다 우선 순위가 작은 태스크를 만나면 비교를 종료한다. The lower priority task deriving step S120 may be a step of sequentially examining the priority of each task existing in the preparation queue to derive a task having a priority lower than that of the new task. That is, since the tasks in the preparation queue are arranged in order of priority in the preparation queue in the preparation queue, the priority of the tasks is sequentially compared from the queue, and when the task is encountered with a task having a lower priority than the new task Lt; / RTI >

새로운 태스크 추가단계(S130)는 새로운 태스크보다 우선순위가 낮은 태스크의 앞에 새로운 태스크를 추가 배치하는 단계일 수 있다. 즉, 우선순위가 낮은 태스크 도출단계(S120)에서 새로운 태스크보다 우선순위가 낮은 것으로 비교된 태스크의 앞에 새로운 태스크가 추가된다.The new task addition step (S130) may be a step of additionally arranging a new task in front of the task having a lower priority than the new task. That is, in the low priority task deriving step S120, a new task is added before the compared task in which the priority is lower than that of the new task.

상술한 본 발명에 따른 태스크 배치방법에 따라, 준비 큐내의 태스크들은 우선순위가 큰 순서로 순차적으로 배치가 되어 있으므로, 다음에 실행될 태스크를 선택하는 경우, 스케줄러는 별도의 우선순위 확인 과정 없이 준비 큐의 앞에 있는 태스크부터 순차적으로 선택하면 된다.
According to the task arrangement method according to the present invention, the tasks in the preparation queue are sequentially arranged in order of decreasing priority. Therefore, in the case of selecting a task to be executed next, You can select the task in front of it.

도 3은 본 발명의 일 실시예에 따른 대기 큐에 태스크를 배치하는 예를 보여주는 블록도이다.3 is a block diagram illustrating an example of placing a task in a wait queue according to an embodiment of the present invention.

도3을 참조하면, 주기적인 태스크 또는 일정시간 동안 잠드는 상태의 태스크들은 대기 큐에서 관리될 수 있다. 이때 스케줄러는 대기(waiting) 상태의 각 태스크가 정해진 시간에 깨어날 수 있도록 관리를 해주면서, 대기 상태로 들어가는 태스크가 깨어날 시간이 정해져 있다면, 그 시간에 따라 대기큐 내의 태스크가 정렬되도록 할 수 있다.Referring to FIG. 3, periodic tasks or tasks in a sleeping state for a certain period of time can be managed in a wait queue. At this time, the scheduler manages each task in the waiting state to wake up at a predetermined time, and can arrange the tasks in the wait queue according to the time when the task entering the waiting state is determined.

도 3의 (a)는 태스크들이 대기 큐에 배치되어 있는 상태를 보여주며, 도 3의 (b)는 도 3의 (a)의 대기 큐에 새로운 태스크(330)가 추가된 상태를 보여준다.3 (a) shows a state in which tasks are arranged in a wait queue, and FIG. 3 (b) shows a state in which a new task 330 is added to the wait queue in FIG. 3 (a).

새로운 태스크(330)가 대기큐에 추가될 위치를 정하기 위해, 새로운 태스크(330)보다 깨어날 시간이 늦은 태스크가 나올 때까지, 대기 큐의 앞에서부터 차례대로 태스크들(310, 320, 340)을 검색한 후, 새로운 태스크(330)보다 더 늦게 깨어날 태스크6(340)의 앞에 새로운 태스크(330)를 추가할 수 있다.In order to determine the position where the new task 330 is to be added to the wait queue, the tasks 310, 320, and 340 are sequentially retrieved from the front of the wait queue until a task with a later time to wake up is found than the new task 330 A new task 330 may be added before task 6 340 to wake up later than new task 330. [

그러면 스케줄러는 매 타임 틱에 대기 큐의 제일 앞에 있는 태스크4(310)에 대해서만 깨어날 시간이 되었는지 확인하고, 태스크4(310)가 깨어날 시간이 된 경우 대기 큐에서 준비 큐로 옮기고 대기 큐의 다음 순서에 있는 태스크5(320)를 앞으로 당기면 된다. 이때, 깨어날 시간이 지정되지 않고 잠들어 있는 태스크는 대기 큐에서 관리되지 않는다.
Then, the scheduler checks every time tick to see if there is a time to wake up only to task 4 (310) in front of the waiting queue, and when task 4 (310) wakes up, it moves from the waiting queue to the preparation queue, Task 5 (320) is pushed forward. At this time, the sleeping time is not specified and the sleeping task is not managed in the waiting queue.

도 4는 본 발명의 일 실시예에 따른 대기 큐에 대기상태의 태스크를 배치하는 과정을 보여주는 순서도이다.4 is a flowchart illustrating a process of placing a task in a wait state in a wait queue according to an embodiment of the present invention.

도 4를 참조하면, 본 발명의 일 실시예에 따른 준비 큐에 실행 준비된 태스크를 배치하는 과정은 대기 상태에 진입한 태스크를 큐에 순차적으로 깨우기 위하여 대기 큐에 태스크를 배치하는 방법으로, 새로운 태스크의 깨어날 시간 확인단계(S410), 늦게 깨어날 태스크 도출단계(S420), 새로운 태스크 추가단계(S430)를 포함하여 구성될 수 있다.Referring to FIG. 4, a process of arranging a task ready for execution in a preparation queue according to an embodiment of the present invention is a method of placing a task in a waiting queue to sequentially wake up a task that enters a waiting state, A wake-up time confirmation step S410, a wake-up task step S420, and a new task addition step S430.

또한 도 4를 참조하면, 본 발명의 일 실시예에 따른 대기 큐에 대기상태의 태스크를 배치하는 과정의 각 단계는 다음과 같이 설명될 수 있다.Referring to FIG. 4, each step in the process of placing a waiting task in a waiting queue according to an embodiment of the present invention can be described as follows.

새로운 태스크의 깨어날 시간 확인단계(S410)는 새로운 태스크가 대기 상태로 진입하는 경우, 새로운 태스크가 대기 상태에서 벗어나서 깨어날 시간을 확인하는 단계일 수 있다.The step of confirming the wake time of the new task (S410) may be a step of confirming the time when the new task wakes up from the waiting state when the new task enters the waiting state.

늦게 깨어날 태스크 도출단계(S420)는 대기 큐에 존재하는 각 태스크가 대기 상태에서 벗어나서 깨어날 시간을 순차적으로 조사하여, 특정 태스크보다 깨어날 시간인 늦은 태스크를 도출하는 단계일 수 있다.In the step S420 of deriving a task to be woken up late, it may be a step of sequentially investigating the time at which each task existing in the waiting queue wakes up from the waiting state, and deriving a later task, which is the time to wake up, from the specific task.

즉, 대기 큐의 태스크들은 대기 큐내에 깨어날 시간이 빠른 순서로 태스크들이 배치되어 있기 때문에, 큐의 앞에서부터 태스크들의 깨어날 시간을 순차적으로 비교한 후, 새로운 태스크보다 늦게 깨어날 태스크를 만나면 비교를 종료한다. That is, since the tasks of the waiting queue are arranged in the order of the fastest time to wake up in the waiting queue, the wakeup time of the tasks is sequentially compared from the front of the queue, and the comparison is terminated when a task that wakes up later than the new task is encountered .

새로운 태스크 추가단계(S430)는 늦게 깨어날 태스크 도출단계(S420)에서 도출된 특정 태스크보다 깨어날 시간인 늦은 태스크의 앞에 새로운 태스크를 추가하는 단계일 수 있다.
The new task addition step S430 may be a step of adding a new task before a late task which is wake-up time than the specific task derived in the late-task deriving step S420.

이러한 스케줄링 방법은 태스크의 우선 순위가 수행 중 변경되는 경우에도 단순히 새로운 위치를 정해주기만 하면 되므로 적용하는 데에 문제가 없고, 우선 순위의 수에 따라 수행 시간이나 복잡도에 영향을 주지 않는다. 만일 라운드-로빈, FIFO 등의 방식으로 태스크가 관리될 필요가 있는 경우 새로운 태스크의 위치를 정하는 연산만 바꾸면 수행 중에도 변경이 가능하여 필요에 따라 유연하게 적용할 수 있다. 또한 이 방식은 스케줄링에 필요한 추가 메모리 공간을 거의 필요로 하지 않으면서도 새로운 태스크가 추가되지 않는 한 스케줄링이 연산이 거의 필요 없다는 장점이 있다. This scheduling method does not affect the execution time or the complexity according to the number of priorities because it is only required to set a new position even if the task priority is changed during execution. If a task needs to be managed by round-robin, FIFO, etc., it can be changed during execution by changing only the operation that determines the position of a new task, so that it can be flexibly applied as needed. This approach also has the advantage that there is little need for additional memory space required for scheduling, and there is little need for scheduling operations as long as no new tasks are added.

준비 큐 또는 대기 큐에 새로운 태스크가 추가될 때의 작업은 O(n)의 시간 복잡도를 가지지만 비행체에서 파티션된(partitioned) OS 를 사용한다고 가정할 때 운용 가능한 태스크의 개수는 한정되어 있으므로 실제 수행 시간에 미치는 영향은 미미하지만, 이에 비해 매 타임 틱마다 관찰해야 하는 태스크가 각 큐의 맨 앞에 있는 태스크에 한정되므로 얻는 시간적인 이득이 있다.
When the new task is added to the preparation queue or the waiting queue, the time complexity is O (n). However, since the number of operable tasks is limited when the partitioned OS is used, The time impact is minimal, but there is a time advantage to be gained because the task to be observed every tick is limited to the task at the head of each queue.

상기에서는 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다. It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit or scope of the present invention as defined by the following claims It can be understood that

Claims (10)

태스크를 스케줄링하는 운영 체제(operating system, OS)가 구동되는 태스크 처리 장치에서의 태스크 스케줄링 방법(preemptive task scheduling)에 있어서,
실행 준비상태에 있는 새로운 태스크의 실행 우선순위를 확인하는 단계;
준비 큐에 존재하는 각 태스크의 실행 우선순위를 상기 준비 큐의 가장 앞에서부터 순차적으로 검색하는 단계;
상기 새로운 태스크의 실행 우선순위보다 낮은 실행 우선순위를 갖는 태스크를 발견하면 상기 검색을 종료하는 단계; 및
상기 발견된 태스크의 바로 앞에 상기 새로운 태스크를 추가하는 단계를 포함하되,
상기 태스크 스케줄링 방법은 실시간 운영체제에 적용되는 것을 특징으로 하는, 태스크 스케줄링 방법.
A preemptive task scheduling method in a task processing apparatus in which an operating system (OS) for scheduling a task is run,
Confirming an execution priority of a new task in a ready state for execution;
Sequentially retrieving the execution priority of each task existing in the preparation queue from the front of the preparation queue;
Terminating the search if a task having an execution priority lower than the execution priority of the new task is found; And
And adding the new task immediately before the found task,
Wherein the task scheduling method is applied to a real-time operating system.
청구항 1에 있어서,
상기 새로운 태스크를 추가하는 단계 이후에,
실행중인 태스크가 종료되면, 상기 준비 큐의 가장 앞에 있는 태스크를 다음 실행할 태스크로 선택하는 단계를 더 포함하는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method according to claim 1,
After the step of adding the new task,
Further comprising the step of selecting, as the next task to be executed, the task at the head of the preparation queue when the task being executed is terminated.
청구항 1에 있어서,
상기 준비 큐는 하나만 존재하는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method according to claim 1,
Wherein only one of the preparation queues is present.
청구항 1에 있어서,
상기 태스크 스케줄링 방법은 임베디드 시스템에 적용되는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method according to claim 1,
Wherein the task scheduling method is applied to an embedded system.
청구항 1에 있어서,
상기 태스크 스케줄링 방법은 비행체의 파티션된(partitioned) OS 에 적용되는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method according to claim 1,
Wherein the task scheduling method is applied to a partitioned OS of an air vehicle.
태스크를 스케줄링하는 운영 체제(operating system, OS)가 구동되는 태스크 처리 장치에서의 태스크 스케줄링 방법에 있어서,
대기 상태로 진입한 새로운 태스크의 깨어날 시간을 확인하는 단계;
대기 큐에 존재하는 각 태스크의 깨어날 시간을 상기 대기 큐의 가장 앞에서부터 순차적으로 검색하는 단계;
상기 새로운 태스크의 깨어날 시간보다 늦게 깨어날 태스크를 발견하면 상기 검색을 종료하는 단계; 및
상기 발견된 태스크의 바로 앞에 상기 새로운 태스크를 추가하는 단계를 포함하되,
상기 태스크 스케줄링 방법은 실시간 운영체제에 적용되는 것을 특징으로 하는, 태스크 스케줄링 방법.
1. A task scheduling method in a task processing apparatus in which an operating system (OS) for scheduling a task is driven,
Confirming a wake-up time of a new task entering a waiting state;
Sequentially searching for the wakeup time of each task existing in the waiting queue from the front of the waiting queue;
Terminating the search if it finds a task to wake up later than the wakeup time of the new task; And
And adding the new task immediately before the found task,
Wherein the task scheduling method is applied to a real-time operating system.
청구항 6에 있어서,
새로운 태스크를 추가하는 단계 이후에,
매 타임 틱마다 상기 대기 큐의 제일 앞에 있는 태스크에 대해서 깨어날 시간이 되었는지 확인하고, 깨어날 시간이 된 경우에는 상기 제일 앞에 있는 태스크를 대기 큐에서 준비 큐로 옮기는 단계를 더 포함하는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method of claim 6,
After the step of adding a new task,
Further comprising the step of checking whether a time to awaken the task at the front of the waiting queue is reached every time tick, and if the time to wake up has been reached, moving the task from the waiting queue to the preparation queue. Scheduling method.
청구항 6에 있어서,
상기 대기 큐는 하나만 존재하는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method of claim 6,
Wherein only one of the wait queues is present.
청구항 6에 있어서,
상기 태스크 스케줄링 방법은 임베디드 시스템에 적용되는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method of claim 6,
Wherein the task scheduling method is applied to an embedded system.
청구항 6에 있어서,
상기 태스크 스케줄링 방법은 비행체의 파티션된(partitioned) OS 에 적용되는 것을 특징으로 하는, 태스크 스케줄링 방법.
The method of claim 6,
Wherein the task scheduling method is applied to a partitioned OS of an air vehicle.
KR1020120016133A 2012-02-17 2012-02-17 Tasks scheduling method for realtime operating system KR101725408B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020120016133A KR101725408B1 (en) 2012-02-17 2012-02-17 Tasks scheduling method for realtime operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020120016133A KR101725408B1 (en) 2012-02-17 2012-02-17 Tasks scheduling method for realtime operating system

Publications (2)

Publication Number Publication Date
KR20130094889A KR20130094889A (en) 2013-08-27
KR101725408B1 true KR101725408B1 (en) 2017-04-11

Family

ID=49218438

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020120016133A KR101725408B1 (en) 2012-02-17 2012-02-17 Tasks scheduling method for realtime operating system

Country Status (1)

Country Link
KR (1) KR101725408B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102169869B1 (en) * 2014-05-13 2020-10-27 한국전자통신연구원 Partition control apparatus and method of operating system
CN110737522B (en) * 2019-10-16 2023-03-03 福州物联网开放实验室有限公司 Standby task scheduling method of embedded operating system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060107264A1 (en) * 2004-11-18 2006-05-18 Hamilton Sundstrand Corporation Operating system and architecture for embedded system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6021425A (en) * 1992-04-03 2000-02-01 International Business Machines Corporation System and method for optimizing dispatch latency of tasks in a data processing system
JPH11203149A (en) * 1998-01-13 1999-07-30 Matsushita Electric Ind Co Ltd Device and method for scheduling task
KR101073428B1 (en) * 2008-11-27 2011-10-17 학교법인 동의학원 Method for scheduling task in embedded operating system of automobile

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060107264A1 (en) * 2004-11-18 2006-05-18 Hamilton Sundstrand Corporation Operating system and architecture for embedded system

Also Published As

Publication number Publication date
KR20130094889A (en) 2013-08-27

Similar Documents

Publication Publication Date Title
JP4694595B2 (en) Sleep queue management
Herman et al. RTOS support for multicore mixed-criticality systems
CN100504763C (en) Simultaneous multi-threaded (SMT) enabled system and its management method
US8423799B2 (en) Managing accelerators of a computing environment
CN102096603B (en) Task decomposition control method in MapReduce system and scheduling node equipment
US8141079B2 (en) Dynamic application scheduler in a polling system
US8607239B2 (en) Lock mechanism to reduce waiting of threads to access a shared resource by selectively granting access to a thread before an enqueued highest priority thread
US9858115B2 (en) Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core processor system and related non-transitory computer readable medium
EP1916601A2 (en) Multiprocessor system
US20010042090A1 (en) Thread based governor for time scheduled process application
US20150121387A1 (en) Task scheduling method for dispatching tasks based on computing power of different processor cores in heterogeneous multi-core system and related non-transitory computer readable medium
JP5347451B2 (en) Multiprocessor system, conflict avoidance program, and conflict avoidance method
US10248463B2 (en) Apparatus and method for managing a plurality of threads in an operating system
WO2012001835A1 (en) Multiprocessor system
CN106020984B (en) Method and device for creating process in electronic equipment
CN111078422A (en) Message processing method, message processing device, readable storage medium and electronic equipment
KR101725408B1 (en) Tasks scheduling method for realtime operating system
CN114116015B (en) Method and system for managing hardware command queue
CN114138341B (en) Micro instruction cache resource scheduling method, micro instruction cache resource scheduling device, program product and chip
US9058207B2 (en) Simulation apparatus, method, and computer-readable recording medium
KR101399758B1 (en) Apparatus and method for scheduling periods of tasks executed on multiple slave devices
JP2009048358A (en) Information processor and scheduling method
CN110837412B (en) Method, device, equipment and storage medium for judging operation ready state
KR20150130631A (en) Partition control apparatus and method of operating system
Lee et al. Interrupt handler migration and direct interrupt scheduling for rapid scheduling of interrupt-driven tasks

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