KR20040102835A - Method for communication of message queue in real time operating system - Google Patents

Method for communication of message queue in real time operating system Download PDF

Info

Publication number
KR20040102835A
KR20040102835A KR1020030034441A KR20030034441A KR20040102835A KR 20040102835 A KR20040102835 A KR 20040102835A KR 1020030034441 A KR1020030034441 A KR 1020030034441A KR 20030034441 A KR20030034441 A KR 20030034441A KR 20040102835 A KR20040102835 A KR 20040102835A
Authority
KR
South Korea
Prior art keywords
queue
message queue
message
data
pointer
Prior art date
Application number
KR1020030034441A
Other languages
Korean (ko)
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 KR1020030034441A priority Critical patent/KR20040102835A/en
Publication of KR20040102835A publication Critical patent/KR20040102835A/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/901Buffering arrangements using storage descriptor, e.g. read or write pointers

Abstract

PURPOSE: A message queue communication method in an RTOS(Real Time Operating System) is provided to guarantee always the same performance regardless of the amount of data in a transmission rate. CONSTITUTION: A region of a message queue(100) to be used for communication is created. In this case, a send task(200) obtains an address of an empty message queue pointer(110) by using a queue get. The content of data to be transmitted is directly written in a pointer region(210), and when the data is ready for transmission, it transmitted through a send process. A receiving task(300) receives the data through a receive process. A returned result value corresponds to an address of the message queue pointer(110) plus a size of the actually received data. The receiving task(300) uses the received data through a read process, and if the data is not necessary any longer, the receiving task(300) informs that the message queue pointer region(110) is not necessary any longer by using a queue free, and makes the region free for reuse.

Description

실시간 운영 시스템에서 메시지 큐 통신 방법{Method for communication of message queue in real time operating system}Method for communication of message queue in real time operating system

본 발명은 일반적인 실시간 운영 시스템(RTOS, Real Time Operating System)에서 제공되는 메시지 큐(Message Queue)를 사용한 통신 방법에서 메시지 전달 성능을 향상시키기 위하여 메모리 카피(Memory Copy) 과정 없이 동작할 수 있도록 한 실시간 운영 시스템에서 메시지 큐 통신 방법에 관한 것으로, 보다 상세하게는 포인터 연산에 의한 처리 개념을 도입하여 실제 메모리 카피 과정이 이루어지지 않도록 구현한 것으로, 이는 메시지 큐 전송(Message Queue Send) 과정 전에 비어있는 큐의 포인터를 받도록 함으로써, 전송하는 데이터를 직접 메시지 큐에 라이트(write)하도록 하고, 또한 메시지 큐 수신(Message Queue Receive)시에도 전달받은 큐의 포인터를 받도록 하여 메모리 카피 과정이 전혀 발생하지 않도록 함으로써, CPU의 수행시간의 대부분을 차지하는 부하를 줄일 수 있으며, 또한 데이터 양에 따라 저하되는 전송 속도에 있어서 데이터량에 상관없이 언제나 동일한 성능을 보장받을 수 있도록 한 실시간 운영 시스템에서 메모리 카피 과정을 생략한 메시지 큐 통신 방법에 관한 것이다.The present invention provides a real-time operation that can operate without a memory copy process in order to improve message delivery performance in a communication method using a message queue provided by a general real time operating system (RTOS). The method relates to the message queue communication method in the operating system. More specifically, it implements the concept of processing by pointer operation so that the actual memory copy process is not performed. It is an empty queue before the message queue send process. By receiving a pointer of, by writing the data to be sent directly to the message queue, and by receiving a pointer of the received queue at the time of Message Queue Receive, so that the memory copy process does not occur at all, To reduce the load that takes up most of the CPU's execution time. In addition, the present invention relates to a message queue communication method in which a memory copying process is omitted in a real-time operating system to ensure the same performance regardless of the amount of data at a transmission speed that decreases according to the amount of data.

일반적으로, 일반적인 운영 시스템(OS, Operating System)에서 사용되는 각프로세서간 통신 방법에는 공용 메모리(Shared Memory), 메시지 큐(Message Queue), 파이프(Pipes), 메일 박스(Mail Box) 등이 있다. 그리고 이동통신 프로그램에서는 여러 태스크(task) 간의 통신이 원활한 메시지 큐에 의한 통신 방법에 의해 대부분의 통신이 이루어지고 있다.In general, communication methods between processors used in a general operating system (OS) include shared memory, message queues, pipes, and mail boxes. In the mobile communication program, most communication is performed by a communication method using a message queue that facilitates communication between various tasks.

