I have made a game, it is written in C++ and directX.
When the user chooses which mission to play the screen goes blank for some time while it load in all the resources. So the user knows the game has not crashed I want to make a loading screen with an animation.
My question is this:
-
If one thread (the main one) crashes do all threads of that process crash?
-
Can you destroy a thread from the thread that created it or does the thread have to terminate itself?
-
I am new to multithreading and have not used it before. Many people say it makes programs unnecessarily complex so is it worth making my program multithreaded just for a loading screen or is there another way of doing it?
If the main thread crashes (i.e. the UI thread) obviously the application crashes. If any worker thread crashes, you will get an exception which you can choose to ignore.
Normally the thread itself should terminate itself (i.e. finish execution). Obviously you can signal any secondary thread to stop from the main thread.
You’ll have to learn multitasking if you’re serious about programming so better now than never.