KR19990058887A - Process control method that acts as a parent or child process by configuration of different processes - Google Patents

Process control method that acts as a parent or child process by configuration of different processes Download PDF

Info

Publication number
KR19990058887A
KR19990058887A KR1019970079061A KR19970079061A KR19990058887A KR 19990058887 A KR19990058887 A KR 19990058887A KR 1019970079061 A KR1019970079061 A KR 1019970079061A KR 19970079061 A KR19970079061 A KR 19970079061A KR 19990058887 A KR19990058887 A KR 19990058887A
Authority
KR
South Korea
Prior art keywords
child
parent
work
different processes
control method
Prior art date
Application number
KR1019970079061A
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 KR1019970079061A priority Critical patent/KR19990058887A/en
Publication of KR19990058887A publication Critical patent/KR19990058887A/en

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

본 발명은 멀티 프로세스(Multi-Process)가 지원되는 UNIX 시스템에서의 프로그램 방법에 관한 것으로서 부모와 자식간의 관계로 구성되어져야 하는 프로세스들을 여러 가지 이유로 인하여 서로 다른 프로세스로 구성하였을 경우, 자식 프로세스 역할을 하는 프로세스를 통제하는 방법에 관한 것이다.The present invention relates to a program method in a UNIX system that supports multi-process. When the processes that should be configured in a relationship between a parent and a child are configured as different processes for various reasons, they serve as child processes. It is about how to control the process.

본 발명의 서로 다른 프로세스로 구성되어 부모 프로세스 역할을 수행하는 프로세스 통제 방법은, 부모-자식 프로세스 구조를 사용하지 못하는 경우에 있어서, 공유 메모리를 처음 읽어 자식 역할을 수행하는 프로세스가 동작중인지 검사하는 단계, 만일 상기 프로세스가 동작중이면 각 변수들에 저장하는 단계, 자식 역할을 수행하는 프로세스로부터 메시지가 도착하였는지 검사하는 단계, 상기 메시지가 도착하였다면 해당 변수에 저장하고, 그렇지 않으면 작업할 내용이 있는지 검사하는 단계, 최대 작업 수행 시간을 계산하여 작업 지시를 하는 단계 및 만일 상기 최대 작업 시간내에 작업 완료 결과가 전달되지 않으면 자식 프로세스를 소멸시키고 새로 초기화하는 단계를 포함한다.Process control method consisting of different processes of the present invention to act as a parent process, in the case that the parent-child process structure is not used, the step of checking whether the process of performing the child role is first read by reading the shared memory If the process is running, storing in each variable, checking if a message has arrived from the process acting as a child, if the message has arrived, storing it in that variable, otherwise checking if there is work to do Performing a work instruction by calculating a maximum work execution time, and destroying and reinitializing a child process if a work completion result is not delivered within the maximum work time.

본 발명에 의한 서로 다른 프로세스로 구성되어 자식 프로세스 역할을 수행하는 프로세스 통제 방법은, 부모-자식 프로세스 구조를 사용하지 못하는 경우에 있어서, 공유 메모리에 자신의 PID를 등록하는 단계, 초기화 작업을 시도하는 단계, 부모 프로세스로부터 작업 지시 명령을 받으면 이를 수행하고 결과를 보고하는 단계를 포함한다.Process control method consisting of different processes according to the present invention to perform the role of a child process, in the case of not using a parent-child process structure, the step of registering its PID in the shared memory, attempt to initialize Step, when the work order command is received from the parent process, the step of reporting the result.

본 발명은, 자식 프로세스를 생성하기 위한 시간, 또는 과부하가 클 경우 부모-자식 프로세스 구조를 사용하지 않고 서로 다른 프로세스로 구성하여, 효율적으로 자원을 사용할 수 있는 특성을 향상시킬 수 있다.The present invention can improve the characteristics of using resources efficiently by configuring different processes without using a parent-child process structure when the time for generating a child process or overload is large.

Description