도 1은 일반적인 RTOS에서 지원하는 메시지 큐 통신 과정을 설명하기 위한 도면이다.1 is a diagram illustrating a message queue communication process supported by a general RTOS.

이에 도시된 바와 같이, 메시지 큐(Message Queue)에 의한 통신 방법은 메시지 큐 생성(create), 전송(send), 수신(receive), 삭제(delete)로 이루어진다.As shown therein, a communication method using a message queue includes a message queue, a message queue is created, a send, a receive, and a delete.

먼저, 상기 메시지 큐 생성 과정을 통하여 통신에 사용될 메시지 큐(10)를 생성한다. 이후, 데이터를 전송할 전송 태스크(send task)(20)는 로컬(local) 변수로 버퍼 영역을 확보한 다음 전송될 데이터를 버퍼(buffer)(21)에 라이트(write)한다.First, a message queue 10 to be used for communication is generated through the message queue creation process. Thereafter, the send task 20 to transmit data secures the buffer area with a local variable and then writes the data to be transmitted to the buffer 21.

한편, 상기에서 전송할 준비가 완료되면 전송(Message Queue Send)을 이용하여 메시지를 전송한다. 이때 상기한 과정에서 상기 버퍼(21)의 내용은 참조부호 11에 메모리 카피(Memory Copy)가 된다.Meanwhile, when the preparation for transmission is completed, the message is transmitted using a message queue send. At this time, the contents of the buffer 21 in the above process becomes a memory copy at 11.

상기에서와 같이 전송될 데이터들은 메시지 큐(10)에 차곡차곡 순차적으로 쌓이게 된다.As described above, the data to be transmitted are sequentially stacked in the message queue 10.

한편, 메시지를 받고자 하는 태스크(#0)는 우선 로컬 변수로 버퍼(31)의 메모리 공간을 확보한다. 이는 받고자 하는 데이터가 저장될 공간이다.On the other hand, the task (# 0) to receive the message first secures the memory space of the buffer 31 as a local variable. This is the space where the data you want to receive will be stored.

그런 다음 수신(Message Queue Receive)을 이용하여 메시지를 받을 준비를한다. 만약 메시지 큐(10)에 받을 데이터가 있을 경우에는 상기 수신 과정에서 메모리 카피를 통하여 버퍼(31)에 저장된다.Then use the Message Queue Receive to prepare to receive the message. If there is data to be received in the message queue 10, it is stored in the buffer 31 through a memory copy in the receiving process.

상기한 바와 같은 메시지 큐에 의한 통신 방법은, 전송(send), 수신(receive)시 해당 데이터만큼의 메모리 카피 과정이 존재하게 된다.In the communication method using the message queue as described above, a memory copy process corresponding to the corresponding data is present at the time of send and receive.

따라서, 메모리 카피 과정에 의해 전송하고자 하는 데이터량에 따라 속도가 저하되는 문제점이 발생하였으며, 이로 인한 시스템 전체의 성능 저하를 초래하는 문제점이 있었다.Therefore, a problem occurs that the speed decreases according to the amount of data to be transferred by the memory copy process, which causes a problem of degrading the performance of the entire system.

이에 본 발명은 상기와 같은 종래 기술의 제반 문제점을 해결하기 위해서 제안된 것으로서,Accordingly, the present invention is proposed to solve the above problems of the prior art,

본 발명의 목적은 메시지 큐 전송(Message Queue Send) 과정 전에 비어있는 큐의 포인터를 받도록 함으로써, 전송하는 데이터를 직접 메시지 큐에 라이트(write)하도록 하고, 또한 메시지 큐 수신(Message Queue Receive)시에도 전달받은 큐의 포인터를 받도록 하여 메모리 카피 과정이 전혀 발생하지 않도록 함으로써, CPU의 수행시간의 대부분을 차지하는 부하를 줄일 수 있으며, 또한 데이터 양에 따라 저하되는 전송 속도에 있어서 데이터량에 상관없이 언제나 동일한 성능을 보장받을 수 있도록 한 실시간 운영 시스템에서 메시지 큐 통신 방법을 제공하는 데 있다.It is an object of the present invention to receive a pointer to an empty queue before a Message Queue Send process, so that the data to be sent can be written directly to the Message Queue, and at the time of Message Queue Receive. By receiving the pointer of the received queue so that the memory copy process does not occur at all, the load that takes up the most of the CPU's execution time can be reduced, and the data rate is always the same regardless of the amount of data. It is to provide a message queue communication method in a real-time operating system to ensure performance.

상기와 같은 목적을 달성하기 위한 본 발명에 따른 실시간 운영 시스템(RealTime Operating System)에서 메시지 큐(Message Queue) 통신 방법에 있어서,In the message queue communication method in a real-time operating system (RealTime Operating System) according to the present invention for achieving the above object,

메시지 큐 생성(Message Queue Create)을 통하여 통신에서 사용될 메시지 큐 영역을 생성(create)하는 과정과,Creating a message queue area to be used for communication through Message Queue Create;

상기 메시지 큐 생성 후, 전송 태스크(send task)에서 큐 겟(queue get)을 사용하여 비어있는 메시지 큐 포인터 주소를 획득하는 과정과,After the message queue is created, acquiring an empty message queue pointer address using a queue get in a send task;

상기 주소 획득 후, 전송되어질 데이터의 내용을 상기 포인터 영역에 직접 라이트한 후, 데이터를 전송할 준비가 완료되었으면 전송(send) 과정을 사용하여 데이터를 전송하는 과정과,After acquiring the address, writing the content of the data to be transmitted directly to the pointer area, and if the data is ready to be transmitted, transmitting data using a send process;

상기 데이터가 전송되면, 메시지를 받고자 하는 태스크에서 수신(receive) 과정을 통하여 데이터를 직접 수신하는 과정과,When the data is transmitted, receiving data directly through a receiving process in a task to receive a message;

상기 수신 태스크(receive task)에서 상기 전송받은 데이터를 리드(read) 과정을 통하여 사용하는 과정과,Using the received data in the receive task through a read process;

상기 데이터 사용 후, 필요 없을 경우 큐 프리(queue free)를 사용하여 메시지 큐 포인터 영역이 필요 없음을 알린 후, 상기 영역의 재사용 위해 프리(free) 시키는 과정으로 구성됨을 그 방법적 구성상의 특징으로 한다.After using the data, it is characterized in that the method consists of a process of freeing the area for reuse of the message after notifying that the message queue pointer area is not necessary by using queue free. .

도 1은 일반적인 RTOS에서 지원하는 메시지 큐 통신 과정을 설명하기 위한 도면이고,1 is a diagram illustrating a message queue communication process supported by a general RTOS.

도 2는 본 발명에 의한 RTOS에서 지원하는 메시지 큐 통신 과정을 설명하기 위한 도면이고,2 is a view illustrating a message queue communication process supported by the RTOS according to the present invention;

도 3은 본 발명에 의한 메시지 큐 통신 과정에서 메시지 큐 생성(create) 과정을 나타낸 흐름도이고,3 is a flowchart illustrating a message queue creation process in a message queue communication process according to the present invention;

도 4는 본 발명에 의한 메시지 큐 통신 과정에서 메시지 큐 전송(send) 과정을 나타낸 흐름도이고,4 is a flowchart illustrating a message queue send process in a message queue communication process according to the present invention;

도 5는 본 발명에 의한 메시지 큐 통신 과정에서 메시지 큐 수신(receive) 과정을 나타낸 흐름도이다.5 is a flowchart illustrating a message queue receiving process in a message queue communication process according to the present invention.

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

100 ..... 메시지 큐(Message Queue)100 ..... Message Queue

200 ..... 전송 태스크(Send Task)200 ..... Send Task

300 ..... 수신 태스크(Receive Task)300 ..... Receive Task

210, 310 ..... 메시지 큐 포인터(Message Queue Pointer)210, 310 ..... Message Queue Pointer

이하, 상기와 같은 기술적 사상에 따른 본 발명의 「실시간 운영 시스템에서 메시지 큐 통신 방법」의 바람직한 실시 예를 첨부된 도면에 의거 상세히 설명하면 다음과 같다.Hereinafter, a preferred embodiment of the "message queue communication method in a real-time operating system" of the present invention according to the above technical concept will be described in detail with reference to the accompanying drawings.

도 2는 본 발명에 의한 RTOS에서 지원하는 메시지 큐 통신 과정을 설명하기 위한 도면이다.2 is a diagram illustrating a message queue communication process supported by the RTOS according to the present invention.

이에 도시된 바와 같이, 본 발명에 의한 메시지 큐 통신 방법은 큐 겟(Queue Get)과 큐 프리(Queue Free)의 과정이 추가되며, 여기서 상기 큐 겟을 통하여 사용할 수 있는 메시지 큐 포인터(Message Queue Pointer), 즉 주소를 알 수가 있으므로, 상기한 첨부한 도면 도 1의 버퍼(21) 영역을 따로 할당하고 메모리 카피 과정 없이 직접 포인터(210) 영역에 라이트할 수 있게 된다. 여기서, 상기 포인터(210) 영역은 메시지 큐(100)의 참조부호 110의 영역과 동일한 영역이다.As shown in the figure, in the message queue communication method according to the present invention, a process of queue get and queue free is added, and a message queue pointer usable through the queue get. In other words, since the address can be known, the buffer 21 region of FIG. 1 can be allocated separately and can be written directly to the pointer 210 region without a memory copy process. Here, the pointer 210 area is the same area as that of the reference numeral 110 of the message queue 100.

그리고, 수신 태스크(receive task)(300)에서 상기 영역(110)의 사용이 종료되고 다른 전송 태스크(send task)가 재사용 할 수 있도록 하기 위하여 수신 태스크(300)는 최종적으로 큐 프리 과정을 수행해 준다.In addition, the reception task 300 finally performs a queue-free process so that the use of the area 110 is terminated in the receive task 300 and other send tasks can be reused. .

상기한 바와 같은 구성을 통해 전체적인 동작을 살펴보면 다음과 같다.Looking at the overall operation through the configuration as described above are as follows.

먼저, 메시지 큐 생성(Message Queue Create)을 통하여 통신에서 사용될 메시지 큐(100) 영역을 생성한다. 이때 전송 태스크(send task)(200)는 큐 겟(queue get)을 사용하여 비어있는 메시지 큐 포인터(110) 주소를 얻어온다.First, an area of the message queue 100 to be used in communication is created through message queue creation. At this time, the send task 200 obtains an empty message queue pointer 110 address using a queue get.

그런 다음, 전송되어질 데이터의 내용을 포인터 영역(210)에 직접 라이트하고, 이후 데이터를 전송할 준비가 완료되었으면 전송(send) 과정을 사용하여 데이터를 전송한다.Then, the contents of the data to be transmitted are written directly to the pointer area 210, and after the data is ready to be transmitted, data is transmitted using a send process.

한편, 메시지를 받고자 하는 태스크(300)는 수신(receive) 과정을 통하여 데이터를 전송받는다.Meanwhile, the task 300 to receive a message receives data through a receive process.

그러나, 첨부한 도면 도 1에 나타낸 종래 방법에서와 같이 로컬 영역(첨부 도면 도 1의 버퍼(31))를 만들 필요 없이 직접 수신(receive)을 사용한다.However, as in the conventional method shown in FIG. 1 of the accompanying drawings, direct reception is used without having to make a local area (buffer 31 of FIG. 1 of the accompanying drawings).

이때, 리턴되는 결과값은 메시지 큐 포인터(110) 주소와 실제로 전송받은 데이터 크기(data size)가 된다.At this time, the result returned is the message queue pointer 110 address and the data size actually received.

다음으로, 수신 태스크(receive task)(300)는 상기 전송받은 데이터를 리드(read) 과정을 통하여 사용한 다음 더이상 필요가 없을 경우에는 큐 프리(queue free)를 사용하여 더이상 메시지 큐 포인터 영역(110)이 필요 없음을 알리고 이 영역을 재사용 가능하도록 프리(free) 시킨다.Next, the receive task 300 uses the received data through a read process and then uses queue free when no longer needed, so that the message queue pointer area 110 may be no longer used. Notify this need and free this area for reuse.

여기서, 상술한 바와 같은 본 발명에 의한 메시지 큐 생성, 전송, 수신 과정을 좀 더 상세하게 살펴보면 아래와 같다.Here, the message queue generation, transmission, and reception process according to the present invention as described above will be described in more detail.

상기한 바와 같은 구성을 통해 전체적인 동작을 살펴보면 다음과 같다.Looking at the overall operation through the configuration as described above are as follows.

도 3은 본 발명에 의한 메시지 큐 통신 과정에서 메시지 큐 생성(create) 과정을 나타낸 흐름도이다.3 is a flowchart illustrating a message queue creation process in a message queue communication process according to the present invention.

이에 도시된 바와 같이, 필요한 메시지 크기(Message Size)와 개수가 입력(ST101)되면, 요구되는 메모리 크기를 계산하는 단계(ST102)와, 상기 메모리 크기 계산 후, 메모리가 존재하는지 체크하는 단계(ST103)와, 상기 체크결과 메모리가 존재하지 않는 경우 에러 값을 출력한 후 리턴하고, 상기 체크결과 메모리가 존재하는 경우 메모리를 할당하는 단계(ST105)와, 상기 메모리 할당 후, 세마포어(Semaphore, 멀티태스크 OS에서 태스크간의 동기나 배타 제어에 사용되는 변수)를 생성하는 단계(ST106)와, 상기 세마포어가 정상적으로 생성되었는지 확인하는 단계(ST107)와, 상기 결과 세마포어가 생성되지 않은 경우 에러 값을 출력한 후 리턴하고, 상기 세마포어가 생성된 경우 메시지 큐 생성 과정을 종료하는 단계로 이루어진다.As shown therein, when the required message size and number are input (ST101), calculating a required memory size (ST102), and after calculating the memory size, checking whether a memory exists (ST103). And, if the check result memory does not exist, outputs an error value and returns it, and if the check result memory exists, allocating memory (ST105), and after the memory allocation, a semaphore (Semaphore, multitask) Generating a variable used for synchronization or exclusive control between tasks in the OS (ST106), checking whether the semaphore is generated normally (ST107), and outputting an error value if the semaphore is not generated as a result. When the semaphore is generated, the process returns to the step of terminating the message queue creation process.

도 4는 본 발명에 의한 메시지 큐 통신 과정에서 메지지 큐 전송(send) 과정을 나타낸 흐름도이다.4 is a flowchart illustrating a message queue send process in the message queue communication process according to the present invention.

이에 도시된 바와 같이, 메시지 큐(Message Queue)의 상태를 검사(ST201)하여 큐가 비어 있는지 체크하는 단계(ST202)와, 상기 체크결과 큐가 비어있지 않은 경우 에러 값을 출력한 후 리턴(ST203)하고, 상기 체크결과 큐가 비어있는 경우 큐를 할당하는 단계(ST204)와, 상기 큐 할당 후, 할당된 큐의 포인터를 리턴하는 단계(ST205)와, 상기 리턴 후, 전송된 데이터를 라이트(write)하는 단계(ST206)와, 상기 데이터 라이트 후, 수신(receive)할 태스크가 존재하는지 확인하는 단계(ST207)와, 상기 확인결과 수신 태스크가 존재하지 않는 경우 메시지 전송 넘버 카운트(Message Send Number Count)를 증가시키는 단계(ST208)와, 상기 확인결과 수신 태스크가 존재하는 경우 세마포어를 기브(give)하는 단계(ST209)와, 상기 세마포어 기브 후, 메시지 수신 넘버 카운트(Message Receive Number Count)를 감소(ST210)시킨 후 메시지 큐 전송 과정을 종료하는 단계로 이루어진다.As shown in the drawing, the state of the message queue is checked (ST201) to check whether the queue is empty (ST202), and if the check result is not empty, the error value is output and returned (ST203). Assigning a queue when the check result queue is empty (ST204), returning a pointer of the allocated queue after assigning the queue (ST205), and writing the transmitted data after the return (ST205). a step of writing (ST206), a step of checking whether there is a task to receive after the data is written (ST207), and a message send number count if the check result does not exist ) Increase the step ST208, give the semaphore if the check result reception task exists (ST209), and decrease the message receive number count after the semaphore give ( S T210) and then terminating the message queue transmission process.

