Now this may be a very newbie, but I have no experience with multi-threaded programming, and I did not quite understand how threads work compared to processes.
When a process on my computer freezes, say that it is waiting for some kind of I / O that never appears or something similar, I can kill and restart it because other processes are not affected and may, for example, still work with my terminal. This, of course, is very obvious.
I'm not sure that the same thing happens with threads inside the process: if someone is hanging, are others not affected? In other words, can I start a watchdog thread that controls other threads and, for example, kills and recreates hanging threads? For example, if I have a threadpool that I do not want to be exhausted by random hangs.
source
share