Suppose, I make a BackgroundWorker
like this
private void RunBackgroundWorker(object sender, DoWorkEventArgs e)
{
// Do something lengthy here
// which takes a lot of time
}
private void BackgroundWorkerCompleted(object sender, RunWorkerCompletedEventArgs)
{
System.Threading.Thread.Sleep(2000) ;
BackgroundWorker1.RunWorkerAsync() ;
}
I want to ask whether the contents of BackgroundWorkerCompleted
function are executed on the "Background" thread or the main UI thread. I am asking this because, I am creating a desktop, app which uses the database and constantly updates it's database after every few seconds