도 5는 본 발명에 의한 메시지 큐 통신 과정에서 메시지 큐 수신(receive) 과정을 나타낸 흐름도이다.5 is a flowchart illustrating a message queue receiving process in a message queue communication process according to the present invention.

이에 도시된 바와 같이, 메시지 큐의 상태를 검사(ST301)하여 큐가 비어 있는지 체크하는 단계(ST302)와, 상기 체크결과 큐가 비어있는 경우 세마포어를 테이크(take)(ST303)하고, 상기 체크결과 큐가 비어있지 않는 경우 메시지 전송 넘버 카운트(Message Send Number Count)를 감소시키는 단계(ST304)와, 상기 감소 후, 전달받은 큐의 포인터를 리턴하는 단계(ST305)와, 상기 리턴 후, 전송된 데이터를 리드(read)하는 단계(ST306)와, 상기 할당되었던 큐의 자원을 해제(ST307) 후 메시지 큐 수신 과정을 종료하는 단계로 이루어진다.As shown therein, the state of the message queue is checked (ST301) to check whether the queue is empty (ST302), and if the check result queue is empty, the semaphore is taken (ST303), and the check result Decrementing the message send number count when the queue is not empty (ST304), returning a pointer of the received queue after the decrement (ST305), and transmitting the data after the return Reading (ST306), releasing the resources of the allocated queue (ST307) and ending the message queue receiving process.

