in reply to Re: killing on win32
in thread killing on win32

Thanks BrowserUk,
As I already said, I need to use fork on Windows. I am not mixing it with threads or with anything else. I am calling the child processes "threads" because that's what they really are. I would like to know if there is a way of killing all the "child-threads" on Windows and keep the main thread still alive.
Thanks.

Replies are listed 'Best First'.
Re^3: killing on win32
by BrowserUk (Patriarch) on Sep 06, 2007 at 11:41 UTC
    would like to know if there is a way of killing all the "child-threads" on Windows and keep the main thread still alive.

    As I tried to explain above, not unless you can get access to the real process ids.

    The only ways I know how to do that is to use the forking open:

    my $pid = open my fh, "/path/to/the/exe args |" ...;

    or the asynchronous spawn (

    my $pid = system 1, '/path/to/the/exe args';

    rather than fork & exec.

    Neither of which maps particularly well onto the fork & exec idioms typical of *nix code.


    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.