0

which on is better for that purpose and why? tanks :)

I check the first one and test it ; its going to work perfectly but I want to know which one is a right way to do t

        List<int> aa = new List<int>();
        aa.Add(1);
        aa.Add(2);
        aa.Add(3);
        foreach (var iu in aa)
        {
            Task.Factory.StartNew(() => StartFollowState(iu));
        }

or

        List<int> aa = new List<int>();
        aa.Add(1);
        aa.Add(2);
        aa.Add(3);
        Parallel.ForEach(lstiu, iu =>
        {
            Task.Factory.StartNew(() => StartFollowState(iu));
        });
keuone72
  • 73
  • 1
  • 8
  • ya but I want to know which one is better on that topic its not saying which one is better – keuone72 Sep 29 '17 at 11:36
  • 1
    did you look on the first answer there? – Crispy Holiday Sep 29 '17 at 11:37
  • I agree with Yarimi. The answer he linked is basically the same question, and the answer given answers yours. The accepted answer literally says "The first is a much better option" and explains why. – Hack Sep 29 '17 at 11:40

0 Answers0