I have moved!

I've moved my blog

Tuesday, 9 December 2008

Other Examples of Iterators and Async IO

The idea of returning functions via yield return to simply asynchronous IO programming has a precedent in Microsoft's Concurrency and Coordination Runtime:


Although they are yielding interfaces, really they are yielding functions:


The ITask interface has only one really important method: Execute, which means that really it's a function (a delegate in C# terms). I think the functional style makes the whole thing cleaner, but the point is that the idea was already in use in the Microsoft's CCR, perhaps as long ago as 2005 (although that's difficult to verify).


Anonymous said...

The code in the CCR is also based on Jeffrey's code. Here is the video


Daniel Earwicker said...

I can't understand why Jeffrey now recommends something that is harder to get right, i.e. manually yielding the correct integer value for the number of asynchronous operations launched.