Do You Coding?

[function] waitpid ํ•จ์ˆ˜ ์•Œ์•„๋ณด๊ธฐ ๋ณธ๋ฌธ

CS & Engineering/C

[function] waitpid ํ•จ์ˆ˜ ์•Œ์•„๋ณด๊ธฐ

๐Ÿ“Œ ๋งค๋‰ด์–ผ (Linux)

๋”๋ณด๊ธฐ

NAME
       waitpid - wait for process to change state
: ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ƒํƒœ๋ฅผ ๋ณ€๊ฒฝํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฌ๊ธฐ


SYNOPSIS
       #include <sys/types.h>
       #include <sys/wait.h>
       pid_t waitpid(pid_t pid, int *wstatus, int options);

DESCRIPTION
       All  of  these  system  calls  are  used  to  wait for state changes in a child of the calling
       process, and obtain information about the child whose state has changed.  A  state  change  is
       considered  to  be:  the child terminated; the child was stopped by a signal; or the child was
       resumed by a signal.  In the case of a terminated child, performing a wait allows  the  system
       to  release the resources associated with the child; if a wait is not performed, then the terโ€
       minated child remains in a "zombie" state (see NOTES below).

       If a child has already changed state, then these calls return  immediately.   Otherwise,  they
       block  until  either  a  child changes state or a signal handler interrupts the call (assuming
       that system calls are not automatically restarted using the SA_RESTART flag of  sigaction(2)).
       In  the  remainder  of  this  page, a child whose state has changed and which has not yet been
       waited upon by one of these system calls is termed waitable.

   wait() and waitpid()
       The wait() system call suspends execution of the calling thread until one of its children terโ€
       minates.  The call wait(&wstatus) is equivalent to:
           waitpid(-1, &wstatus, 0);

 

       The  waitpid() system call suspends execution of the calling thread until a child specified by
       pid argument has changed state.  By default, waitpid() waits only for terminated children, but
       this behavior is modifiable via the options argument, as described below.

       The value of pid can be:
       < -1   meaning  wait  for  any  child  process whose process group ID is equal to the absolute
              value of pid.
       -1     meaning wait for any child process.
       0      meaning wait for any child process whose process group ID is equal to that of the callโ€
              ing process at the time of the call to waitpid().
       > 0    meaning wait for the child whose process ID is equal to the value of pid.

: ์ด ๋ชจ๋“  ์‹œ์Šคํ…œ ํ˜ธ์ถœ์€ ํ˜ธ์ถœ ๊ณผ์ •์˜ ์ž์‹์—์„œ ์ƒํƒœ ๋ณ€๊ฒฝ์„ ๋Œ€๊ธฐํ•˜๊ณ  ์ƒํƒœ๊ฐ€ ๋ณ€๊ฒฝ๋œ child์— ๋Œ€ํ•œ
์ •๋ณด๋ฅผ ์–ป๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ƒํƒœ ๋ณ€๊ฒฝ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๊ฐ„์ฃผ๋ฉ๋‹ˆ๋‹ค. child๊ฐ€ ์ข…๋ฃŒ๋˜๊ฑฐ๋‚˜,
์‹ ํ˜ธ์— ์˜ํ•ด child๊ฐ€ ์ค‘์ง€๋˜๊ฑฐ๋‚˜, ์‹ ํ˜ธ์— ์˜ํ•ด ๋‹ค์‹œ ์‹œ์ž‘๋ฉ๋‹ˆ๋‹ค. ์ข…๋ฃŒ๋œ child์˜ ๊ฒฝ์šฐ,
๋Œ€๊ธฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋ฉด ์‹œ์Šคํ…œ์ด child๊ณผ ๊ด€๋ จ๋œ ๋ฆฌ์†Œ์Šค๋ฅผ ํ•ด์ œํ•  ์ˆ˜ ์žˆ๊ณ , ๋Œ€๊ธฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜์ง€ ์•Š์œผ๋ฉด
์ข…๋ฃŒ๋œ child๋Š” "์ข€๋น„" ์ƒํƒœ๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค(์•„๋ž˜ ์ฐธ๊ณ  ์ฐธ์กฐ).


