<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Isolation, Agents, and Message-passing in .NET</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/maestroteam/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/maestroteam/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:23:26 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>The State of Axum</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/the-state-of-axum</link>
      <pubDate>Mon, 28 Feb 2011 10:43:58 GMT</pubDate>
      <dc:creator><![CDATA[Garry Trinder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2011/02/28/the-state-of-axum/</guid>
      <description><![CDATA[Those who have followed this blog will have noticed that it’s been a long time since we posted...]]></description>
      <content:encoded><![CDATA[<p>Those who have followed this blog will have noticed that it’s been a long time since we posted anything new about Axum, and the time has come to state publicly that which may have been clear to some but not others, that we’re not currently pursuing productization.</p>  <p>We have seriously examined the possibility of releasing the source code under an OSS license, but that, too, will require time that we don’t have that much of. At this time, no one is assigned paid hours to work on Axum, but we are still entertaining fantasies about an open-source release sometime in the future by doing some extra work during down times.</p>  <p>That said, the incubation effort was very successful in our opinion: several of the concepts embodied in Axum live on in the next versions of C# and .NET: C# and VB will support their own form of asynchronous methods, while .NET is adding support for data-flow constructs following the patterns we set up in Axum and the C++ concurrency runtime.</p>  <p>On the other hand, the concepts around safe parallelism and agent-based programming were seen by many as too far outside the mainstream to be adopted now in languages like C# and VB. The idea of Axum was to not force these concepts on general-purpose languages, so those of us who have work on Axum are not surprised.</p>  <p>It’s disappointing to have to post this kind of entry, but it’s better to acknowledge the situation than to stick our heads in the sand and pretend that everything’s OK.</p>  <p>&#160;</p>  <p>Niklas, Artur &amp; Josh   <br />Axumites</p>]]></content:encoded>
    </item>
    <item>
      <title>Axum for Visual Studio 2010 RTM is here!</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/axum-for-visual-studio-2010-rtm-is-here</link>
      <pubDate>Mon, 26 Apr 2010 22:38:41 GMT</pubDate>
      <dc:creator><![CDATA[artur.laksberg]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2010/04/26/axum-for-visual-studio-2010-rtm-is-here/</guid>
      <description><![CDATA[The feedback we’ve received from our fans has been incredibly useful in shaping our approach to...]]></description>
      <content:encoded><![CDATA[<p>The feedback we’ve received from our fans has been incredibly useful in shaping our approach to agent-based programming, safety and parallelism in general. It continues to play a role in our thinking about the next version of Visual Studio – known here as Dev11.</p>  <p>Since our last release, we were mostly involved in other projects, not the least of which is helping the rest of the team ship Visual Studio 2010. Now that the product is out the door, we were able to devote more effort to Axum, and today I’m happy to announce the <b>availability of the latest release of Axum</b> on <a href="https://msdn.microsoft.com/en-us/devlabs/dd795202.aspx">DevLabs</a>.</p>  <p>The main thrust of this release is making Axum language service (this is the component responsible for the syntax colorization and Intellisense) compatible with the Visual Studio 2010 RTM. We also fixed a few minor issues, but the language itself has remained largely unchanged.</p>  <p>This release is important to us because we want to keep your feedback coming. We also want you to get Visual Studio 2010 – not only will you be able to evaluate Axum, you will get your hands on such technologies as the <a href="https://msdn.microsoft.com/en-us/library/dd504870.aspx">Concurrency Runtime</a> and the <a href="https://blogs.msdn.com/pfxteam">Parallel Extensions to .NET</a>.</p>  <p>Artur Laksberg,   <br />Axumite</p>]]></content:encoded>
    </item>
    <item>
      <title>“The rumors of my death have been greatly exaggerated!”</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/the-rumors-of-my-death-have-been-greatly-exaggerated</link>
      <pubDate>Fri, 19 Mar 2010 08:33:39 GMT</pubDate>
      <dc:creator><![CDATA[Garry Trinder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2010/03/19/the-rumors-of-my-death-have-been-greatly-exaggerated/</guid>
      <description><![CDATA[Thus quipped the great writer Mark Twain after a newspaper supposedly prematurely published his...]]></description>
      <content:encoded><![CDATA[<p>Thus quipped the great writer Mark Twain after a newspaper supposedly prematurely published his obituary, and it seems oddly relevant to Axum right now. In <a href="https://social.msdn.microsoft.com/Forums/en-US/axum/thread/7b7ebe14-fc6f-46b7-9b67-9df381be5d5f" target="_blank">this post</a> on the Axum Forum, an Axum fan asks whether the language effort is dead or not. Let me say that it is more a question of hibernation than death.</p>  <p>Axum was, and still is, an incubation effort. What incubation means at Microsoft is something between research and product development: the aim is not to advance the state of the art, as we do with basic research, nor is it to ship a product in a timely manner. Rather, the purpose of doing an incubation is to assess the feasibility and viability of a technology when market research methodologies aren’t likely to be sufficient: there is no commitment to productize, but there is more to it than just throwing ideas over the wall.</p>  <p>Thus, we developed Axum and got the technology out there in the DevLabs release last year, updated it once, and you haven’t seen anything since.</p>  <p>Shipping a new programming language means committing to many years of maintaining it, so it’s something we would want to make sure we’re doing the right way. The question of what to do with it is on our minds: do we ship it in Visual Studio, should it be a separate release, should we just steal from it and integrate ideas into other languages? Should we find a narrower field that it addresses particularly well (discrete-event simulation, for example) and tailor it for that domain, or is this a more broadly applicable model? (I think it is, but that’s not the point: what our customers think is what matters here.)</p>  <p>Since June last year, we haven’t been idle: there was only three of us on the project to begin with, and now there are two, but both Artur and I are also working on other projects. We have been prototyping integrating Axum concepts into other languages, and we’ve been speaking about Axum, both within Microsoft and externally.</p>  <p>There hasn’t been much in terms of updates to the model, but we have some clear ideas on what we would need to take a closer look at if we productize it:</p>  <ol>   <li>The language runtime needs a complete revamp – it is much too large and complex. We’d probably take a dependency on .NET 4 and give up backward compatibility in the interest of simplicity.      <br /></li>    <li>The parser has pretty awful, often misleading, error messages. We would have to rewrite it.      <br /></li>    <li>I would remove the declared network construct as well as the syntactic support for ‘sync,’ ‘async’ and ‘const’ variables – the semantics would still be there, but in the form of classes only.      <br /></li>    <li>Network expressions – the current set of infix network operators isn’t very extensible. We would revamp this area of the language.      <br /></li>    <li>Syntax for constructing and deconstructing tuple values – one thing I have appreciated in both C++ and F# is how easy it is to use structural types in the form of tuples. This is particularly useful for messaging where ports only take one payload type – make the payload a tuple and, voila! .NET 4 has Tuple as a built-in type: all we need is some syntactic support and we’re off…      <br /></li>    <li>Discriminated unions – we’ve experimented with what Axum would look like if ML were the syntactic basis instead of C. One concrete learning is that discriminated unions make channel declarations so much simpler and we should definitely add them to Axum.      <br /></li>    <li>Schema instances would be immutable. Coercing to other types give you mutability on a pay-for-play basis.      <br /></li>    <li>We would take a closer look at whether the domain and agent concepts can somehow be merged into a single concept without loss of expressiveness. </li> </ol>  <p>There are probably more things that need attention, but those are the ones that come to mind right now.</p>  <p>At PDC 2009, I did a <a href="https://microsoftpdc.com/Sessions/VTL02" target="_blank">breakout session</a> on Axum, which was attended by about 250 people and received very well. For those of you who understand Swedish, I did a <a href="https://channel9.msdn.com/posts/buzzfrog/MSDN-Radio-Special--Niklas-Gustafsson-om-Axum/" target="_blank">podcast</a> with MSDN Radio in Sweden (which made me painfully aware of how hard it is for me to speak about technology in my native tongue. Ouch!).</p>  <p>Three weeks ago, I spoke about Axum at three universities in Denmark: Aarhus, Aalborg, and Copenhagen, and was pleasantly surprised when a customer I visited in Copenhagen wanted to talk about Axum. I had come prepared to talk about other parallel technologies, but they wanted me to do the Axum presentation, too, and they wanted to know what was going to happen to the language. They felt it was a perfect fit for their problems.</p>  <p>I also did an interview with a Danish IT journalist while in Copenhagen, and what she wanted to talk about was Axum.</p>  <p>Next week, I have a session on Axum at <a href="https://www.microsoft.com/sverige/techdays/default.aspx" target="_blank">TechDays 2010</a> in Örebro, Sweden. This is a IT-centric show, so it’ll be interesting to see how Axum is received in comparison with PDC, which has a slightly different audience, more ISV-centric. It could go either way, I guess. There, too, I’ll be doing a couple of press interviews on Axum.</p>  <p>Anyway, I have promised to make a renewed effort to the <a href="https://social.msdn.microsoft.com/Forums/en-US/axum/threads" target="_blank">DevLabs Forum for Axum</a> and we will take a look at whether producing a release of Axum that is compatible with the final release of VS 2010 makes sense.</p>  <p>Thanks,</p>  <p>Niklas Gustafsson</p>]]></content:encoded>
    </item>
    <item>
      <title>Axum at PDC!</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/axum-at-pdc</link>
      <pubDate>Fri, 23 Oct 2009 15:05:00 GMT</pubDate>
      <dc:creator><![CDATA[phillips.joshua]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/10/23/axum-at-pdc/</guid>
      <description><![CDATA[Going to PDC this year?&#160; We are too!  Niklas Gustafsson, the Principal Architect on Axum (and...]]></description>
      <content:encoded><![CDATA[<p>Going to PDC this year?&#160; We are too!</p>  <p>Niklas Gustafsson, the Principal Architect on Axum (and some other jewels like the <a href="https://msdn.microsoft.com/en-us/library/dd460693(VS.100).aspx" mce_href="https://msdn.microsoft.com/en-us/library/dd460693(VS.100).aspx">Parallel Extensions to the .NET Framework</a> and the <a href="https://msdn.microsoft.com/en-us/library/dd504870(VS.100).aspx" mce_href="https://msdn.microsoft.com/en-us/library/dd504870(VS.100).aspx">Concurrency Runtime</a>) will be giving a talk on Axum in the Innovation Track (<a href="https://microsoftpdc.com/Sessions/VTL02" mce_href="https://microsoftpdc.com/Sessions/VTL02">here’s a link to the session’s abstract</a>)!&#160; The date hasn’t been set yet, but keep your eyes peeled for updates.</p>  <p>Also, while you’re there, make sure to check out some of the other parallel computing sessions:</p>  <ul>   <li><a href="https://microsoftpdc.com/Sessions/P09-17" mce_href="https://microsoftpdc.com/Sessions/P09-17">The State of Parallel Programming</a> (by supercomputing luminary Burton Smith) </li>    <li><a href="https://microsoftpdc.com/Sessions/Patterns-of-Parallel-Programming" mce_href="https://microsoftpdc.com/Sessions/Patterns-of-Parallel-Programming">Patterns of Parallel Programming: A Tutorial on Fundamental Patterns and Practices for Parallelism</a> (by Richard Ciapala, Ade Miller, Herb Sutter, and our very own Stephen Toub) </li>    <li><a href="https://microsoftpdc.com/Sessions/P09-09">Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010</a> (by Stephen Toub)</li>    <li><a href="https://microsoftpdc.com/Sessions/FT21" mce_href="https://microsoftpdc.com/Sessions/FT21">PLINQ: LINQ, but Faster!</a> (by Igor Ostrovsky and Ed Essey) </li>    <li><a href="https://microsoftpdc.com/Sessions/FT20" mce_href="https://microsoftpdc.com/Sessions/FT20">F# for Parallel and Asynchronous Programming</a> (by Luke Hoban)</li>    <li><a href="https://microsoftpdc.com/Sessions/P09-09">Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010</a> (by Rick Molloy)</li>    <li><a href="https://microsoftpdc.com/Sessions/SVR10">Lighting up Windows Server 2008 R2 Using the ConcRT on UMS</a> (by Dana Groff)</li> </ul>  <p>Leave us a comment and let us know if you’ll be attending this year. :)</p>  <p>Josh Phillips    <br />Program Manager and Axumite</p>]]></content:encoded>
    </item>
    <item>
      <title>Erlang at Yahoo!</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/erlang-at-yahoo</link>
      <pubDate>Mon, 19 Oct 2009 12:59:39 GMT</pubDate>
      <dc:creator><![CDATA[phillips.joshua]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/10/19/erlang-at-yahoo/</guid>
      <description><![CDATA[Jebu Ittiachen and Arun Suresh of Yahoo! have written an interesting article for Dr. Dobbs about a...]]></description>
      <content:encoded><![CDATA[<p>Jebu Ittiachen and Arun Suresh of Yahoo! have written an <a href="https://www.ddj.com/hpc-high-performance-computing/220600332?cid=RSSfeed_DDJ_HighPerformanceComputing">interesting article</a> for Dr. Dobbs about a prototype they’ve built for Yahoo! Harvester using Erlang. The performance gains they achieved are quite impressive. </p>  <p>Some of the more interesting highlights/discussion points I’ve pulled from the article:</p>  <ul>   <li>The language itself is only part of the draw for Erlang users.&#160; The OTP framework provides great value to those writing distributed applications. “Since the restart functionality is already found in the standard library, no extra code was required to be written.”&#160; What parts of the OTP do you feel are essential?&#160; What’s missing?</li>    <li>It reiterates some of Erlang’s flaws (we’ve heard lots of complaints about syntax).&#160; I read this as a major opportunity for us to provide a highly differentiated solution and increase developer productivity (which is what Visual Studio is all about!).&#160; “Erlang is not the perfect platform.&#160; It has its share of weaknesses and most of it comes from the design goals behind the language.”&#160; What else besides syntax and the lack of true string data types gets in your way?</li>    <li>Performance comparisons.&#160; WOW.&#160; The performance gains on quad-cores are simply incredible.&#160; 100% CPU efficiency and a 3750% increase in MAX capacity per machine.&#160; These numbers show <i>major</i> cost savings&#160; for our customers.&#160; Of course, it all depends on the baseline of which you are comparing against but I think it’s a safe assumption that Yahoo!’s developers are capable of writing fairly scalable, fairly performant code.&#160; </li>    <li>It’s interesting to note that they’re using Erlang “successfully” in 5 properties.&#160; We’re seeing a lot more commercial products written entirely in Erlang or with components written in Erlang.&#160; Some other noteworthy examples include Amazon, Facebook Chat, and Microsoft’s own <a href="https://www.powerset.com">PowerSet</a>.&#160; This trend suggests that companies are willing to overcome the learning curve and employ once-obscure technologies to achieve performance gains and, ultimately, cost savings in both hardware scale-down and developer productivity.&#160; </li> </ul>  <p>Josh</p>]]></content:encoded>
    </item>
    <item>
      <title>Thought Exercise: Axum + F#</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/thought-exercise-axum-f</link>
      <pubDate>Wed, 30 Sep 2009 18:32:10 GMT</pubDate>
      <dc:creator><![CDATA[phillips.joshua]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/09/30/thought-exercise-axum-f/</guid>
      <description><![CDATA[Our friend Matt Podwysocki posted a very fascinating look at why Axum and F# might make a happy...]]></description>
      <content:encoded><![CDATA[<p>Our friend <a href="https://codebetter.com/blogs/matthew.podwysocki/archive/2009/09/25/pondering-axum-f.aspx">Matt Podwysocki posted a very fascinating look at why Axum and F# might make a happy marriage and what that coupling could look like</a>.&#160; We encourage you to take a look and post your comments!</p>  <p>Great stuff – thanks Matt!</p>  <p>The Axum Team</p>]]></content:encoded>
    </item>
    <item>
      <title>What are you building?</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/what-are-you-building</link>
      <pubDate>Wed, 12 Aug 2009 14:53:24 GMT</pubDate>
      <dc:creator><![CDATA[phillips.joshua]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/08/12/what-are-you-building/</guid>
      <description><![CDATA[Hello Axumites!  It’s been a while since we’ve last talked but many of you have silently been...]]></description>
      <content:encoded><![CDATA[<p>Hello Axumites!</p>  <p>It’s been a while since we’ve last talked but many of you have silently been downloading the bits and surely some of you have actually been using them.&#160; As we get further along in our prototyping/planning efforts we want to know how you’ve put Axum to work and what it’s done for you.</p>  <p>What have you built? We’re even interested in hearing about your toy apps.&#160; </p>  <p>Did Axum benefit you?&#160; If so, how?&#160; </p>  <p>Tell us what the single most painful part of you experience was.&#160; </p>  <p>Did you have an epitomic point where the agents model just made sense?</p>  <p>If you haven’t built anything, what would you want to build?&#160; If you have, what do you plan to build next?</p>  <p>Keep experimenting!&#160; We have a series of thought-provoking blog posts coming soon.</p>  <p>Josh   <br />Program Manager, Axum</p>]]></content:encoded>
    </item>
    <item>
      <title>Asynchronous programming in .NET survey</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/asynchronous-programming-in-net-survey</link>
      <pubDate>Mon, 20 Jul 2009 19:30:00 GMT</pubDate>
      <dc:creator><![CDATA[phillips.joshua]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/07/20/asynchronous-programming-in-net-survey/</guid>
      <description><![CDATA[Update:&#160; The survey is now closed.&#160; Thanks to all that participated!    Axumites,...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0in 0in 0pt" class="MsoNormal"><font color="#ff0000" size="3" face="Calibri"><strong>Update:&#160; The survey is now closed.&#160; Thanks to all that participated!</strong></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><font size="3"><font face="Calibri"></font></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><font size="3"><font face="Calibri">Axumites,       <p></p>     </font></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">   <p><font size="3" face="Calibri">&#160;</font></p> </p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><font size="3"><font face="Calibri">We’ve heard our customers’ frustrations with asynchronous programming and their call for improved support.&#160; We are hoping to better understand why and how you and your customers use asynchronous programming in .NET and how the support we provide for it can be improved in the future.       <p></p>     </font></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">   <p><font size="3" face="Calibri">&#160;</font></p> </p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><font size="3"><font face="Calibri">We invite you to complete a short survey on the Asynchronous Programming Model (APM) as well as on a theoretical language construct called “Asynchronous Methods.”&#160; Completing this survey shouldn’t take more than 5-10 minutes of your time, and doing so will help us to better understand where the APM is lacking, how we can make asynchronous programming better and, ultimately, how we can increase your productivity and the scalability and reliability of your code. We encourage you to forward this message on to others who may also have had experience with asynchronous programming.       <p></p>     </font></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">   <p><font size="3" face="Calibri">&#160;</font></p> </p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><a href="https://deploy.ztelligence.com/start/index.jsp?PIN=15TMLTB8M3X9C"><font color="#0000ff" size="3" face="Calibri">https://deploy.ztelligence.com/start/index.jsp?PIN=15TMLTB8M3X9C</font></a><font size="3"><font face="Calibri">        <p></p>     </font></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">   <p><font size="3" face="Calibri">&#160;</font></p> </p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><font size="3"><font face="Calibri">Thank you!       <p></p>     </font></font></p>  <p style="margin: 0in 0in 0pt" class="MsoNormal">   <p><font size="3" face="Calibri">&#160;</font></p> </p>  <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Calibri"><b><span style="color: #365f91"><font size="3">Josh Phillips</font></span></b><b><span style="color: #365f91; font-size: 10pt"> </span></b><span style="color: #365f91; font-size: 10pt">|<b> </b>Program Manager II </span></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Axum 0.2.0 Released!</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/axum-0-2-0-released</link>
      <pubDate>Tue, 23 Jun 2009 21:54:00 GMT</pubDate>
      <dc:creator><![CDATA[phillips.joshua]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/06/23/axum-0-2-0-released/</guid>
      <description><![CDATA[Are you excited?
We thought so.&nbsp; We’ve been listening to some of your pain points with Axum...]]></description>
      <content:encoded><![CDATA[<P>Are you excited?</P>
<P>We thought so.&nbsp; We’ve been listening to some of your pain points with Axum 0.1.0 and went straight to the kitchen to cook up 0.2.0 - now available for your code-slingin’ pleasure.&nbsp; We’ve fixed quite a few bugs and made some overall improvements. For example we’ve,</P>
<UL>
<LI>Added an installer for <A href="https://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&amp;displaylang=en" mce_href="https://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&amp;displaylang=en">Visual Studio 2010 Beta1</A> <BR></LI>
<LI>Enabled parallel execution of functional nodes in dataflow networks <BR></LI>
<LI>Made it possible to change fonts and colors of Axum language elements via Tools | Options | Fonts and Colors <BR></LI>
<LI>Moved samples to a zip file to make using them easier <BR></LI>
<LI>Introduced AxumLite.zip – an Axum command line compiler that doesn't require Visual Studio <BR></LI>
<LI>Fixed the compiler error where the channel name was the same as the enclosing namespace name <BR></LI>
<LI>Made handling of immutable primitive types more rigorous; fixed some side-effect related bugs <BR></LI>
<LI>Added 'using System.Concurrency.Messaging' to the VS-generated template to make classes like OrderedInteractionPoint visible by default <BR></LI>
<LI>Added the async method Microsoft.Axum.IO.Console.ReadLine <BR></LI>
<LI>Added a spiffy Auction sample (A big shout out to <A href="https://weblogs.asp.net/Podwysocki/" mce_href="https://weblogs.asp.net/Podwysocki/">Matthew Podwysocki</A> for his help!) </LI></UL>
<P>Remember, Axum’s success and ability to improve your developer toolkit is very much dependent on your feedback.&nbsp; Please try it, abuse it, and be very vocal about what you think on the <A href="https://social.msdn.microsoft.com/Forums/en/axum/threads" mce_href="https://social.msdn.microsoft.com/Forums/en/axum/threads">forum</A>.&nbsp; We love to hear both good and bad things!</P>
<P><A href="https://download.microsoft.com/download/B/D/5/BD51FFB2-C777-43B0-AC24-BDE3C88E231F/Axum_VS_2008.msi" mce_href="https://download.microsoft.com/download/B/D/5/BD51FFB2-C777-43B0-AC24-BDE3C88E231F/Axum_VS_2008.msi">Axum 0.2.0 for Visual Studio 2008</A><BR><A href="https://download.microsoft.com/download/B/D/5/BD51FFB2-C777-43B0-AC24-BDE3C88E231F/Axum_VS_2010.msi" mce_href="https://download.microsoft.com/download/B/D/5/BD51FFB2-C777-43B0-AC24-BDE3C88E231F/Axum_VS_2010.msi">Axum 0.2.0 for Visual Studio 2010</A><BR><A href="https://download.microsoft.com/download/B/D/5/BD51FFB2-C777-43B0-AC24-BDE3C88E231F/AxumLite.zip" mce_href="https://download.microsoft.com/download/B/D/5/BD51FFB2-C777-43B0-AC24-BDE3C88E231F/AxumLite.zip">Axum Lite</A></P>
<P>Josh Phillips and the Axum Team</P>]]></content:encoded>
    </item>
    <item>
      <title>Yielding with Asynchronous Methods</title>
      <link>https://docs.microsoft.com/archive/blogs/maestroteam/yielding-with-asynchronous-methods</link>
      <pubDate>Sat, 23 May 2009 13:50:55 GMT</pubDate>
      <dc:creator><![CDATA[artur.laksberg]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/maestroteam/2009/05/23/yielding-with-asynchronous-methods/</guid>
      <description><![CDATA[It’s been two weeks since we released the CTP on DevLabs. Thousands of people have downloaded it,...]]></description>
      <content:encoded><![CDATA[<p></p>  <p>It’s been two weeks since we released the CTP on <a href="https://msdn.microsoft.com/en-us/devlabs/dd795202.aspx">DevLabs</a>. Thousands of people have downloaded it, tried it out, and many have sent us their <a href="https://social.msdn.microsoft.com/Forums/en-US/axum/threads/">feedback</a> – thanks for all your input! In the coming weeks we will be releasing a new build that will contain some bug fixes and a few suggested improvements.</p>  <p>One of the features that gets a lot of attention is <a href="https://blogs.msdn.com/maestroteam/archive/2009/05/05/asynchrony.aspx">asynchronous methods</a>. This is what allows us to have thousands and thousands of concurrently running agents without a significant memory footprint. This is what allows us to build responsive IO-heavy applications. It is also a good way to explain how cooperative multitasking works in Axum.</p>  <p>Let’s start with a sample application that I was writing the other day for some other blog post:</p>  <pre class="code"><span style="color: blue">agent </span><span style="color: #2b91af">MainAgent </span>: <span style="color: blue">channel </span><span style="color: #2b91af">Microsoft</span>.<span style="color: #2b91af">Axum</span>.<span style="color: #2b91af">Application
</span>{
    <span style="color: blue">public </span><span style="color: #2b91af">MainAgent</span>()
    {
        <span style="color: blue">var </span>pt <span style="color: blue">= new </span><span style="color: #2b91af">OrderedInteractionPoint</span>&lt;<span style="color: blue">int</span>&gt;();
        
        <span style="color: green">// Set up a dataflow network
        </span>pt <span style="color: blue">==&gt; </span>MultiplyByTwo <span style="color: blue">==&gt; </span>Print;
        
        <span style="color: green">// Send some numbers to the network
        </span><span style="color: blue">for</span>(<span style="color: blue">int </span>i<span style="color: blue">=</span><span style="color: maroon">0</span>; i&lt;<span style="color: maroon">5</span>; i<span style="color: blue">++</span>) pt <span style="color: blue">&lt;-- </span>i;
        
        <span style="color: purple">PrimaryChannel</span><span style="color: blue">::</span>Done <span style="color: blue">&lt;-- </span><span style="color: #2b91af">Signal</span>.Value;
    }
    
    <span style="color: blue">int </span>MultiplyByTwo(<span style="color: blue">int </span>n)
    {
        <span style="color: blue">return </span>n<span style="color: blue">*</span><span style="color: maroon">2</span>;
    }
    
    <span style="color: blue">void </span>Print(<span style="color: blue">int </span>n)
    {
        <span style="color: #2b91af">Console</span>.WriteLine(n);
    }        
}</pre>
<a href="https://11011.net/software/vspaste"></a>

<p>Before you copy it to Visual Studio, compile and run it – quick, what should be the output of the program?</p>

<p>I was trying to demonstrate that the elements of the dataflow network come out of it in the same order as they were put in. The program was supposed to send five numbers through the pipeline and get back the resulting numbers in the right order.</p>

<p>You might be surprised to discover that the program finishes without printing any numbers. Actually, it’s not hard to see why – the agent sends a message to the <i>Done</i> port before the dataflow network gets around to process the numbers. As soon as the runtime receives a message on the <i>Done</i> port, it terminates the application – sayonara!</p>

<p>If you’re like me, you might be tempted to try to “pause” the agent by putting a call to <i>Console.ReadLine</i> before sending a message to the port <i>Done</i>:</p>

<pre class="code"><span style="color: green">// Send some numbers to the network
</span><span style="color: blue">for</span>(<span style="color: blue">int </span>i<span style="color: blue">=</span><span style="color: maroon">0</span>; i&lt;<span style="color: maroon">5</span>; i<span style="color: blue">++</span>) pt <span style="color: blue">&lt;-- </span>i;

<span style="color: green">// Not so fast! Wait until the user hits <br />// return before continuing
</span><span style="color: #2b91af">Console</span>.WriteLine(<span style="color: maroon">&quot;Press Enter to continue...&quot;</span>);
<span style="color: #2b91af">Console</span>.ReadLine();

<span style="color: purple">PrimaryChannel</span><span style="color: blue">::</span>Done <span style="color: blue">&lt;-- </span><span style="color: #2b91af">Signal</span>.Value;</pre>
<a href="https://11011.net/software/vspaste"></a>

<p></p>

<p>Maybe you already see the problem but I didn’t. When I compiled and ran the program, it dutifully asked me to press Enter, which I did, after which it again terminated without printing any numbers!</p>

<p>That’s where it gets interesting.</p>

<p>Because <i>MultiplyByTwo</i> and <i>Print</i> are methods defined in the agent, they cannot run in parallel with each other or with the agent constructor. If they could, they would be able to modify an agent field, resulting in a data race.</p>

<p>For the two methods to execute, the constructor needs to explicitly suspend its execution and give other methods a chance to execute. In other words, it has to cooperatively yield.</p>

<p>In Axum, all methods have to acquire certain permissions before they can start executing concurrently. A method that can mutate domain’s state needs that domain’s <i>writer token</i>; a method defined in an agent needs that agent’s writer token. A method defined in an agent that is defined in a domain needs both tokens. Read-only methods (called <i>true functions</i> in Axum) require <i>reader tokens</i> for the corresponding domain and/or agent. Only one writer token exists per agent or domain, while multiple reader tokens are available. </p>

<p>This might seem complex but the implementation is actually quite straightforward and cheap. The tokens are stored in the TLS and don’t need to be passed from method to method, and there aren’t that many situations where the tokens need to change ownership.</p>

<p>One such situation is calling an asynchronous method, such as <i>receive</i>. When the <i>receive</i> is called and the message isn’t immediately available, the method pauses and releases its tokens to whoever is the next in line to acquire them.</p>

<p>For an <a href="https://blogs.msdn.com/maestroteam/archive/2009/05/05/asynchrony.aspx">asynchronous method</a>, that pause is implemented as a return to the caller, and all the way to the thread pool if all the methods in the call stack are asynchronous. The rest of the method is then transformed by the compiler to run as a continuation. </p>

<p>By the way, I think that the term “asynchronous” to describe such methods is somewhat unfortunate – perhaps a better term would be “pausable” or “restartable” – because the ability to pause and restart is what these methods are all about. As if this were not confusing enough, we also picked different keywords for the experimental C# – <i>­async</i> – and Axum – <i>asynchronous</i>. (We could not use the <i>async</i> keyword in Axum because it was already used for <a href="https://blogs.msdn.com/maestroteam/archive/2009/05/02/empty-full-storage.aspx">something else</a>) </p>

<p>Both the experimental C# and the Axum compiler recognize the methods defined with the <i>async</i>/<i>asynchronous</i> modifier, as well as the <a href="https://msdn.microsoft.com/en-us/library/ms228969.aspx">APM</a> methods, and treat them similarly. </p>

<p>Speaking of the APM methods – if you’ve used the .NET <i>StreamReader</i> class before, you must have noticed that it does not have the APM counterparts of the synchronous methods such as <i>Read</i>, <i>ReadLine</i> etc. Reading a text file line by line is not trivial – you have to read blocks of bytes, finding newlines among them and maintaining the current character position in the buffer so that the next invocation could pick up where the last one left off. Try to do it asynchronously and the complexity quickly becomes unmanageable.</p>

<p>The problem is solved trivially using the asynchronous methods – all you need to do is take the implementation of the <i>TextReader, StreamReader, TextWriter</i> and <i>StreamWriter</i> and sprinkle the methods with the <i>async</i> modifier. That’s all it took for us to make the synchronous methods asynchronous! These classes are now available in the <i>Microsoft.Axum.IO</i> namespace.</p>

<p>This is how the asynchronous <i>ReadLine</i> can be implemented using the classes from the <i>Microsoft.Axum.IO </i>namespace:</p>

<pre class="code"><span style="color: blue">using </span>Microsoft.Axum.IO;
<span style="color: blue">public isolated static class </span>AsyncConsole
{
    <span style="color: blue">public async static string </span>ReadLine()
    {
        <span style="color: blue">var </span>reader = 
            <span style="color: blue">new </span>StreamReader(<br />                <span style="color: #2b91af">System</span>.Console.OpenStandardInput());
        <span style="color: blue">return </span>reader.ReadLine();
    }
}</pre>
<a href="https://11011.net/software/vspaste"></a>

<p></p>

<p>Now the call site looks like this:</p>

<pre class="code"><span style="color: green">// Send some numbers to the network
</span><span style="color: blue">for</span>(<span style="color: blue">int </span>i<span style="color: blue">=</span><span style="color: maroon">0</span>; i&lt;<span style="color: maroon">5</span>; i<span style="color: blue">++</span>) pt <span style="color: blue">&lt;-- </span>i;

<span style="color: green">// Not so fast! Wait until the user hits<br />// return before continuing
</span><span style="color: #2b91af">Console</span>.WriteLine(<span style="color: maroon">&quot;Press Enter to continue...&quot;</span>);
AsyncConsole.ReadLine();
        
<span style="color: purple">PrimaryChannel</span><span style="color: blue">::</span>Done <span style="color: blue">&lt;-- </span><span style="color: #2b91af">Signal</span>.Value;</pre>
<a href="https://11011.net/software/vspaste"></a><a href="https://11011.net/software/vspaste"></a>

<p></p>

<p>Finally, this works correctly and prints out the numbers 0, 2, 4, 6, and 8, as expected.</p>

<p>The next build of the Axum CTP will contain the new <i>Console</i> class – look for it in the <i>Microsoft.Axum.IO</i> namespace.</p>

<p>Artur Laksberg</p>]]></content:encoded>
    </item>
  </channel>
</rss>