in reply to How to simply terminate all running threads?

I get something like this using 'kill' with the handler 01 Perl exited with active threads: 02 9 running and unjoined 03 0 finished and unjoined 04 0 running and detached

That is simply an informational message.

If all you want to do is terminate the process; forget all that kill stuff and just exit. You'll get the informational message; but it is just information.

The kill method will not interrupt the threads. It is effectively useless.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
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". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
  • Comment on Re: How to simply terminate all running threads?

Replies are listed 'Best First'.
Re^2: How to simply terminate all running threads?
by Anonymous Monk on Sep 03, 2015 at 20:12 UTC
    Would that be an unsafe tactic to just exit? Shouldn't I need to force all the threads to formally return and deallocate any resources before exiting the program? (Please excuse my ignorance on this topic as I'm not so sure about these things) Thank you for your advice.
      Would that be an unsafe tactic to just exit? Shouldn't I need to force all the threads to formally return and deallocate any resources before exiting the program?

      No. They'll get cleaned up anyway when the process goes away.

      I wouldn't recommend that for production code other than in exceptional circumstances; but for testing it ought to be fine.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      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". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!