Home > threads, yield return > Other Examples of Iterators and Async IO

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).

  1. Anonymous
    December 9, 2008 at 8:07 pm

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


  2. Daniel Earwicker
    December 13, 2008 at 12:00 pm

    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.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: