public override void Main() { ProcessName = "Threaded"; DisplayProcess(); GetFilmItems(); SetItemCount(); var threads = new List <Thread>(); for (ushort i = 1; i <= Pages; i++) { ClassWorker worker = new ClassWorker(_args, FilmItems, i) { }; Thread thread = new Thread(new ThreadStart(worker.DoWork)); threads.Add(thread); thread.Start(); Thread.Sleep(10); } for (int i = 0; i < threads.Count; i++) { Thread thread = threads[i]; thread.Join(); } }
public override void Main() { ProcessName = "Synchronous"; DisplayProcess(); GetFilmItems(); SetItemCount(); ClassWorker worker = new ClassWorker(_args, FilmItems, 0) { }; for (ushort i = 1; i <= Pages; i++) { worker.PageX = i; worker.DoWork(); } }