вторник, 16 марта 2010 г.

C# iterators based scheduling

If you ask Google about asynchronous iterators you'll see that a lot of people have been using C# iterators for doing things that iterators were not supposed to do in the first place - from effective and convinient IO to microthreading and cooperative multitasking.
Several months ago being influenced by CCR iterators and AsyncEnumerator I tried to create microthreading library that could schedule microthreads on many OS threads and be integrated with different async patterns - from APM through EAP to TPL's Tasks. The early prototype looked promising but iterators are really optimzed for generating sequences effectively so there are some restrictions and inconveniences.
I hope the implementation of  resumable methods that may appear in future C# will let us build on top of it all aforementioned scenarios, and even those which the future methods are not supposed to be used for.

Why iterators were implemented the way they were implemented in Eric Clipperts' serie on iterator blocks.

1 комментарий: