1

I had a quick question in c#. Is there a way to have yield statements in a Parallel.ForEach loop? I saw that yield statements are not allowed in anonymous methods, but is there an alternative way in c# to achieve the same functionality, of have "yield return" statements returning elements of a collection in the body of a parallel foreach loop?

svick
  • 236,525
  • 50
  • 385
  • 514
assassin
  • 19,899
  • 10
  • 30
  • 43
  • http://stackoverflow.com/questions/14806240/how-to-yield-from-parallel-tasks-in-net-4-5 http://stackoverflow.com/questions/13381897/anyway-to-parallel-yield-c-sharp http://stackoverflow.com/questions/17021779/thread-safety-of-yield-return-with-parallel-foreach and many many others, not only on SO. Is it so hard to type three words "c# parallel yield" into google? – BartoszKP Sep 29 '13 at 23:11
  • Have you check this? http://stackoverflow.com/questions/8412879/parallel-foreach-yield-return?rq=1 – Stay Foolish Sep 29 '13 at 23:11

0 Answers0