windows - Threads state after the program finishes execution -


what happens internal threads after main thread finishes execution?

e.g:

program 1 creates 5 threads run in background.
program 1 crashes.
threads alive?

they killed because threads bound in process context?

all resources linked process data structure. when process terminated windows ensures all resources cleaned-up.

didn't manage find references docs [feel free add some, sure read in m.russinovich "windows internals" book], here couple of similar answers regarding memory dealocations. thread clean part of clean routine windows call when process terminated.

https://stackoverflow.com/a/2975844/706456

https://stackoverflow.com/a/654766/706456


Comments