child๊ฐ€ ์ด๋ฏธ ์ƒํƒœ๋ฅผ ๋ณ€๊ฒฝํ•œ ๊ฒฝ์šฐ ์ด๋Ÿฌํ•œ ํ˜ธ์ถœ์€ ์ฆ‰์‹œ ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.
๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด child์ด ์ƒํƒœ๋ฅผ ๋ณ€๊ฒฝํ•˜๊ฑฐ๋‚˜ ์‹ ํ˜ธ ์ฒ˜๋ฆฌ๊ธฐ๊ฐ€ ํ˜ธ์ถœ์„ ์ค‘๋‹จํ•  ๋•Œ๊นŒ์ง€
(์‹œ๊ทธ์•ก์…˜(2)์˜ SA_RESTART ํ”Œ๋ž˜๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‹œ์Šคํ…œ ํ˜ธ์ถœ์ด ์ž๋™์œผ๋กœ
๋‹ค์‹œ ์‹œ์ž‘๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ๊ฐ€์ •ํ•  ๋•Œ) ์ฐจ๋‹จ๋ฉ๋‹ˆ๋‹ค.
์ด ํŽ˜์ด์ง€์˜ ๋‚˜๋จธ์ง€ ๋ถ€๋ถ„์—์„œ๋Š” ์ƒํƒœ๊ฐ€ ๋ณ€๊ฒฝ๋˜์–ด ์•„์ง ์ด๋Ÿฌํ•œ ์‹œ์Šคํ…œ ํ˜ธ์ถœ ์ค‘ ํ•˜๋‚˜๊ฐ€
๋Œ€๊ธฐํ•˜์ง€ ์•Š์€ child๋ฅผ ๋Œ€๊ธฐ ๊ฐ€๋Šฅ ์ƒํƒœ๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค.

 

wait() and waitpid()
wait() ์‹œ์Šคํ…œ ํ˜ธ์ถœ์€ ํ•˜์œ„ ํ˜ธ์ถœ ์ค‘ ํ•˜๋‚˜๊ฐ€ ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ํ˜ธ์ถœ ์Šค๋ ˆ๋“œ์˜ ์‹คํ–‰์„ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค.
ํ˜ธ์ถœ wait(&wstatus)๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:
waitpid (- 1, &wstatus, 0);

waitpid() ์‹œ์Šคํ…œ ํ˜ธ์ถœ์€ pid ์ธ์ˆ˜์— ์˜ํ•ด ์ง€์ •๋œ child์ด ์ƒํƒœ๊ฐ€ ๋ณ€๊ฒฝ๋  ๋•Œ๊นŒ์ง€ ํ˜ธ์ถœ ์Šค๋ ˆ๋“œ์˜ ์‹คํ–‰์„ ์ค‘์ง€ํ•ฉ๋‹ˆ๋‹ค.
๊ธฐ๋ณธ์ ์œผ๋กœ waitpid()๋Š” ์ข…๋ฃŒ๋œ child๋งŒ ๋Œ€๊ธฐํ•˜์ง€๋งŒ, ์ด ๋™์ž‘์€ ์•„๋ž˜ ์„ค๋ช…๋œ ๋Œ€๋กœ ์˜ต์…˜ ์ธ์ˆ˜๋ฅผ ํ†ตํ•ด ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

pid ๊ฐ’์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:
< -1์€ ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน ID๊ฐ€ pid์˜ ์ ˆ๋Œ€๊ฐ’๊ณผ ๋™์ผํ•œ ํ•˜์œ„ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋Œ€๊ธฐํ•œ๋‹ค๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.
-1์€ ๋ชจ๋“  ์ž์‹ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ธฐ๋‹ค๋ฆด ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.
0์€ ํ˜ธ์ถœ ์‹œ ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน ID๊ฐ€ ํ˜ธ์ถœ ํ”„๋กœ์„ธ์Šค ID์™€ ๋™์ผํ•œ ํ•˜์œ„ ํ”„๋กœ์„ธ์Šค๋ฅผ waitpid()๋กœ ๊ธฐ๋‹ค๋ฆฌ๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค.
> 0์€ ํ”„๋กœ์„ธ์Šค ID๊ฐ€ pid ๊ฐ’๊ณผ ๋™์ผํ•œ child๋ฅผ ๊ธฐ๋‹ค๋ฆฐ๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค.

 

