View previous topic :: View next topic |
Author |
Message |
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 413
|
Posted: Wed Oct 18, 2023 9:36 pm Post subject: mutexes and flags |
|
|
forum hello again. please tell me how in the parent process can I know for sure that the child process is now completed? which flag or mutex in fork() reflects this? from where in fork() can I read this? |
|
Back to top |
|
|
salahx Guru
Joined: 12 Mar 2005 Posts: 559
|
Posted: Wed Oct 18, 2023 9:55 pm Post subject: |
|
|
The parent process will get SIGCHLD when the child process ends. The parent then needs to call one of the flavors of wait() on it to clean up after it. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 413
|
Posted: Wed Oct 18, 2023 10:30 pm Post subject: |
|
|
salahx wrote: | The parent process will get SIGCHLD when the child process ends. The parent then needs to call one of the flavors of wait() on it to clean up after it. |
how to process it? how to read it to understand that the child process is completed? what SIGCHLD should it contain ? |
|
Back to top |
|
|
salahx Guru
Joined: 12 Mar 2005 Posts: 559
|
Posted: Thu Oct 19, 2023 1:52 am Post subject: |
|
|
You would install a signal handler (with sigaction) for SIGCHLD in the parent. See the man pages for sigaction() and wait() for some examples. |
|
Back to top |
|
|
Gentoopc Guru
Joined: 25 Dec 2017 Posts: 413
|
Posted: Thu Oct 19, 2023 12:14 pm Post subject: |
|
|
salahx wrote: | You would install a signal handler (with sigaction) for SIGCHLD in the parent. See the man pages for sigaction() and wait() for some examples. |
we've already figured it out. thank you forum, you provide great support |
|
Back to top |
|
|
|