상술한 바와 같이 본 발명의 상세한 설명에서는 실시간 운영 시스템에서 메시지 큐 통신 방법에 대한 구체적인 실시 예에 대하여 설명하도록 하지만, 본 발명은 본 발명의 범위에서 벗어나지 않는 한도 내에서 여러 가지 변형이 가능하다. 그러므로 본 발명의 범위는 설명된 실시 예에 국한되어 정해져서는 안되며, 후술되는 특허청구범위뿐 아니라 이 특허 청구의 범위와 균등한 것들에 의해 정해져야 한다.As described above, in the detailed description of the present invention, specific embodiments of the message queue communication method in the real-time operating system will be described. However, the present invention may be modified in various ways without departing from the scope of the present invention. Therefore, the scope of the present invention should not be limited to the described embodiments, but should be determined not only by the claims below but also by the equivalents of the claims.

이상에서 상술한 본 발명 "실시간 운영 시스템에서 메시지 큐 통신 방법"에 따르면,According to the present invention "message queue communication method in a real-time operating system" described above,

메시지 큐 전송(Message Queue Send) 과정 전에 비어있는 큐의 포인터를 받도록 함으로써, 전송하는 데이터를 직접 메시지 큐에 라이트(write)하도록 하고, 또한 메시지 큐 수신(Message Queue Receive)시에도 전달받은 큐의 포인터를 받도록 하여 메모리 카피 과정이 전혀 발생하지 않도록 함으로써, CPU의 수행시간의 대부분을 차지하는 부하를 줄일 수 있으며, 또한 데이터 양에 따라 저하되는 전송 속도에 있어서 데이터량에 상관없이 언제나 동일한 성능을 보장받을 수 있는 이점을가진다.By receiving a pointer to an empty queue before the Message Queue Send process, it allows the data to be sent to be written directly to the Message Queue, and also a pointer to the queue that was received during Message Queue Receive. By avoiding the memory copying process at all, the load that takes up the most of the CPU's execution time can be reduced, and the same performance can be guaranteed at all times regardless of the amount of data in terms of the transfer rate that is reduced by the amount of data. Has the advantage.