서로 다른 프로세스의 구성에 의한 부모 또는 자식 프로세스 역할을 하는 프로세스 통제 방법Process control method that acts as a parent or child process by configuration of different processes

본 발명은 멀티 프로세스(Multi-Process)가 지원되는 UNIX 시스템에서의 프로그램 방법에 관한 것으로서 부모와 자식간의 관계로 구성되어져야 하는 프로세스들을 여러 가지 이유로 인하여 서로 다른 프로세스로 구성하였을 경우, 자식 프로세스 역할을 하는 프로세스를 통제하는 방법에 관한 것이다.The present invention relates to a program method in a UNIX system that supports multi-process. When the processes that should be configured in a relationship between a parent and a child are configured as different processes for various reasons, they serve as child processes. It is about how to control the process.

UNIX 시스템에서는 일반적으로 특정 목적을 수행하기 위하여 프로세스가 오직 하나만 살아서 대기하고 있다가 특정 동작을 수행할 때에는 자식 프로세스를 만들어 수행한다.In a UNIX system, there is usually only one live process waiting for a particular purpose. When a particular operation is performed, a child process is created and executed.

부모와 자식간의 프로세스 구조로 구성하였을 때의 가장 큰 이점이 부모 프로세스가 자식 프로세스를 작업이 필요한 경우에만 살릴 수 있고, 자식의 동작이 비정상적인 경우는 자식 프로세스를 죽이고 새로 살릴 수 있어 작업의 효율을 높이고 불필요한 메모리 낭비를 줄이는 것이다.The biggest advantage of constructing a process structure between parent and child is that the parent process can save the child process only when it needs to work, and if the child's behavior is abnormal, it can kill the child process and revive it to increase the work efficiency. To reduce unnecessary memory waste.

자식 프로세스는 그 특정 작업이 끝난 후 자동으로 종료가 되며, 그 자식 프로세스를 생성한 부모 프로세스는 종료 메시지를 받은 후 다시 대기 상태로 들어간다.The child process is automatically terminated after the specific task is finished, and the parent process that created the child process receives the termination message and then resumes waiting.

이런 식으로 프로세스를 구성하는 이유는 동시에 다수의 작업을 할 수 있도록 하기 위해서이다. 그러나 상황에 따라서는 그렇게 구성하지 못할 경우가 발생한다. 예를 들면, 자식 프로세스가 새롭게 생성되면서 수행하는 초기화 작업들이 너무 많아 시간이 많이 걸리던지, 또는 과부하가 걸린다면 부모-자식간의 프로세스 구조로 구성하는 방법에 대한 고려가 필요한 문제점이 있었다.The reason for organizing processes in this way is to allow for multiple tasks at the same time. However, depending on the situation, it can not be configured. For example, there is a problem in that it takes a lot of time to initialize as a child process is newly created, or if there is an overload, it is necessary to consider how to construct a parent-child process structure.

본 발명의 다른 목적과 장점은 아래의 발명의 상세한 설명을 읽고 아래의 도면을 참조하면 보다 명백해질 것이다:Other objects and advantages of the present invention will become more apparent upon reading the following detailed description and with reference to the drawings below:

본 발명은 상기된 바와 같은 문제점을 해결하기 위한 것으로, 부모-자식의 관계로 프로세스 구성을 해야 하지만 현실적으로 어려운 경우에는 서로 다른 프로세스로 구성하여 제어하므로서 효율적인 자원의 사용을 가능하게 하는 것을 목적으로 한다.The present invention is to solve the problems as described above, but in order to configure the process in a parent-child relationship, but in reality difficult, it is intended to enable the efficient use of resources by configuring and controlling with different processes.

도 1 은 본 발명의 실시예에 의한 서로 다른 프로세스의 구성에 의한 부모 프로세스 역할을 하는 프로세스 통제 방법을 설명하는 블록 선도.1 is a block diagram illustrating a process control method serving as a parent process by configuration of different processes according to an embodiment of the present invention.

