Questions tagged [isbackground]
4 questions
12
votes
2 answers
Can I detect when a background Thread is killed by the application when the application closes?
I'm using a thread in C# where I've set the IsBackground property to true. The thread is running some code in a loop until the application closes. When the application is closed the thread also stops executing (because I've set IsBackground =…

Ben Adams
- 564
- 1
- 4
- 18
7
votes
1 answer
Shutting down a windows service that has threads
I have a windows service written in .NET 3.5 (c#) with a System.Threading.Timer that spawns several Threads in each callback. These are just normal threads (no Thread Pool) and I've set the IsBackground = true on each thread since I'm only going to…

Dave
- 281
- 4
- 10
5
votes
4 answers
Can I safely rely on IsBackground in Threads when the application terminates?
I'm running some background threads in the GUI. Currently I'm implementing a personal Thread cancellation code but there is IsBackground property in threads and according MSDN they'll cancel themselves.
I know that it's going to Thread.Abort() which…

dr. evil
- 26,944
- 33
- 131
- 201
0
votes
0 answers
How to check if main thread is done, from additional thread if AdditionalThread.IsBackground = false
There are two threads: main and additional. Addidional thread works in infinite loop and should be stopped after the main thread ends or application ends. Could you tell me the best way to tell AdditionalThread that it should be stopped?
Maybe i…

hyWhy
- 23
- 5