mercredi 25 février 2015

How does a JVM running multiple threads handle ctrl-c, w/ and w/o shutdown hooks?



Could not find this answer online. When Ctrl+C is hit:



  • When we don't have any shutdown hook, what happens to the running threads - do they each get hit with an InterruptedException?

  • When we have shutdown hook(s), I know that the shutdown hooks get run in new threads in arbitrary order. But what happens to the existing running threads? Do they still each get hit with an InterruptedException?


Thanks!




Aucun commentaire:

Enregistrer un commentaire