또한, 본 발명은 메시지 큐를 통한 통신 방법 과정에서 메모리 카피 과정을 생략하므로써, 이동통신 시스템처럼 메시지 큐를 빈번하게 사용하는 시스템에서 성능 개선 효과를 기대할 수 있는 이점을 가진다.In addition, the present invention has the advantage that the performance improvement effect can be expected in a system that frequently uses the message queue, such as a mobile communication system by omitting the memory copy process in the communication method process through the message queue.

Claims (4)

실시간 운영 시스템(Real Time Operating System)에서 메시지 큐(Message Queue) 통신 방법에 있어서,In a message queue communication method in a real time operating system, 메시지 큐 생성(Message Queue Create)을 통하여 통신에서 사용될 메시지 큐 영역을 생성(create)하는 과정과;Creating a message queue area to be used in communication through Message Queue Create; 상기 메시지 큐 생성 후, 전송 태스크(send task)에서 큐 겟(queue get)을 사용하여 비어있는 메시지 큐 포인터 주소를 획득하는 과정과;After the message queue is created, acquiring an empty message queue pointer address using a queue get in a send task; 상기 주소 획득 후, 전송되어질 데이터의 내용을 상기 포인터 영역에 직접 라이트한 후, 데이터를 전송할 준비가 완료되었으면 전송(send) 과정을 사용하여 데이터를 전송하는 과정과;After the address is obtained, writing the contents of the data to be transmitted directly to the pointer area, and transmitting data using a send process when the data is ready to be transmitted; 상기 데이터가 전송되면, 메시지를 받고자 하는 태스크에서 수신(receive) 과정을 통하여 데이터를 직접 수신하는 과정과;When the data is transmitted, receiving data directly through a receiving process in a task to receive a message; 상기 수신 태스크(receive task)에서 상기 전송받은 데이터를 리드(read) 과정을 통하여 사용하는 과정과;Using the received data in a receive task through a read process; 상기 데이터 사용 후, 필요 없을 경우 큐 프리(queue free)를 사용하여 메시지 큐 포인터 영역이 필요 없음을 알린 후, 상기 영역의 재사용 위해 프리(free) 시키는 과정을 포함하여 이루어진 것을 특징으로 하는 실시간 운영 시스템에서 메시지 큐 통신 방법.After using the data, if it is not necessary, using a queue free (queue free) using the message queue pointer area is not necessary, and the real-time operating system comprising the step of freeing for reuse of the area To communicate with Message Queuing in Windows. 제 1 항에 있어서, 상기 메시지 큐 생성(create) 과정은,The method of claim 1, wherein the process of creating a message queue comprises: 필요한 메시지 크기(Message Size)와 개수가 입력되면, 요구되는 메모리 크기를 계산하는 단계와;Calculating a required memory size if a required message size and number are input; 상기 메모리 크기 계산 후, 메모리가 존재하는지 체크하는 단계와;After calculating the memory size, checking whether a memory exists; 상기 체크결과 메모리가 존재하지 않는 경우 에러 값을 출력한 후 리턴하고, 상기 체크결과 메모리가 존재하는 경우 메모리를 할당하는 단계와;Outputting an error value if the memory does not exist and returning the result, and allocating the memory if the memory exists; 상기 메모리 할당 후, 세마포어(Semaphore)를 생성하고, 상기 세마포어가 정상적으로 생성되었는지 확인하는 단계와;Generating a semaphore after the memory allocation, and checking whether the semaphore is normally generated; 상기 결과 세마포어가 생성되지 않은 경우 에러 값을 출력한 후 리턴하고, 상기 세마포어가 생성된 경우 메시지 큐 생성 과정을 종료하는 단계를 포함하여 이루어진 것을 특징으로 하는 실시간 운영 시스템에서 메시지 큐 통신 방법.And outputting an error value when the semaphore is not generated, and ending the message queue generation process when the semaphore is generated. 제 1 항에 있어서, 상기 메시지 큐 전송(send) 과정은,The method of claim 1, wherein the message queue send process comprises: 메시지 큐(Message Queue)의 상태를 검사하여 큐가 비어 있는지 체크하는 단계와;Checking the status of the message queue to check if the queue is empty; 상기 체크결과 큐가 비어있지 않은 경우 에러 값을 출력한 후 리턴하고, 상기 체크결과 큐가 비어있는 경우 큐를 할당하는 단계와;Outputting and returning an error value if the queue is not empty and assigning a queue if the queue is empty; 상기 큐 할당 후, 할당된 큐의 포인터를 리턴하고, 이후 전송된 데이터를 라이트(write)하는 단계와;After assigning the queue, returning a pointer of the allocated queue, and then writing the transmitted data; 상기 데이터 라이트 후, 수신(receive)할 태스크가 존재하는지 확인하는 단계와;After writing the data, checking whether there is a task to receive; 상기 확인결과 수신 태스크가 존재하지 않는 경우 메시지 전송 넘버 카운트(Message Send Number Count)를 증가시키는 단계와;Increasing a Message Send Number Count when there is no receiving task as a result of the checking; 상기 확인결과 수신 태스크가 존재하는 경우 세마포어를 기브(give)하는 단계와;Giving a semaphore if there is a receiving task as a result of the checking; 상기 세마포어 기브 후, 메시지 수신 넘버 카운트(Message Receive Number Count)를 감소시킨 후 메시지 큐 전송 과정을 종료하는 단계를 포함하여 이루어진 것을 특징으로 하는 실시간 운영 시스템에서 메시지 큐 통신 방법.And after the semaphore gib, reducing the message reception number count and terminating the message queue transmission process. 제 1 항에 있어서, 상기 메시지 큐 수신(receive) 과정은,The method of claim 1, wherein the message queue receiving process comprises: 메시지 큐의 상태를 검사하여 큐가 비어 있는지 체크하는 단계와;Checking the status of the message queue to check if the queue is empty; 상기 체크결과 큐가 비어있는 경우 세마포어를 테이크(take)하고, 상기 체크결과 큐가 비어있지 않는 경우 메시지 전송 넘버 카운트(Message Send Number Count)를 감소시키는 단계와;Taking a semaphore when the check result queue is empty, and decreasing a message send number count when the check result queue is not empty; 상기 감소 후, 전달받은 큐의 포인터를 리턴하고, 이후 전송된 데이터를 리드(read)하는 단계와;After the reduction, returning a pointer of the received queue, and then reading the transmitted data; 상기 할당되었던 큐의 자원을 해제 후 메시지 큐 수신 과정을 종료하는 단계를 포함하여 이루어진 것을 특징으로 하는 실시간 운영 시스템에서 메시지 큐 통신 방법.Message queue communication method in a real-time operating system comprising the step of releasing the message queue receiving process after releasing the allocated resources of the queue.
KR1020030034441A 2003-05-29 2003-05-29 Method for communication of message queue in real time operating system KR20040102835A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030034441A KR20040102835A (en) 2003-05-29 2003-05-29 Method for communication of message queue in real time operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030034441A KR20040102835A (en) 2003-05-29 2003-05-29 Method for communication of message queue in real time operating system

