Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can exception/error in one thread halt the whole application?

If an error / exeption is thrown in a thread (not a main one) can this halt the whole application ?

Is there such possibility ? Or will this just stop the thread it was running in ?

like image 856
Sebastian Dusza Avatar asked Oct 18 '12 11:10

Sebastian Dusza


1 Answers

If an error / exeption is thrown in a thread (not a main one) can this halt the whole application ?

It will if it causes the only non-daemon thread to return from run()

If there are other non-daemon threads running or the exception or error is caught and handled, the application will keep running.

will this just stop the thread it was running in ?

if the exception or error is caught and handled it might not stop any threads.

like image 116
Peter Lawrey Avatar answered Sep 30 '22 01:09

Peter Lawrey