I am filled with questions pertaining to the situations where a desktop-application hangs, possibly for minutes.
I've got this complicated game-engine written in c++. Several times during development, I've accidentally found an infinite loop during testing and the program causes the entire system to hang, usually for a few minutes. I used to just restart my computer with the physical button, because I didn't realize it was so bad. I'm using Linux (Ubuntu, Debian), is it any better on Windows or Mac?
Am I responsible for damage to a user's installation-environment or the loss of data if they restart their computer while my software is hanging, and their OS becomes unusable? Of-course, I can test the software loads and be quite confident that it doesn't happen, but I don't know if I can be 100% sure.
Is there some clever way overall, to stop a program from hanging and stealing all of the CPU for itself? Like, lowering my game's priority to the kernel?
If the game has a feature for users to create and share maps, which can include writing scripts sent to the engine's interpreter, there would be tons of ways for them to spawn way too many entities and enable their AI that I'm quite sure they could make the program hang. I'm not sure I can enforce every countermeasure against that kind of mess, especially from the game's release. Am I responsible if someone makes a map that damages someone's installation?
I really hope I'm overthinking this. Is there an easy way to protect my program from hanging? Do processes made by visual-studio-code have worse problems with hanging for development-purposes? Is my kernel mysteriously bad at stopping hanging processes?
I don't need help removing infinite-loops from my code, the concern is that due to its complexity I would miss one.