Publications (1)

Publication Number Publication Date
KR20040102835A true KR20040102835A (en) 2004-12-08

Family

ID=37379038

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030034441A KR20040102835A (en) 2003-05-29 2003-05-29 Method for communication of message queue in real time operating system

Country Status (1)

Country Link
KR (1) KR20040102835A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008106893A1 (en) * 2007-03-07 2008-09-12 Huawei Technologies Co., Ltd. Method for receiving message fragment of multilink ppp and device thereof
CN104022963A (en) * 2014-01-02 2014-09-03 烽火通信科技股份有限公司 A communication method and device with a plurality of communication modes coexisting
CN113608883A (en) * 2021-06-21 2021-11-05 天津津航计算技术研究所 Packaging method based on VxWorks real-time operating system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008106893A1 (en) * 2007-03-07 2008-09-12 Huawei Technologies Co., Ltd. Method for receiving message fragment of multilink ppp and device thereof
CN104022963A (en) * 2014-01-02 2014-09-03 烽火通信科技股份有限公司 A communication method and device with a plurality of communication modes coexisting
CN104022963B (en) * 2014-01-02 2017-06-13 烽火通信科技股份有限公司 Communication and the communication means and device deposited
CN113608883A (en) * 2021-06-21 2021-11-05 天津津航计算技术研究所 Packaging method based on VxWorks real-time operating system
CN113608883B (en) * 2021-06-21 2024-02-13 天津津航计算技术研究所 Encapsulation method based on VxWorks real-time operating system

