<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>.NET Micro Framework</title><link>http://blogs.msdn.com/b/netmfteam/</link><description>Team Blog</description><dc:language>en-US</dc:language><generator>Telligent Community 5.6.583.19849 (Build: 5.6.583.19849)</generator><item><title>New NETMF Book out for v4.1 and v4.2</title><link>http://blogs.msdn.com/b/netmfteam/archive/2012/01/09/new-netmf-book-out-for-v4-1-and-v4-2.aspx</link><pubDate>Mon, 09 Jan 2012 21:46:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10254745</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10254745</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2012/01/09/new-netmf-book-out-for-v4-1-and-v4-2.aspx#comments</comments><description>Some of our earliest partners from SJJ Embedded Micro Solutions - Sean Liming and John Malin - have written a book on the latest versions of NETMF.&amp;#160; The book is targeted at the professional audience, hence the name - “Professional's Guide To .NET...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2012/01/09/new-netmf-book-out-for-v4-1-and-v4-2.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10254745" width="1" height="1"&gt;</description></item><item><title>Version 4.2 RTM Today!! (Updated)</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/10/04/version-4-2-rtm.aspx</link><pubDate>Tue, 04 Oct 2011 21:13:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10220020</guid><dc:creator>Colin Miller</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10220020</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/10/04/version-4-2-rtm.aspx#comments</comments><description>We are glad to announce today the RTM of the .NET Micro Framework version 4.2.&amp;#160; You can download the SDK and PK as well as the all sources from our Codeplex project , client_v4_2 branch, at change number 13620 .&amp;#160;&amp;#160; (We will be distributing...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/10/04/version-4-2-rtm.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10220020" width="1" height="1"&gt;</description></item><item><title>So you always wanted to be an angel investor</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/10/04/so-you-always-wanted-to-be-an-angel-investor.aspx</link><pubDate>Tue, 04 Oct 2011 20:57:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10220015</guid><dc:creator>Colin Miller</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10220015</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/10/04/so-you-always-wanted-to-be-an-angel-investor.aspx#comments</comments><description>KickStarter.com was a new one for me.&amp;#160;&amp;#160; There are dozens of interesting projects out there from movies to technology to children’s books.&amp;#160; What all these things have in common is that they need grass roots funding.&amp;#160; At Kickstarter...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/10/04/so-you-always-wanted-to-be-an-angel-investor.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10220015" width="1" height="1"&gt;</description></item><item><title>Cortex Support on NETMF in Open Source Project</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/09/12/cortex-support-on-netmf-in-open-source-project.aspx</link><pubDate>Mon, 12 Sep 2011 21:05:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10209596</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10209596</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/09/12/cortex-support-on-netmf-in-open-source-project.aspx#comments</comments><description>There is a lot of interest in the Cortex M series platforms these days.&amp;#160; One reason that these are interesting for very small devices like .NET Micro Framework is that they use a new instruction set – Thumb2 – that is more compact than the one used...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/09/12/cortex-support-on-netmf-in-open-source-project.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10209596" width="1" height="1"&gt;</description></item><item><title>NETMF Version 4.2 Release Candidate 2</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/08/30/netmf-version-4-2-release-candidate-2.aspx</link><pubDate>Tue, 30 Aug 2011 21:19:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10203142</guid><dc:creator>Colin Miller</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10203142</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/08/30/netmf-version-4-2-release-candidate-2.aspx#comments</comments><description>We have just posted the second Release Candidate for .NET Micro Framework version 4.2.&amp;#160; We decided to do another release candidate so that we could take a few more features from the community and so that we could get a little more exposure to some...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/08/30/netmf-version-4-2-release-candidate-2.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10203142" width="1" height="1"&gt;</description></item><item><title>NETMF 4.2 Contributor and a Cool Product</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/08/24/netmf-4-2-contributor-and-a-cool-product.aspx</link><pubDate>Wed, 24 Aug 2011 15:18:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10199743</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10199743</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/08/24/netmf-4-2-contributor-and-a-cool-product.aspx#comments</comments><description>It is great to be able to highlight a valuable contribution to the 4.2 codebase and a cool application of the platform at the same time. The contribution is from Richard Scott at Pulsecor ( http://www.pulsecor.com/ ). People have asked for examples of...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/08/24/netmf-4-2-contributor-and-a-cool-product.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10199743" width="1" height="1"&gt;</description></item><item><title>NETMF 4.2 – Regular Expressions</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/08/18/netmf-4-2-regular-expressions.aspx</link><pubDate>Thu, 18 Aug 2011 15:38:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10197384</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10197384</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/08/18/netmf-4-2-regular-expressions.aspx#comments</comments><description>With the 4.2 release just around the corner, I wanted to highlight another contributions from the community – specifically in this case, Regular Expressions. This feature was contributed by Julius Friedman.&amp;#160; Regular Expressions This is desktop compatible...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/08/18/netmf-4-2-regular-expressions.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10197384" width="1" height="1"&gt;</description></item><item><title>NETMF Student and Hobbyist projects</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/08/10/netmf-student-and-hobbyist-projects.aspx</link><pubDate>Wed, 10 Aug 2011 16:34:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10194533</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10194533</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/08/10/netmf-student-and-hobbyist-projects.aspx#comments</comments><description>The last few blogs have highlighted some of the NETMF uses at the Imagine Cup.&amp;#160; These are presumably products that are targeting commercial applications and both of these project teams are exploring the road to bringing their products to market.&amp;#160;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/08/10/netmf-student-and-hobbyist-projects.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10194533" width="1" height="1"&gt;</description></item><item><title>Imagine Cup and NETMF (Part 2)</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/08/01/imagine-cup-and-netmf-part-2.aspx</link><pubDate>Mon, 01 Aug 2011 16:35:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10191706</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10191706</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/08/01/imagine-cup-and-netmf-part-2.aspx#comments</comments><description>The team that won the Software Design category was Team Hermes from Sligo, Ireland. This team created an application that addressed the issue of the high rate of traffic fatalities In Ireland with a classically ‘Internet of Things’ solution. They instrumented...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/08/01/imagine-cup-and-netmf-part-2.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191706" width="1" height="1"&gt;</description></item><item><title>Imagine Cup and NETMF (Part 1)</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/07/29/imagine-cup-and-netmf-part-1.aspx</link><pubDate>Fri, 29 Jul 2011 15:20:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10191137</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10191137</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/07/29/imagine-cup-and-netmf-part-1.aspx#comments</comments><description>The Imagine Cup just finished an once again there were some great projects as always.&amp;#160; This year, even more than in the past, there were a number of projects that included the .NET Micro Framework platform.&amp;#160; I have had the opportunity to talk...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/07/29/imagine-cup-and-netmf-part-1.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10191137" width="1" height="1"&gt;</description></item><item><title>Internet of Things and StreamInsight</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/07/12/internet-of-things-and-streaminsight.aspx</link><pubDate>Tue, 12 Jul 2011 13:43:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10185540</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10185540</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/07/12/internet-of-things-and-streaminsight.aspx#comments</comments><description>The Internet of Things (IoT) is gaining momentum with more and more investment from governments and companies being announced all the time.&amp;#160; There is still some complexity to the development of solutions in this segment because the solutions require...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/07/12/internet-of-things-and-streaminsight.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10185540" width="1" height="1"&gt;</description></item><item><title>NETMF 4.2 – Other CodePlex NETMF Projects</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/06/27/netmf-4-2-other-codeplex-netmf-projects.aspx</link><pubDate>Mon, 27 Jun 2011 14:11:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10179432</guid><dc:creator>Colin Miller</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10179432</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/06/27/netmf-4-2-other-codeplex-netmf-projects.aspx#comments</comments><description>In this latest release of the .NET Micro Framework we have tried to acknowledge some of the great contributions from the community and we will continue to do that.&amp;#160; In addition, there are great contributions happening at our partner’s sites.&amp;#160;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/06/27/netmf-4-2-other-codeplex-netmf-projects.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10179432" width="1" height="1"&gt;</description></item><item><title>NETMF 4.2 – Porting Kit Studio</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/06/20/netmf-4-2-porting-kit-studio.aspx</link><pubDate>Mon, 20 Jun 2011 18:47:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10177119</guid><dc:creator>Colin Miller</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10177119</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/06/20/netmf-4-2-porting-kit-studio.aspx#comments</comments><description>Version 4.2 went to Beta a few days ago with an impressive assortment of contributions from the community.&amp;#160; One contribution stands out for its scope and ambition.&amp;#160; That contribution is the PKStudio contributed by Alexandr Surkov and Igor Kiselev...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/06/20/netmf-4-2-porting-kit-studio.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10177119" width="1" height="1"&gt;</description></item><item><title>NETMF Version 4.2 Beta now available</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/06/07/netmf-version-4-2-beta-now-available.aspx</link><pubDate>Tue, 07 Jun 2011 17:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10172218</guid><dc:creator>Colin Miller</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10172218</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/06/07/netmf-version-4-2-beta-now-available.aspx#comments</comments><description>&lt;p&gt;Today, we have posted the Beta bits for the NETMF version 4.2 release to &lt;a href="http://netmf.codeplex.com/"&gt;CodePlex&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;There are some great additional features beyond what we announced for the &lt;a href="/b/netmfteam/archive/2011/03/24/netmf-4-2-alpha-available.aspx"&gt;4.2 Alpha release&lt;/a&gt; (cryptographic primitives, PWM, FTP,&amp;hellip;). These include:&lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/06/07/netmf-version-4-2-beta-now-available.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10172218" width="1" height="1"&gt;</description></item><item><title>Do You Have a Commercial Product Using NETMF?</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/06/03/do-you-have-a-commercial-product-using-netmf.aspx</link><pubDate>Fri, 03 Jun 2011 23:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10171253</guid><dc:creator>Colin Miller</dc:creator><slash:comments>11</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10171253</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/06/03/do-you-have-a-commercial-product-using-netmf.aspx#comments</comments><description>&lt;p&gt;I am always being asked for examples of what NETMF is used for. I am also frequently surprised by what people are doing with it. Since going Open Source, there is not an obvious way for me to find out what people are doing with the product and the result is that my list of applications is getting a little stale&lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/06/03/do-you-have-a-commercial-product-using-netmf.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10171253" width="1" height="1"&gt;</description></item><item><title>NETMF at TechEd 2011</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/05/23/netmf-at-teched-2011.aspx</link><pubDate>Mon, 23 May 2011 14:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10167327</guid><dc:creator>Colin Miller</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10167327</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/05/23/netmf-at-teched-2011.aspx#comments</comments><description>&lt;p&gt;Just got back form TechEd 2011 where Microsoft&amp;rsquo;s smallest platform had the biggest booth (no kidding). We also had a lot of help manning the booth &amp;ndash; thanks to all the volunteers there. The word got out that we had some cool demos as well. Here is what we were showing.&lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/05/23/netmf-at-teched-2011.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10167327" width="1" height="1"&gt;</description></item><item><title>.NET Gadgeteer Live as an Open Source Project</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/05/02/net-gadgeteer-live-as-an-open-source-project.aspx</link><pubDate>Mon, 02 May 2011 19:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10160103</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10160103</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/05/02/net-gadgeteer-live-as-an-open-source-project.aspx#comments</comments><description>&lt;p&gt;Over the last 7 months, we have shown the .NET Gadgeteer to a number of internal and external parties. The response is almost always the same &amp;ndash; where can I get one?&lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/05/02/net-gadgeteer-live-as-an-open-source-project.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10160103" width="1" height="1"&gt;</description></item><item><title>New Kits from GHI Electronics</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/04/28/new-kits-from-ghi-electronics.aspx</link><pubDate>Thu, 28 Apr 2011 15:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10159147</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10159147</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/04/28/new-kits-from-ghi-electronics.aspx#comments</comments><description>&lt;p&gt;In case you haven&amp;rsquo;t been out to the GHI site in the last few days, they just &lt;a href="http://www.ghielectronics.com/catalog/category/38"&gt;announced a new set of kits&lt;/a&gt;. These kits are intended to give you an easy on-ramp to building things. &lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/04/28/new-kits-from-ghi-electronics.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10159147" width="1" height="1"&gt;</description></item><item><title>The Curious Cloud Contest</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/04/19/the-curious-cloud-contest.aspx</link><pubDate>Tue, 19 Apr 2011 15:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10155788</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10155788</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/04/19/the-curious-cloud-contest.aspx#comments</comments><description>&lt;p&gt;It has been a busy month getting ready for MIX 2011 in Las Vegas last week. We put together a cool challenge for some of the attendees &amp;ndash; a challenge that was maybe a little too challenging but still fun.&lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/04/19/the-curious-cloud-contest.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10155788" width="1" height="1"&gt;</description></item><item><title>NETMF 4.2 Alpha Available</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/03/24/netmf-4-2-alpha-available.aspx</link><pubDate>Thu, 24 Mar 2011 17:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10145463</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10145463</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/03/24/netmf-4-2-alpha-available.aspx#comments</comments><description>&lt;p&gt;I&amp;rsquo;m a bit tardy on this announcement since the release has been available for almost 10 days now but things are pretty busy here. On March 15th, we posted an alpha version of the 4.2 release. The features that are available in this early look are security improvements, FTP Support, a PWM Object, and a number of fixes to the issues that you have reported in the &lt;a href="http://netmf.codeplex.com/workitem/list/advanced"&gt;issue tracker&lt;/a&gt; on the&lt;a href="http://netmf.codeplex.com/workitem/list/advanced"&gt; CodePlex project&lt;/a&gt;.&lt;/p&gt;...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/03/24/netmf-4-2-alpha-available.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10145463" width="1" height="1"&gt;</description></item><item><title>Thread Communication and Synchronization</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/02/01/thread-communication-and-synchronization.aspx</link><pubDate>Tue, 01 Feb 2011 18:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10123277</guid><dc:creator>Colin Miller</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10123277</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/02/01/thread-communication-and-synchronization.aspx#comments</comments><description>&lt;p&gt;After the last blog on &lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/01/17/threads-and-thread-priorities-in-netmf.aspx"&gt;Threads and Thread Priorities&lt;/a&gt;, readers asked for a continuation on Thread Communication and Synchronization. Before I jump in, I have to reiterate that concurrency is a complex issue. I won&amp;rsquo;t try to compete with the technical books on the subject that run to hundreds of pages. I will focus on some basic examples of what is available in NETMF to support the concepts introduced in books like that. That means that you can take what you learn here and still get trouble if you are not careful.&lt;/p&gt;
&lt;h2&gt;Shared Resources &amp;ndash; Locking Critical Sections&lt;/h2&gt;
&lt;p&gt;The most common interaction between threads is through shared resources. We can define a static resource that several threads can interact with. Here is a simple example where I have the main thread and one additional thread &amp;ndash; both of which use a counter (s_IncCounter). The main thread prints it out and the worker thread increments it 5 times and then checks its work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;private static int s_IncCount = 0; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;public static void Main() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread thread1 = new Thread(Thread1); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; thread1.Start(); &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (true) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(5000); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print("Thread Execution Count = " + s_IncCount); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;} &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;private static void Thread1() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (true) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int j = 0; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 5; i++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_IncCount++; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int ii = 0; ii &amp;lt; 1000; ii++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = s_IncCount % 5; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (j != 0) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print("s_IncCount % 5 is: " + j.ToString()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;} &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The output of the execution of this application shows that we are getting slightly fewer than 700 increments every 5 seconds. We will use this measurement to see what the overhead of the thread synchronization mechanisms are. Also notice that the worker thread checks to see if exactly 5 increments have been done. There are no instances where we see that error message. It doesn&amp;rsquo;t mean that there is not some interaction between the two threads but since only one is writing to the shared resource (s_IncCounter), the interactions don&amp;rsquo;t have any side-effects.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-89-90-metablogapi/7411.clip_5F00_image001_5F00_2BD1AEBE.png"&gt;&lt;img height="210" width="244" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-89-90-metablogapi/4784.clip_5F00_image001_5F00_thumb_5F00_54AC9DFA.png" alt="clip_image001" border="0" title="clip_image001" style="display: inline; border-width: 0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s add a second thread. This one exactly matches the first worker thread.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;private static void Thread2() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (true) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int j = 0; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 5; i++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_IncCount++; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int ii = 0; ii &amp;lt; 1000; ii++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = s_IncCount % 5; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (j != 0) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print("s-IncCount % 5 is: " + j.ToString()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;We start both threads in the main thread.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;thread1.Start(); &lt;br /&gt;thread2.Start();&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When we run these, we immediately see that both threads are reporting problems. Thread 1 is being interrupted in the middle of making its 5 increments and then Thread 2 starts up from there and runs some unknown number of times. The result can be seen below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-89-90-metablogapi/4760.clip_5F00_image002_5F00_745B77C2.png"&gt;&lt;img height="244" width="188" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-89-90-metablogapi/4452.clip_5F00_image002_5F00_thumb_5F00_34255E48.png" alt="clip_image002" border="0" title="clip_image002" style="display: inline; border-width: 0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even with three threads competing for time slices, the total throughput (increments/sec) do not change. The thread swapping is very low overhead in NETMF.&lt;/p&gt;
&lt;p&gt;So, what we are seeing is just one of the pitfalls of a multithreaded environment that is called a race condition. That means that the results of your program are being determined by two threads racing against each other to complete their tasks. That is clearly not what you want. For our program to function smoothly, we need the portions of each thread that work on the shared resource to complete entirely (ie increment all 5 times then then swap out). Stated another way, those lines of code need to execute &amp;lsquo;atomically&amp;rsquo; &amp;ndash; as if they were one undisturbed machine instruction. Let&amp;rsquo;s look at the support NETMF has for this.&lt;/p&gt;
&lt;p&gt;First, there is the &lt;b&gt;Interlocked&lt;/b&gt; class that you saw in the previous article. The Interlocked class lets you perform a prescribed set of operations on a resource atomically. That set of operations that are supported are the methods to this class. The syntax for this is &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Interlocked.Increment(ref s_IncCount);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You might not think you even need this lock &amp;ndash; isn&amp;rsquo;t one line of code an atomic thing in itself? In fact it isn&amp;rsquo;t. To do the increment, the value is copied from the variable and into a register, incremented there, and then copied back to the variable in three separate instructions and the thread can be swapped out anywhere during that time.&lt;/p&gt;
&lt;p&gt;What if you need to do more than the Interlocked class supports (a more complex operation on the resource or operations on several resources) and you need it to all complete before someone else can touch the resources. That is where the Lock mechanism comes in. In our example, we want to execute a number of steps on the counter and test what we did before we let anyone else have access to it. To do this, I first define an object that the will be used by the lock to identify it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;private static object s_IncLock = new object();&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now I add a lock that looks like this in each of our threads:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;private static void Thread1() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (true) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int j = 0; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock (s_IncLock) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print("Lock 1"); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 5; i++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s_IncCount++; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int ii = 0; ii &amp;lt; 1000; ii++) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = s_IncCount % 5; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (j != 0) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print("s_IncCount % 5 is: " + j.ToString()); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With these locks, our output no longer has the race condition and the message reflecting the race condition is no longer showing up.&lt;/p&gt;
&lt;p&gt;There is an interesting interaction between the Lock and the thread scheduler. Without the lock, each thread would execute for its 20 mSec before yielding. That would be many iterations of the while loop in each time slice. However, the thread scheduler takes locks into consideration in the following way &amp;ndash; when each thread asks for the lock, the scheduler sees if there is anyone waiting for that lock. The priority goes to the thread that has been waiting the longest so the two threads we have defined end up executing the lock one time each and swapping back and forth. &lt;/p&gt;
&lt;p&gt;The output looks like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-89-90-metablogapi/8081.clip_5F00_image003_5F00_3AD867CB.png"&gt;&lt;img height="244" width="222" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-89-90-metablogapi/0574.clip_5F00_image003_5F00_thumb_5F00_1331EBA1.png" alt="clip_image003" border="0" title="clip_image003" style="display: inline; border-width: 0px;" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Swapping out for each iteration through the while loop still does not change the number of iterations in a measurable way. You can see that locking and thread swapping is REALLY low overhead.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;MethodImplOptions Attribute&lt;/h2&gt;
&lt;p&gt;There is a way to lock a method as opposed to a critical section within a method. That is using the MethodImplOptions attribute. The syntax looks like:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[MethodImpl(MethodImplOption.Synchronized)] &lt;br /&gt;public void MySynchronizedMethod() &lt;br /&gt;{ &lt;br /&gt;&amp;hellip;. &lt;br /&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This locks the method so that only one thread can access it at a time. If one thread is in the method when it is swapped out and another thread tries to access that method, the second thread blocks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Monitor Class&lt;/h2&gt;
&lt;p&gt;Before we leave locks, it is worth mentioning that NETMF supports the &lt;strong&gt;Monitor&lt;/strong&gt; class which does effectively the same thing as the lock mechanism &amp;ndash; it defines a critical section and blocks other threads from entering that section while there is a lock on it. Monitors are a little more flexible because they are not limited to using braces to define scope. With Monitors, you can exit your Monitor anywhere&amp;ndash; possibly in different paths of execution. This flexibility comes with more risk making it easier to have a path of execution where the Monitor does not Exit(object) or Exit(object) is called more than Enter(object) is called.&lt;/p&gt;
&lt;p&gt;The NETMF Monitor class is simpler than the full .NET Monitor implementation in that it lacks event wait handles. For those, you have to use the mechanisms described next.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Thread synchronization - Events&lt;/h2&gt;
&lt;p&gt;At times, you want to synchronize threads directly &amp;ndash; ie run this thread when another thread enters some specific state. There are two ways to do this &amp;ndash; one general and one used specifically for UI interactions. First let&amp;rsquo;s look at Events.&lt;/p&gt;
&lt;p&gt;Events are the same mechanism that is available on the full .NET Framework with some minor differences. You can define an event that will control the execution of a thread. In the full .NET Framework, there is a richer semantic that supports waiting for one event, one of several events, or all events to occur. In NETMF, we only support waiting for a single event. First you define an event something like this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;static AutoResetEvent autoEvent = new AutoResetEvent(false);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This sets up the event in an initial state of &amp;lsquo;false&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;Now let&amp;rsquo;s add a third thread to our sample application that looks like this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;private static void Thread3() &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print(" Waiting for 10000 iterations"); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoEvent.WaitOne(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print("Finally got the 10000 iterations"); &lt;br /&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This thread is entered on its Start() call and prints out the message that it is waiting for 10000 iterations and then enters a suspended state until the event triggers (becomes true). In the other threads we add a test after we increment:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;if (s_IncCount &amp;gt;= 10000) &lt;br /&gt;{ &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; autoEvent.Set(); &lt;br /&gt;}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When the event is Set(), the third thread is unblocked and the scheduler will pick it up quickly since it hasn&amp;rsquo;t run in some time. Thread3 writes out its second message and then exits and the other threads continue as expected.&lt;/p&gt;
&lt;p&gt;The semantics of the AutoResetEvent class are that when set to false (unsignalled) it will block any thread calling the WaitOne() method on that event. Once the event is signaled by someone calling the Set() method on that event the AutoResetEvent unblocks the thread and then returns to the unsignalled state once again blocking. The MaunalResetEvent supports a slightly different set of behaviors. The ManualResetEvent also unblocks threads that have a WaitOne() call when the event is Set(). However, the ManualResetEvent does not automatically go back into an unsignalled state one it unblocks the thread. It stay in a signaled state until its Reset() is called. That means that all calls to WaitOne() return immediately.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Thread Synchronization with the Dispatcher &lt;/h2&gt;
&lt;p&gt;If you have created a graphical UI for your application using NETMF, then you actually have another thread that is created by the CLR &amp;ndash; this is the Dispatcher thread that coordinates the access to all of the UI elements in a thread safe manner. The fact that you now have at least two threads means that you have to manage the access to anything that might be a shared resource. Since your UI logic is sharing the UI elements with the CLR created thread which is actually rendering them and there is no way to define a lock that the Dispatcher thread knows about, there is a different way to safely update the UI resources. &lt;/p&gt;
&lt;p&gt;The way to synchronize the two threads is to not execute the code that interacts with the UI Elements on your thread but to execute it on the Dispatcher thread instead. To do this, you define a delegate that the Dispatcher will call back to, you implement the delegate, and you call Dispatcher.BeginInvoke when you want the Dispatcher to invoke your method. (There is also a Dispatcher.Invoke call that is synchronous so you need to define a maximum amount of time you will allow this call the wait for delegate to be called.) There is a previous blog on this topic specifically The Dispatcher and DispatchTimer called &lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2008/03/04/using-the-dispatcher.aspx"&gt;Using the Dispatcher&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;This is a rather long blog but this is also a fairly complex subject. We have covered Interlocked, locks, MethodImplOptions, Monitors, Events, and (indirectly) synchronizing with the Dispatcher. Hopefully this is helpful.&lt;/p&gt;
&lt;div class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/.NET+Micro+Framework"&gt;.NET Micro Framework&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/NETMF"&gt;NETMF&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Threads"&gt;Threads&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Thread+Communication"&gt;Thread Communication&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Thread+Synchronization"&gt;Thread Synchronization&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Locks"&gt;Locks&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/InterLocked"&gt;InterLocked&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Monitor+Class"&gt;Monitor Class&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Dispatcher"&gt;Dispatcher&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/AutoResetEvent"&gt;AutoResetEvent&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/ManualResetEvent"&gt;ManualResetEvent&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10123277" width="1" height="1"&gt;</description></item><item><title>Where to find NETMF this Spring</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/01/31/where-to-find-netmf-this-spring.aspx</link><pubDate>Tue, 01 Feb 2011 00:15:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10122866</guid><dc:creator>Colin Miller</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10122866</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/01/31/where-to-find-netmf-this-spring.aspx#comments</comments><description>This is a busy spring for conferences for the platform.&amp;#160; Here is a partial list of places that you can look for us.&amp;#160; Spread the word about these events so that people can get hands on with the product and get any questions that they have answered...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/01/31/where-to-find-netmf-this-spring.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10122866" width="1" height="1"&gt;</description></item><item><title>Threads and Thread Priorities in NETMF</title><link>http://blogs.msdn.com/b/netmfteam/archive/2011/01/17/threads-and-thread-priorities-in-netmf.aspx</link><pubDate>Mon, 17 Jan 2011 21:32:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10116777</guid><dc:creator>Colin Miller</dc:creator><slash:comments>13</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10116777</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2011/01/17/threads-and-thread-priorities-in-netmf.aspx#comments</comments><description>I started this article with the objective of providing a more up to date discussion of thread priorities. I thought first that I should cover a little about threads just in case. If you are already conversant in threads, jump ahead to the Thread Priorities...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2011/01/17/threads-and-thread-priorities-in-netmf.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10116777" width="1" height="1"&gt;</description></item><item><title>A New Book Experience!!</title><link>http://blogs.msdn.com/b/netmfteam/archive/2010/12/16/a-new-book-experience.aspx</link><pubDate>Thu, 16 Dec 2010 16:21:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10105975</guid><dc:creator>Colin Miller</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10105975</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2010/12/16/a-new-book-experience.aspx#comments</comments><description>There is a new book that is not completely out yet but I am really excited about it.&amp;#160; The book is ‘Getting Started with the Internet of Things’ by Cuno Pfister. ( http://oreilly.com/catalog/0636920013037 ) There are a number of reasons that I really...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2010/12/16/a-new-book-experience.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10105975" width="1" height="1"&gt;</description></item><item><title>Need Help Getting Started with NETMF?</title><link>http://blogs.msdn.com/b/netmfteam/archive/2010/12/06/need-help-getting-started-with-netmf.aspx</link><pubDate>Mon, 06 Dec 2010 21:45:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10100996</guid><dc:creator>Colin Miller</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/netmfteam/rsscomments.aspx?WeblogPostID=10100996</wfw:commentRss><comments>http://blogs.msdn.com/b/netmfteam/archive/2010/12/06/need-help-getting-started-with-netmf.aspx#comments</comments><description>Updated with new location. and new content description and translation ‘challenge’ Are you a .NET programmer who needs some background in embedded interfaces?&amp;#160; Not sure how to debounce a button or why you might want to do that?&amp;#160; Maybe you even...(&lt;a href="http://blogs.msdn.com/b/netmfteam/archive/2010/12/06/need-help-getting-started-with-netmf.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10100996" width="1" height="1"&gt;</description></item></channel></rss>
