D
Doug Thews
I saw something interesting when testing my multi-threaded code to make sure
that threads were terminating as I expected. When I first bring up my
WinForms test application (before I do any Thread.Start), I notice that my
process has 4 threads initially. Does anyone know what the other 3 threads
in my app's process are for?
Also, I posted a question earlier about getting an initial delay after
calling Thread.Abort (yes, I know it's not wise to do it, but I wanted to
dig further to see what caused the delay). Anyway, what I found was that
..NET was actually spinning up 2 other threads during this "extra" time, and
then killed the threads after it did something in the background. Probably
some kind of exception (on top of my exception handling), or cleanup.
Anyway, the thread count bounces up only on the very first Thread.Abort. If
I re-create a new thread and abort it, this scenario (and the delay) doesn't
occur.
that threads were terminating as I expected. When I first bring up my
WinForms test application (before I do any Thread.Start), I notice that my
process has 4 threads initially. Does anyone know what the other 3 threads
in my app's process are for?
Also, I posted a question earlier about getting an initial delay after
calling Thread.Abort (yes, I know it's not wise to do it, but I wanted to
dig further to see what caused the delay). Anyway, what I found was that
..NET was actually spinning up 2 other threads during this "extra" time, and
then killed the threads after it did something in the background. Probably
some kind of exception (on top of my exception handling), or cleanup.
Anyway, the thread count bounces up only on the very first Thread.Abort. If
I re-create a new thread and abort it, this scenario (and the delay) doesn't
occur.