RETURN VALUE
       waitpid(): on success, returns the process ID of the child whose state has changed; if WNOHANG
       was  specified  and  one  or  more child(ren) specified by pid exist, but have not yet changed
       state, then 0 is returned.  On error, -1 is returned.
       Each of these calls sets errno to an appropriate value in the case of an error.

: ์„ฑ๊ณต ์‹œ ์ƒํƒœ๊ฐ€ ๋ณ€๊ฒฝ๋œ ์ž์‹์˜ ํ”„๋กœ์„ธ์Šค ID๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

WNOHANG์ด ์ง€์ •๋˜์—ˆ๊ณ  pid๋กœ ์ง€์ •๋œ ์ž์‹(์ž๋…€)์ด ํ•˜๋‚˜ ์ด์ƒ ์กด์žฌํ•˜์ง€๋งŒ ์ƒํƒœ๊ฐ€ ์•„์ง ๋ณ€๊ฒฝ๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ

0์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค. ์˜ค๋ฅ˜ ์‹œ -1์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๊ฐ ํ˜ธ์ถœ์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ๊ฒฝ์šฐ ์ ์ ˆํ•œ ๊ฐ’์œผ๋กœ errno๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Œ ํ•จ์ˆ˜ ์„ค๋ช…

waitpid ํ•จ์ˆ˜๋Š” wait ํ•จ์ˆ˜์™€ ๋‹ฌ๋ฆฌ ์›ํ•˜๋Š” pid์˜ child process๋ฅผ ๊ธฐ๋‹ค๋ฆด ์ˆ˜ ์žˆ๋Š” ํ•จ์ˆ˜์ด๋‹ค.

pid_t waitpid(pid_t pid, int *status, int options); ์˜ ํ˜•ํƒœ์ด๊ณ , ์ธ์ž๋กœ ๋ฐ›๋Š” pid์— ๋”ฐ๋ผ waitpid์˜ ์ฒ˜๋ฆฌ๊ฐ€ ๋‹ฌ๋ผ์ง„๋‹ค.

pid์— ๋”ฐ๋ผ์„œ ์–ด๋– ํ•œ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ธฐ๋‹ค๋ฆด์ง€๋ฅผ ์ง€์ •ํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ต์…˜์œผ๋กœ ์ด๋ค„์ ธ์žˆ๋‹ค.

 

< ์ธ์ž pid์— ๋”ฐ๋ฅธ ์˜ต์…˜ >

pid == -1 ์ž„์˜์˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค
pid > 0 ํ”„๋กœ์„ธ์Šค ID๊ฐ€ pid์˜ ๊ฐ’๊ณผ ๊ฐ™์€ ์ž์‹ ํ”„๋กœ์„ธ์Šค
pid == 0 ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน ID๊ฐ€ ํ˜ธ์ถœํ•œ ํ”„๋กœ์„ธ์Šค์˜ ID์™€ ๊ฐ™์€ ํ”„๋กœ์„ธ์Šค
pid < -1 ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน ID๊ฐ€ pid์˜ ์ ˆ๋Œ€๊ฐ’๊ณผ ๊ฐ™์€ ์ž„์˜์˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค

 

์šฐ์„  ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน์ด๋ž€, ๊ด€๋ จ์žˆ๋Š” ํ”„๋กœ์„ธ์Šค๋ฅผ ๋ฌถ์€ ๊ฒƒ์œผ๋กœ Process Group ID๋ฅผ ๋ถ€์—ฌ๋ฐ›๋Š”๋‹ค.

