Walter: any plan to add support for yield/return Iterators/generators?
Marcio
mqmnews321 at sglebs.com
Mon Sep 4 15:19:14 PDT 2006
Hi,
People who have used socket/select without Threads probably had to
suffer writing their own state machine by hand. Some people may have had
adventures in continuation passing land, even.
Recently languages have incorporated yield/iterators/generators which
allows them to code in a more convenient style and have the compiler
deal with all the pain. For an example in C# 2.0 see
http://www.ondotnet.com/pub/a/dotnet/2004/06/07/liberty.html
http://msdn2.microsoft.com/en-us/library/dscyy5s0.aspx
http://www.c-sharpcorner.com/UploadFile/rmcochran/yieldreturn04022006113850AM/yieldreturn.aspx?ArticleID=4617984b-2209-4211-9d08-8f06e0fe2da5
Python has the same thing now:
http://www.python.org/doc/current/ref/yield.html
It turns out this is great to fully leverage multi core with optimal
utilization of system threads while having a lean app. Just read about CCR:
"The Concurrency and Coordination Runtime (CCR) is a lightweight
port-based concurrency library for C# 2.0 developed by George
Chrysanthakopoulos in the Advanced Strategies group at Microsoft. Here
http://channel9.msdn.com/ShowPost.aspx?PostID=143582 , we have a deep
discussion about CCR with George, a Software Architect, and Satnam
Singh, Architect. You can get more info about CCR on the CCR Wiki
http://channel9.msdn.com/wiki/default.aspx/Channel9.ConcurrencyRuntime .
This is super cool stuff and represents a really innovative approach to
making managed threaded programming more readily understandable and
predictable.
Please check out the OOPSLA/SCOOL paper on the CCR
http://research.microsoft.com/~tharris/scool/papers/sing.pdf .
Click here http://channel9.msdn.com/Showpost.aspx?postid=206574 to see
how the CCR is being used by the Microsoft Robotics Group."
CCR Programming http://channel9.msdn.com/ShowPost.aspx?PostID=219308
* article:
http://msdn.microsoft.com/msdnmag/issues/06/09/ConcurrentAffairs/default.aspx
(Relates to Stackless Python too: http://www.stackless.com/)
So, I wonder if D plans to add this feature too? It would be neat to
have a port of CCR to D, but that would require delegates and also yield
support. Check out at least the link
http://msdn.microsoft.com/msdnmag/issues/06/09/ConcurrentAffairs/default.aspx
Thanks,
marcio
More information about the Digitalmars-d
mailing list