도 2 은 본 발명의 실시예에 의한 서로 다른 프로세스의 구성에 의한 자식 프로세스 역할을 하는 프로세스 통제 방법을 설명하는 블록 선도.2 is a block diagram illustrating a process control method that acts as a child process by configuration of different processes according to an embodiment of the present invention.

상기와 같은 목적을 달성하기 위하여 창안된 본 발명의 서로 다른 프로세스로 구성되어 부모 프로세스 역할을 수행하는 프로세스 통제 방법의 바람직한 일 실시예는,One preferred embodiment of the process control method is composed of different processes of the present invention created to achieve the above object to serve as a parent process,

부모-자식 프로세스 구조를 사용하지 못하는 경우에 있어서,In the case of not using the parent-child process structure,

공유 메모리를 처음 읽어 자식 역할을 수행하는 프로세스가 동작중인지 검사하는 단계;Checking whether a process serving as a child by reading the shared memory for the first time is running;

만일 상기 프로세스가 동작중이면 각 변수들에 저장하는 단계;Storing in each variable if the process is running;

자식 역할을 수행하는 프로세스로부터 메시지가 도착하였는지 검사하는 단계;Checking whether a message has arrived from a process playing a child role;

상기 메시지가 도착하였다면 해당 변수에 저장하고, 그렇지 않으면 작업할 내용이 있는지 검사하는 단계;Storing the message in a corresponding variable if the message arrives, and checking whether there is content to be worked on;

최대 작업 수행 시간을 계산하여 작업 지시를 하는 단계; 및Calculating a maximum work execution time and performing a work instruction; And

만일 상기 최대 작업 시간내에 작업 완료 결과가 전달되지 않으면 자식 프로세스를 소멸시키고 새로 초기화하는 단계를 포함한다.If the work completion result is not delivered within the maximum work time, the process includes destroying and reinitializing the child process.

본 발명에 있어서, 상기 각 변수들에 저장하는 단계에 있어서, 상기 각 변수는 초기화 성공 여부 변수와 작업 성공 여부 변수인 것이 바람직하다.In the present invention, in the storing in the respective variables, each variable is preferably an initialization success variable and a task success variable.

상기 목적을 달성하기 위한 본 발명에 의한 서로 다른 프로세스로 구성되어 자식 프로세스 역할을 수행하는 프로세스 통제 방법의 바람직한 일 실시예는, 부모-자식 프로세스 구조를 사용하지 못하는 경우에 있어서,One preferred embodiment of the process control method composed of different processes according to the present invention for achieving the above object to play the role of a child process, in the case of not using a parent-child process structure,

공유 메모리에 자신의 PID를 등록하는 단계;Registering its PID in shared memory;

초기화 작업을 시도하는 단계;Attempting an initialization operation;

부모 프로세스로부터 작업 지시 명령을 받으면 이를 수행하고 결과를 보고하는 단계를 포함한다.Receiving a work order command from the parent process includes performing this and reporting the result.

본 발명에 있어서, 상기 PID등록 단계에 있어서, 상기 PID 등록은 필요에 따라 자식 역할을 수행하는 프로세스가 제거될 수 있도록 고유 메모리에 등록하는 것이 바람직하며,In the present invention, in the PID registration step, the PID registration is preferably registered in a unique memory so that the process of performing the child role can be eliminated, if necessary,

상기 시도하는 단계에 있어서, 상기 초기화가 실패하더라도 계속 초기화를 시도하는 것이 바람직하며,In the attempting step, it is preferable to continue to attempt the initialization even if the initialization fails.

상기 모든 단계에 대한 상태를 부모 프로세서의 통제를 위하여 공유 메모리에 기록하는 것이 바람직하다.It is desirable to write the state for all of the above steps to the shared memory for control of the parent processor.

본 발명은 다양하게 변형될 수 있고, 여러 가지 형태를 취할 수 있지만, 그에 따른 특별한 실시예만 상기 도면에 도시되어 있고, 그에 대해서는 상세하게 기술될 것이다. 하지만, 본 발명은 명세서에서 언급된 특별한 형태로 한정되는 것이 아닌 것으로 이해되어야 하며, 오히려 본 발명은 첨부된 청구범위에 의해 정의된, 본 발명의 정신과 범위 내에 있는 모든 변형물, 균등물 및 대체물을 포함하는 것으로 이해되어야 한다.While the invention is susceptible to various modifications and alternative forms, only specific embodiments thereof are shown in the drawings and will be described in detail. It is to be understood, however, that the present invention is not limited to the specific forms referred to in the specification, but rather that the invention is intended to cover all modifications, equivalents, and substitutions within the spirit and scope of the invention as defined by the appended claims. It should be understood to include.

이하 첨부된 도 1과 도 2를 참조하여 본 발명의 서로 다른 프로세스의 구성에 의한 부모 또는 자식 프로세스 역할을 하는 프로세스 역할을 하는 프로세스 통제 방법을 설명한다.Hereinafter, a method of controlling a process serving as a parent or child process by a configuration of different processes of the present invention will be described with reference to FIGS. 1 and 2.

본 발명은 부모, 자식간의 관계가 아니지만 거의 닮기 위하여 모방하여 프로세스를 제어하는 방법을 제공한다. 자식 역할을 하는 프로세스는 처음 생성되면서 자신의 PID(Process Identification)을 공유 메모리에 기록하고 부모 역할을 하는 프로세스가 자식 역할의 프로세스를 제거해야 할 때는 고유 메모리에 있는 PID를 읽어와 제거할 수 있다.The present invention provides a method of controlling a process by imitating it to be almost similar, although not a relationship between parent and child. When a child acting process is first created, it writes its own process identification (PID) to shared memory, and when a parent acting process needs to remove a child role, it can read and remove the PID in its native memory.

자식 역할의 프로세스는 부모 프로세스가 통제를 위하여 필요한 모든 정보를 고유 메모리에 쓰고, 또한 메시지로 부모 프로세스에게 알린다.The child role process writes all the information that the parent process needs for control into its own memory and also informs the parent process with a message.

이에 상기 메시지로 알려주는 이유는 가장 빨리 자신의 변화를 알려주기 위해서이고, 상기 고유 메모리를 기록하는 이유는 부모 역할의 프로세스가 죽었다가 재 가동되는 경우에 자식 프로세스의 동작 상태를 알기 위해서이다.The reason for notifying the message is to inform the user of the change as soon as possible. The reason for writing the intrinsic memory is to know the operation state of the child process when the process of the parent role dies and restarts.

도 1을 참조하여 설명하면, 부모 역할을 하는 프로세스는 고유 메모리를 처음 읽고 난 후 자식 역할의 프로세스가 동작중인지를 검사한다. 만일 동작중이라고 한다면, 각각 초기화 성공 여부 변수와 작업 성공 여부 변수에 저장이 된다. 그후 자식 역할 프로세스로부터의 메시지가 도착하였는지를 검사하고 도착하였으면 해당 변수에 저장을 하고 그렇지 않으면 작업 할 내용이 있는지를 검사한다. 만일 자식 역할 프로세스가 정상적으로 살아있고, 작업할 수 있는 조건이 갖추어졌다면 최대 작업 수행 시간을 계산하여 작업 지시를 한다. 만일 최대 작업 수행 시간내에 작업 완료 결과가 전달되지 않는다면 자식 프로세스를 제거하고 새로 초기화시킨다.Referring to FIG. 1, a process acting as a parent checks whether a process of a child role is running after first reading native memory. If it is running, it is saved in initialization success variable and task success variable respectively. It then checks to see if a message from the child role process has arrived and if so, stores it in that variable, otherwise checks whether there is something to work on. If the child role process is alive and ready to work, the maximum task execution time is calculated and ordered. If the task completion result is not delivered within the maximum task execution time, the child process is removed and newly initialized.

