There really isn't enough code here to see what the problem might be. But a few suggestions.
If you are only updating a progess bar, look at the
BackgrouWorker.
If you don't wish to use that, ThreadPool threads provide threads that don't have the overhead of
new Thread
.
DownloadFileAsync
and other async calls actually create and use threads themselves (based on observation they appear to be ThreadPool threads).
Remember you CAN'T update the UI from a separate thread, You MUST do something like
private void UpdateUI(int progress)
{
if(frmMain.InvokeRequired)
{
Action d = UpdateUI;
this.Invoke(d, new object[]{progress};
return;
}
progressBar1.Value = progress;
}
Finally I would check and see if you are somehow erring out on your code, it may be as simple as you are trying to update the UI from the wrong thread.