Re: BackgroundWorker / Thread question

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Doug Semler wrote:
"Carl Daniel [VC++ MVP]"
Because background worker threads are automatically ended by the
runtime when the main thread exits. Look up the documentation on the
System.Threading.Thread.IsBackground property for more information
on this topic.


I thought it was that background threads are ended when all foreground
threads exit, not just the main thread? (All foreground threads
exiting indicates to the CLR to shutdown, right?)

Yes, you're right about that - it's not just the main thread, but all
non-background thread that have to exit. (In the OPs case, I was assuming
that the main thread was the only non-background thread, but that's clearly
not true in the general case).

-cd


.