On Wed, 10 Jan 2007 21:57:14 +0100, Steffen Mueller <[EMAIL PROTECTED]> wrote:
>Jan Dubois schrieb: >> You can use the Perl kill() function to terminate a thread, but it has >> the same limitations as the alarm() function on Windows: it will not >> interrupt a blocking system call (e.g. a blocking socket read). The >> kill signal is essentially delivered by Perl's safe signal mechanism to >> the other thread. > >perlfork tells me this: >kill() can be used to terminate a pseudo-process by passing it the ID >returned by fork(). This should not be used except under dire >circumstances, because the operating system may not guarantee integrity >of the process resources when a running thread is terminated. Note that >using kill() on a pseudo-process() may typically cause memory leaks, >because the thread that implements the pseudo-process does not get a >chance to clean up its resources. > >That's not what I'd call "safely". > >Or is that warning outdated? Oops, you are right, kill(9,$pid) will indeed do a "hard" kill of the thread. In that case there will be *no* cleanup whatsoever; the interpreter and all objects will continue to stay in memory. Pipe and filehandles will not be closed. All the "other" signals should be delivered through the "safe" mechanism though. Sorry about that... Cheers, -Jan
