in reply to Re^3: break thread with system(...) call
in thread break thread with system(...) call

Some further info on this:

  1. You must use perl's built in kill, with a signal number 21 (SIGBREAK).

    Win32::Process::Kill() only gets the immediate child, not the group.

  2. Only processes that share the same console will be killed.

    That means that if all the processes in your complex commands are simple command line apps, then all children and their grandchildren etc. will be killed as a group.

    But if any of the processes allocate their own console, or do not use a console (eg. notepad.exe), then they will survive. I do not have a simple solution for these.


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.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^4: break thread with system(...) call