Does the dotnet splitting service stop terminating native streams?

I have a windows service written in dotNet. There is a worker service that spawns worker threads using various Delegate.BeginInvokes. When does a service failure trigger those threads to be cleaned up automatically? And if so, when?

0


source to share


2 answers


All threads created by your process are inside this process. When your application crashes, your process dies and all threads in the process terminate abruptly. They don't end up friendly (they don't get an interrupt signal or whatever), they just get killed. They may or may not get enough CPU time to complete execution - rather, it depends on what they are doing and how quickly Windows unloads the process.



All reliable versions of Windows (2000+) should be split into your process, so when it dies, all of the process space is flushed and memory is reclaimed. If you were accessing unmanaged resources during a crash, then the whole picture changes and the answer is "depends."

+1


source


only when the service is terminated and unloaded from memory



0


source







All Articles