in reply to Re: Killing on Windows
in thread Killing on Windows

Thanks for the explanation. I now see that my real problem is that the kill of course kill only the process directly invoked; but that process had at this time already invoked other child processes, and *they* are of course not killed, and they run to the end.

What possibilities exist in Windows to kill a process *including* all of its children in one go? On Solaris, I would use pkill. I think this is such a common problem that there is likely also something available for Windows...

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^3: Killing on Windows
by BrowserUk (Patriarch) on Sep 10, 2009 at 10:28 UTC
    What possibilities exist in Windows to kill a process *including* all of its children in one go?

    See Win32::Job.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Yes, this is a possibility indeed. I just was curious whether there is a possibility to kill jobs started with system(1,...); sorry if I was not clear enough in this respect.

      It turns out that at least with my tests, I did find a solution which seems to work: Using a negative kill signal (kill -9) killed also my children. Knowing that Windows gets funny at times, I wonder whether this is indeed a reliable solution, or whether there could be cases when this strategy fails to work.
      -- 
      Ronald Fischer <ynnor@mm.st>
        Using a negative kill signal (kill -9) killed also my children

        Hm. Which version of Perl are you using?

        Update: I'm not sure when it was added, but the latest sources show that any negative signal value is now taken to mean "kill this process tree with prejuduce".


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.