My C# application has several background workers. Sometimes one background worker will fire off another. When the first background worker completes and the RunWorkerCompleted
event is fired, on which thread will that event fire, the UI or the first background worker from which RunWorkerAsync
was called? I am using Microsoft Visual C# 2008 Express Edition. Any thoughts or suggestions you may have would be appreciated. Thanks.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
If the
BackgroundWorker
was created from the UI thread, then theRunWorkerCompleted
event will also be raised on the UI thread.If it was created from a background thread, the event will be raised on an undefined background thread (not necessarily the same thread, unless you're using a custom
SynchronizationContext
).Interestingly, this doesn't seem to be all that well-documented on MSDN. The best reference I was able to find was here: