I needed parallel processing of the queue, I implemented it, but there is a problem in that at a certain place of the handler I need to implement stopping the thread for a certain time.
Launch Parallel:
Parallel.ForEach(list, Start);
Handler:
private void Start(string param) { Class class = new class(param); class.Start(); } Class.Start public void Start() { DownloadAll(); //.... }
And in the DownloadAll
method, I need to implement stopping the stream for a certain time (set programmatically). Thread.Sleep
, as I understand it, does not fit here. I ask for help, preferably with sample code.
Thread.Sleep
does not work. - Pavel Mayorov