Microsoft Developer Network > Forenhomepage > Parallel Extensions to the .NET Framework > How Many Tasks does the Parallel.For spawn?
Stellen Sie eine FrageStellen Sie eine Frage
 

BeantwortetHow Many Tasks does the Parallel.For spawn?

  • Samstag, 27. Juni 2009 22:46Abhijeet Patel TeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillenTeilnehmermedaillen
     
    I'm trying to get a better understanding of the co-relation between the number of tasks and the number of items in the underlying collection on which "Parallel.For" executes. I've noticed that when I call "Parallel.For" on a query which yields say 100 elements, only 2 tasks are created(on my dual core system), I've heard that "Parallel.For" does not create a task per element of the collection on which it is operating on, is this true?
    If so what is the algorithm that "Parallel.For" uses for figuring out how many Tasks to create and which queue should the tasks be queued up at

Antworten

Alle Antworten