도 2를 참조하여 설명하면, 자식 역할 프로세스는 공유 메모리에 자신의 PID를 등록하여 부모 프로세스가 필요에 따라 제거될 수 있도록 하고 신호를 등록하여 제거되기 전에 우선 부모 프로세스에게 제거된다는 메시지를 보낼 수 있도록 한다. 그후 초기화 작업을 수행하고, 실패하더라도, 계속 초기화를 시도하도록 한다. 부모 프로세스로부터 작업 지시 명령이 오면 이를 수행하고 결과를 보고한다. 이런 한 모든 진행 사항은 공유 메모리에 기록하여 부모 역할을 하는 프로세스가 원할 때는 언제든지 자식 역할의 프로세스가 무엇을 하고 있는지를 알 수 있도록 한다.Referring to FIG. 2, the child role process registers its PID in shared memory so that the parent process can be removed as needed and registers a signal so that it can first send a message to the parent process before it is removed. do. After that, the initialization operation is performed, and even if it fails, it continues to attempt initialization. When a work order command comes from a parent process, it does it and reports the result. All of this progress is recorded in shared memory so that the parenting process knows what the childing process is doing at any time.

상기와 같이 동작하는 본 발명은, 자식 프로세스를 생성하기 위한 시간, 또는 과부하가 클 경우 부모-자식 프로세스 구조를 사용하지 않고 서로 다른 프로세스로 구성하여, 효율적으로 자원을 사용할 수 있는 특성을 향상시킬 수 있다.According to the present invention operating as described above, if the time for generating a child process, or the overload is large, it is possible to configure a different process without using a parent-child process structure, thereby improving the characteristics of using resources efficiently. have.

Claims (6)

부모-자식 프로세스 구조를 사용하지 못하는 경우에 있어서,In the case of not using the parent-child process structure, 공유 메모리를 처음 읽어 자식 역할을 수행하는 프로세스가 동작중인지 검사하는 단계;Checking whether a process serving as a child by reading the shared memory for the first time is running; 만일 상기 프로세스가 동작중이면 각 변수들에 저장하는 단계;Storing in each variable if the process is running; 자식 역할을 수행하는 프로세스로부터 메시지가 도착하였는지 검사하는 단계;Checking whether a message has arrived from a process playing a child role; 상기 메시지가 도착하였다면 해당 변수에 저장하고, 그렇지 않으면 작업할 내용이 있는지 검사하는 단계;Storing the message in a corresponding variable if the message arrives, and checking whether there is content to be worked on; 최대 작업 수행 시간을 계산하여 작업 지시를 하는 단계; 및Calculating a maximum work execution time and performing a work instruction; And 만일 상기 최대 작업 시간내에 작업 완료 결과가 전달되지 않으면 자식 프로세스를 소멸시키고 새로 초기화하는 단계를 포함하는, 서로 다른 프로세스로 구성되어 부모 프로세스 역할을 수행하는 프로세스의 통제 방법.And destroying and reinitializing the child process if the work completion result is not delivered within the maximum work time. 제 1 항에 있어서, 상기 각 변수들에 저장하는 단계에 있어서, 상기 각 변수는 초기화 성공 여부 변수와 작업 성공 여부 변수인, 서로 다른 프로세스로 구성되어 부모 프로세스 역할을 수행하는 프로세스 통제 방법.The method of claim 1, wherein in the storing of the variables in the variables, each variable is composed of different processes that are initialization success variables and task success variables. 부모-자식 프로세스 구조를 사용하지 못하는 경우에 있어서,In the case of not using the parent-child process structure, 공유 메모리에 자신의 PID를 등록하는 단계;Registering its PID in shared memory; 초기화 작업을 시도하는 단계;Attempting an initialization operation; 부모 프로세스로부터 작업 지시 명령을 받으면 이를 수행하고 결과를 보고하는 단계를 포함하는, 서로 다른 프로세스로 구성되어 자식 프로세스 역할을 수행하는 프로세스 통제 방법.A process control method that is composed of different processes that act as child processes, including the step of receiving work order instructions from the parent process and reporting the results. 제 3 항에 있어서, 상기 PID등록 단계에 있어서, 상기 PID 등록은 필요에 따라 자식 역할을 수행하는 프로세스가 제거될 수 있도록 고유 메모리에 등록하는, 서로 다른 프로세스로 구성되어 자식 프로세스 역할을 수행하는 프로세스 통제 방법.4. The process of claim 3, wherein in the PID registration step, the PID registration is a process that is configured as a different process to perform a child process role, registering in a unique memory so that a process for performing a child role can be eliminated as necessary. Control method. 제 3 항에 있어서, 상기 시도하는 단계에 있어서, 상기 초기화가 실패하더라도 계속 초기화를 시도하는, 서로 다른 프로세스로 구성되어 자식 프로세스 역할을 수행하는 프로세스 통제 방법.4. The process control method according to claim 3, wherein in the attempting step, the initial process continues to be attempted even if the initialization fails. 제 3 항 내지 5 항 가운데 어느 한 항에 있어서, 상기 모든 단계에 대한 상태를 부모 프로세서의 통제를 위하여 공유 메모리에 기록하는, 서로 다른 프로세스로 구성되어 자식 프로세스 역할을 수행하는 프로세스 통제 방법.6. The process control method according to any one of claims 3 to 5, wherein the processes for all the steps are written in a shared memory for control of a parent processor, and are configured as different processes.
KR1019970079061A 1997-12-30 1997-12-30 Process control method that acts as a parent or child process by configuration of different processes KR19990058887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019970079061A KR19990058887A (en) 1997-12-30 1997-12-30 Process control method that acts as a parent or child process by configuration of different processes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019970079061A KR19990058887A (en) 1997-12-30 1997-12-30 Process control method that acts as a parent or child process by configuration of different processes

