1

I want to traverse all the children in some container (Grid, Canvas etc) in parallel way. I am not able to find AsParallel() even though i have reference to System.Linq. What should i do as a workaround for this to take advantage of full CPU power of client?

Thanks in advance:)

Frédéric Hamidi
  • 258,201
  • 41
  • 486
  • 479
TCM
  • 16,780
  • 43
  • 156
  • 254
  • 2
    Will AsParallel help? If you're doing any work on the children (setting properties etc.), they'll still have to be serialised onto the UI thread. – Ray Booysen Mar 02 '11 at 15:44
  • Duplicate question to http://stackoverflow.com/questions/2718347/silverlight-4-plinq – Jirapong Mar 02 '11 at 15:47

2 Answers2

3

I am afraid that Parallel extensions didnt make it into SL 4.0

However rewriting function like Parallel.For shouldnt be too hard. You can find required code here in a great Joe Duffys article

http://msdn.microsoft.com/en-us/magazine/cc163427.aspx

Valentin Kuzub
  • 11,703
  • 7
  • 56
  • 93
0

A NuGet package has been available in this area,

http://www.nuget.org/packages/System.Threading.Tasks/

which uses Mono's source code and compiles for Silverlight/Windows Phone/.NET 3.5.

Lex Li
  • 60,503
  • 9
  • 116
  • 147