ํ”„๋กœ์„ธ์Šค๋Š” ๊ทธ๋ฃน ๋ฉค๋ฒ„๊ฐ€ ๋˜๋ฉฐ, ์‰˜์—์„œ ํŒŒ์ดํ”„๋กœ ์—ฐ๊ฒฐํ•˜๋ฉด์„œ ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน์œผ๋กœ ๋ฌถ์–ด ํ•œ ์ž‘์—…์œผ๋กœ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค.

๋˜ํ•œ, ํ”„๋กœ์„ธ์Šค ๊ทธ๋ฃน ๋ฆฌ๋”๊ฐ€ ์กด์žฌํ•˜๋ฉฐ, ๊ทธ๋ฃน ๋ฆฌ๋”์˜ PID๊ฐ€ PGID(Process Group ID)๊ฐ€ ๋œ๋‹ค. (๋ฆฌ๋” ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ)

 

์œ„ ํ‘œ์— ์ ํžŒ ํ•ด๋‹น ํ”„๋กœ์„ธ์Šค๊ฐ€ waitํ•  ๋Œ€์ƒ์ด ๋˜๊ณ , ๊ฐ๊ฐ ์„ค๋ช…ํ•˜๋ฉด,

-1์ผ ๋•Œ๋Š”, wait() ํ•จ์ˆ˜์™€ ๋™์ผํ•˜๊ฒŒ ํ•˜๋‚˜์˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฐ๋‹ค. (waitpid(-1, &status, 0))

0 ๋ณด๋‹ค ํด ๋•Œ๋Š”, ํ•ด๋‹น pid์˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฐ๋‹ค.

0์ผ ๋•Œ๋Š”, ํ˜„์žฌ ํ”„๋กœ์„ธ์Šค์˜ ๊ทธ๋ฃน ID์™€ ๊ฐ™์€ ๊ทธ๋ฃน์˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฐ๋‹ค.

-1๋ณด๋‹ค ์ž‘์„ ๋•Œ๋Š”, ๊ทธ๋ฃน ID๊ฐ€ pid๋กœ ๋ฐ›์€ ๊ฐ’์˜ ์ ˆ๋Œ“๊ฐ’๊ณผ ๊ฐ™๊ณ , ํ•ด๋‹น ๊ทธ๋ฃน์˜ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒํ•  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฐ๋‹ค.


๊ทธ๋ฆฌ๊ณ , 3๋ฒˆ์งธ ์ธ์ž์ธ options์—๋Š” 0, WNOHANG, WCONTINUED, WUNTRACED ๋“ฑ์ด ๋“ค์–ด๊ฐ€๋ฉฐ,

์ผ๋ฐ˜์ ์œผ๋กœ WNOHANG(์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜์—ˆ๋Š”์ง€ ์‹คํ–‰์ค‘์ธ์ง€๋งŒ ํ™•์ธํ•˜๊ณ  ๊ธฐ๋‹ค๋ฆฌ์ง€๋Š” ์•Š์Œ.) ๊ณผ

0 (์ผ๋ฐ˜ wait ํ•จ์ˆ˜์ฒ˜๋Ÿผ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆผ.) ์„ ๋งŽ์ด ์‚ฌ์šฉํ•œ๋‹ค.


๋ฐ˜ํ™˜๊ฐ’์€ wait์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ์ข…๋ฃŒ๋œ ์ž์‹ ํ”„๋กœ์„ธ์Šค์˜ ํ”„๋กœ์„ธ์Šค ID๋ฅผ return ํ•˜๊ณ  , ์‹คํŒจํ•˜๋ฉด -1์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.

์ถ”๊ฐ€์ ์œผ๋กœ 'WNOHANG์„ options์œผ๋กœ ์‚ฌ์šฉํ•˜๋ฉด์„œ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด' 0์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.


#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>

int main(void)
{
    int pid = fork();
    int status;
    if (pid == 0)
    {
        sleep(5);
        printf("Child Process Ended\n");
        exit(0);
    }
    while(waitpid(pid, &status, WNOHANG) == 0)
    {
        sleep(1);
        printf("waiting...\n");
    }
    printf("Parent Process Ended\n");
    exit(0);
}

 

