So I create multiple BackgroundWorkers using loop:
foreach (var item in list)
{
worker = new BackgroundWorker();
worker.DoWork += worker_DoWork;
worker.RunWorkerAsync(item);
}
Now I just can't figure how do I check that all those workers finished their job ?
Thanks.
You may keep a list of active workers and let each worker remove itself when finished:
If you don't want to pool IsWorkDone, you could raise an event after
workers.Remove(worker)
if list is empty...Assuming
workers
is the variable representing list of workers and_completedWorkersCount
is the count of workers that have finished their job ....