Reputation: 185
Let's say I am following a client-server model, and one client, which is actually a thread, block on the remote server, which is actually a monitor.
What will happen to that thread, if the server crashes for some reason?
Upvotes: 2
Views: 218
Reputation: 140457
Answer is: it depends:
Things that play a role here:
In other words: nobody can tell you what your client application will be doing. Because we do not have any information about the implementation and configuration details you are dealing with.
Or, changing perspective: you should make sure that your client uses some form of timeouts. As said, this could be done by setting a timeout on the sockets used for communication. Or by having another thread that monitors all threads talking to a server; and that kicks in at some point in order to prevent such threads from waiting forever.
Long story short: if you are serious about such issues; you have to do a lot of research; a good starting point would be the old classic "Release it" by Michael Nygard.
Upvotes: 1