Pitfalls of (Mis)Using C# Iterators to Implement Coroutines

前端 未结 4 617
刺人心
刺人心 2021-01-31 20:32

I am writing refactoring a Silverlight program to consumes a portion of its existing business logic from a WCF service. In doing so, I\'ve run into the restriction in Silverligh

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 21:19

    You may also want to consider Jeffrey Richter's AsyncEnumerator which is part of his 'power threading' library. He worked together with the CCR team to develop CCR. The AsyncEnumerator is according to Jeffrey more 'lightweight' than the CCR. Personally I've played about with AsyncEnumerator but not with the CCR.

    I haven't used it in anger though - so far I've found the limitations with using enumerators to implement coroutines too painful. Currently learning F# because of amongst other things async workflows (If I remember the name correctly) which look like they're full fledged coroutines or 'continuations' (I forget the correct name or the exact distinctions between the terms).

    Anyway, here's some links:

    http://www.wintellect.com/PowerThreading.aspx

    Channel 9 video on AsyncEnumerator

    MSDN Article

提交回复
热议问题