Advertisement

[Perl+Linux] Check in child process wether parent process still exists or not

Started by July 12, 2005 10:42 AM
11 comments, last by GameDev.net 19 years, 3 months ago
it won't work. Perl does some caching on ppid/pid because of threading issues (for example linuxthreads and other threading implementation implements threads via clone() as different proccess - so getp

id() doesn't return same values across threads.). The solution would be to use Linux::Pid module from CPAN (which always return true pid/ppid values) and then it should work as supposed.

hmm, didn't know that.. good to know.
Advertisement
Hmm oke, thanks for the info.

I no longer need help on the child proceses since I got around fixing my kill handlers so the child processen stops when the parent gets killed/stopped. I've tested my old code (which didn't work properly) but for some reason the child processes stopped when I kill the parent. It's very strange because I've tested it before and it didn't work at that time. Oh well, I'm just happy that it's fixed now.

This topic is closed to new replies.

Advertisement