์ถœ๋ ฅ - std_output)

 

waitpid์˜ options์„ WNOHANG์œผ๋กœ ์‚ฌ์šฉํ•˜๊ณ  while๋ฌธ์— 0์ผ ๋•Œ์˜ ์กฐ๊ฑด์„ ์ฃผ์—ˆ๋Š”๋ฐ,

'WNOHANG์„ options์œผ๋กœ ์‚ฌ์šฉํ•˜๋ฉด์„œ ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋˜์ง€ ์•Š์•˜๋‹ค๋ฉด' 0์„ ๋ฐ˜ํ™˜ํ•˜๋Š” ์ƒํ™ฉ์„ ์ด์šฉํ•œ ์ฝ”๋“œ์ด๋‹ค.

 

์ž์‹์€ sleep์„ 5์ดˆ๊ฐ„ํ•˜๊ณ  ์ดํ›„์— Child Process Ended ๋ผ๋Š” ๋ฌธ๊ตฌ๋ฅผ ์ถœ๋ ฅํ•œ๋‹ค.

waitpid๋Š” ๋ถ€๋ชจ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๊ทธ ์ž์‹์ด ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฌ๋Š” ๊ฒƒ์ด ์•„๋‹Œ, ๋ฐ”๋กœ 0์„ ๋ฐ˜ํ™˜ํ•˜๊ฒŒ ๋˜๋ฏ€๋กœ,

while๋ฌธ ์•ˆ์˜ ๋‚ด์šฉ์„ ์‹คํ–‰ํ•˜์—ฌ 1์ดˆ sleep ํ›„, waiting... ์„ ์ถœ๋ ฅํ•œ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ์ž์‹์ด ์ข…๋ฃŒ๋˜๋ฉด, ์ด์ œ ๋ถ€๋ชจ ํ”„๋กœ์„ธ์Šค๋Š” waitpid๊ฐ€ 0์ด ์•„๋‹Œ ์ž์‹์˜ pid๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋ฏ€๋กœ ๋ฐ˜๋ณต๋ฌธ์ด ์ข…๋ฃŒ๋˜๊ณ ,

Parent Process Ended๊ฐ€ ์ถœ๋ ฅ๋˜๋ฉฐ ๋ชจ๋‘ ์ข…๋ฃŒ๋œ๋‹ค. 

 

#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdlib.h>

int main(void)
{
    int pid = fork();
    int status;
    if (pid == 0)
    {
        sleep(5);
        printf("Child Process Ended\n");
        exit(0);
    }
    while(waitpid(pid, &status, 0) == 0)
    {
        sleep(1);
        printf("waiting...\n");
    }
    printf("Parent Process Ended\n");
    exit(0);
}

 

์ถœ๋ ฅ - std_output)

 

์ฒซ๋ฒˆ์งธ ์ฝ”๋“œ์—์„œ waitpid์˜ options์„ 0์œผ๋กœ ๋ฐ”๊พผ ๋’ค์˜ ๊ฒฐ๊ณผ์ด๋‹ค.

๊ทธ๋Ÿผ wait() ํ•จ์ˆ˜์™€ ๋™์ผํ•˜๊ฒŒ ์ž‘๋™ํ•˜๋ฉฐ, ์ž์‹ ํ”„๋กœ์„ธ์Šค๊ฐ€ ์ข…๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฌ๋‹ค, ์ข…๋ฃŒ๋˜๋ฉด

ํ•ด๋‹น ์ž์‹ ํ”„๋กœ์„ธ์Šค์˜ pid๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋ฏ€๋กœ ๋ฐ˜๋ณต๋ฌธ์ด ์‹คํ–‰๋˜์ง€ ์•Š๋Š”๋‹ค.

๊ทธ๋ฆฌํ•˜์—ฌ, Child, Parent์˜ ํ”„๋กœ์„ธ์Šค ์ข…๋ฃŒ ์ถœ๋ ฅ๋งŒ ๋˜๊ณ  ๋์ด ๋‚œ๋‹ค.