Threads state after the program finishes execution
What happens to internal threads after the main thread finishes execution?
Program 1 creates 5 threads to run in background. Program 1 crashes. Are those threads alive?
They will get killed because threads are bound in the process context?
All those resources are linked up to the process data structure. When a process is terminated Windows ensures that all the resources are cleaned-up.
Didn't manage to find references to docs [feel free to add some, I am sure I read this in M.Russinovich "Windows Internals" book], but here are couple of similar answers regarding memory dealocations. Thread clean up is part of the clean up routine that windows call when a process is terminated.