Publications (1)

Publication Number Publication Date
KR19990058887A true KR19990058887A (en) 1999-07-26

Family

ID=66180341

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019970079061A KR19990058887A (en) 1997-12-30 1997-12-30 Process control method that acts as a parent or child process by configuration of different processes

Country Status (1)

Country Link
KR (1) KR19990058887A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100815666B1 (en) * 2002-05-31 2008-03-20 엘지노텔 주식회사 Method for Bill Data Management When the MSC Restart

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100815666B1 (en) * 2002-05-31 2008-03-20 엘지노텔 주식회사 Method for Bill Data Management When the MSC Restart

Similar Documents

Publication Publication Date Title
DE69727407T2 (en) Distributed execution of mode-unsuitable instructions in multiprocessor systems
CN1648863A (en) Portable software application method
CN103207797A (en) Capsule type custom-made updating method based on unified extensible firmware interface firmware system
WO2019237710A1 (en) Method, device and equipment for recognizing video cards of gpu servers, and medium
EP0740254A3 (en) Microprocessor and method for setting up its peripheral functions
KR19990058887A (en) Process control method that acts as a parent or child process by configuration of different processes
US20070089118A1 (en) Method and device for controlling communications, and computer product
CN113220321B (en) CPLD high-efficiency upgrading method, system and medium
JP2533489B2 (en) Simulation system
JPS63140362A (en) System program loading method for multi-cpu system
JP2000298585A (en) System and method for rewriting rom
CN116501454A (en) Multitasking execution method and device and electronic equipment
JPH04127334A (en) Microprocessor system
JPH11316691A (en) Execution method for operating system and information processor using the method
JPH0478933A (en) Program processing system by virtual processor
JPH113231A (en) Software processing method
JPH10320366A (en) Nonresident program loading system
JP2785855B2 (en) Information processing device
JPS62217326A (en) Computer capable of storing and switching plural os
JP2004534997A5 (en)
JPH04286013A (en) Stop processing system for coprocessor
JP2001027948A (en) Information processor and information processing method
JPS6225336A (en) Processor resetting system
JPH03113503A (en) Industrial computer
JPH0651964A (en) Exchange maintenance system application software constituent system

Legal Events

Date Code Title Description
WITN Withdrawal due to no request for examination