Moraki
Moraki

Reputation: 243

Does getting a stack overflow only affect the thread it happened in?

To put it in context : So lets say I was playing an online game and I created a stack overflow. Would that effect everyone on the server playing as well, or just me?

Upvotes: 3

Views: 115

Answers (2)

Mike Samuel
Mike Samuel

Reputation: 120486

If the JVM is on your browser, definitely not.

On the server, a stack overflow will effectively kill the thread. If it is missing finally blocks the thread might die without releasing resources which could wedge the server after a while, but it should release all mutexes held due to synchonized blocks. Assuming the error is not handled, it will call the thead's ThreadUncaughtExceptionHandler which normally will not take down the server unless the server is doing work in the main thread, but an uncaught exception handler could be implemented to take down the server.

Upvotes: 3

Tobias
Tobias

Reputation: 9380

That depends on how the server is programmed; and what happens with the StackOverflow. If it is not catched it can affect the whole server.

Upvotes: 2

Related Questions