Similar Documents

Publication Publication Date Title
US20180375782A1 (en) Data buffering
CN109726163B (en) SPI-based communication system, method, equipment and storage medium
CN113742269B (en) Data transmission method, processing device and medium for EPA device
US6526068B2 (en) Interface control of communication between a control processor and a digital signal processor
CN112698959A (en) Multi-core communication method and device
CN112214240A (en) Executing device and method for host computer output and input command and computer readable storage medium
US10489322B2 (en) Apparatus and method to improve performance in DMA transfer of data
US20150074316A1 (en) Reflective memory bridge for external computing nodes
CN110046114B (en) DMA controller based on PCIE protocol and DMA data transmission method
US7216186B2 (en) Controlling data flow between processor systems
CN108958903B (en) Embedded multi-core central processor task scheduling method and device
CN112506676A (en) Inter-process data transmission method, computer device and storage medium
KR20040102835A (en) Method for communication of message queue in real time operating system
US6535942B1 (en) Method for reducing processor interrupt load
US10318424B2 (en) Information processing device
US20030005071A1 (en) Inter-processor communication system and method
US7350053B1 (en) Software accessible fast VA to PA translation
CN108958905B (en) Lightweight operating system of embedded multi-core central processing unit
KR100898345B1 (en) Packet receiver hardware apparatus for tcp offload engine and system and method based on ??? packet receive hardware
KR20150048028A (en) Managing Data Transfer
JP7363344B2 (en) Memory control device and control method
US11775360B2 (en) Cache-based communication for trusted execution environments
CN111124987B (en) PCIE-based data transmission control system and method
WO2023207456A1 (en) Command transmission method and apparatus
JP3058010B2 (en) Method and apparatus for communication between processors

Legal Events

Date Code Title Description
N231 Notification of change of applicant
WITN Application deemed withdrawn, e.g. because no request for examination was filed or no examination fee was paid