Why lambdas seem broken in multithreaded environments (or how closures in C# works).

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Tue, 20 Apr 2010 00:00:00 GMT Indexed on 2010/04/20 23:03 UTC
Read the original article Hit count: 149

Filed under:
Ive been playing around with some code for.NET 3.5 to enable us to split big operations into small parallel tasks. During this work I was reminded why Resharper has the Access to modified closure warning. This warning tells us about a inconsistency in handling the Immutable loop variable created in a foreach loop when lambdas [...]...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner