<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Clay Lenhart's Blog &#187; F#</title>
	<atom:link href="http://clay.lenharts.net/blog/tag/f/feed/" rel="self" type="application/rss+xml" />
	<link>http://clay.lenharts.net/blog</link>
	<description>A blog on .Net and SQL Server</description>
	<lastBuildDate>Tue, 31 Oct 2017 10:34:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.2</generator>
	<item>
		<title>The &#8220;Many Core&#8221; Problem</title>
		<link>http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/</link>
		<comments>http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 23:03:31 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Multithread]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=43</guid>
		<description><![CDATA[We, as developers, have a problem.  CPUs will continue to have more cores, and each core is not going to be any faster.  The only way to write faster applications is to write multithreaded code, which has two challenges: 1) Multithreaded code is complex to write and think about. 2)Multithreaded code is difficult to test.  From what I've seen, people are pursuing 4 approaches. 
 <a href="http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>We, as developers, have a problem.  CPUs will continue to have more cores, and each core is not going to be any faster.  The only way to write faster applications is to write multithreaded code, which has two challenges:</p>
<ul>
<li>Multithreaded code is complex to write and think about.</li>
<li>Multithreaded code is difficult to test.</li>
</ul>
<p>From what I&#8217;ve seen, people are pursuing 4 approaches. <span id="more-43"></span></p>
<p><strong>Better Languages</strong></p>
<p>If languages are the whole answer, the language has to make it impossible to write multithreaded bugs, otherwise you only address the first problem (the complexity).</p>
<p>Erlang is one such language that removes whole class of multithreaded bugs. Erlang&#8217;s approach is to isolate the threads, and give them a way to pass messages to each other.  However programming in Erlang is awkward and arguably it makes the code more complex.</p>
<p>Other languages, like Clojure and F#, take a different approach and make it easier to write and deal with multithreaded issues, however they don&#8217;t prevent you from writing multithreaded bugs.  These languages do not address the whole problem as you still need a way to test the code.</p>
<p><strong>Better Libraries</strong></p>
<p>Microsoft has a library for .Net called <a href="http://msdn.microsoft.com/en-us/magazine/cc163340.aspx">Parallel Task Library </a>to make it easier to write multithreaded code.  Need to operate on each element in an array?  Use the Parallel.For() method.  This library makes it easier to think and write multithreaded code, but it doesn&#8217;t make it any easier to test.</p>
<p><strong>Static Code Analyzer</strong></p>
<p>Java has a static code analyzer that is able to find multithreading bugs called <a href="http://findbugs.sourceforge.net/">FindBugs</a>.  It looks at your code and reports any code that will cause multithreaded bugs.  This would address the second issue, because it, in theory, reports all threading bugs.  It doesn&#8217;t however address the first issue, making the code easier to write.</p>
<p><strong>Testing with Deterministic Threads</strong><strong><br />
</strong></p>
<p>Microsoft is going in a different direction.  They are working on something called <a href="http://research.microsoft.com/~madanm/papers/osdi2008-CHESS.pdf">CHESS</a> that makes your unit tests find multithreaded bugs.  It does this by taking over the scheduler and sysmatically repeating each test, weaving the threads differently each time to exercise every possible way the scheduler could run the code.  However it requires us to to write a set of tests that finds *all* the threading bugs.  Since it is common to write unit tests with less than 100% coverage, a code coverage tool should be used to write more tests.</p>
<p><strong>Conclusion</strong></p>
<p>The good news is that there appears to be a variety of approaches to the problem and the whole answer will likely involve a combination of language or library enhancements and analyser or testing enhancements that are already in the works.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Functional Language Explosion</title>
		<link>http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/</link>
		<comments>http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 10:50:02 +0000</pubDate>
		<dc:creator><![CDATA[Clay Lenhart]]></dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Functional Langauges]]></category>
		<category><![CDATA[Immutable]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=41</guid>
		<description><![CDATA[There is suddenly a lot of interest in functional languages recently.  The two advantages are writing a DSL (Domain Specific Language) and writing concurrent code. The languages that seem to come up are Clojure (JVM), F# (based on OCaml, Haskell, and ML) (.Net CLR), and Erlang (JVM).
 <a href="http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>There is suddenly a lot of interest in <a href="http://en.wikipedia.org/wiki/Functional_programming">functional languages </a>recently.  The two advantages are</p>
<ul>
<li>Writing a DSL (Domain Specific Language)</li>
<li>Writing concurrent code</li>
</ul>
<p>The languages that seem to come up are:</p>
<ul>
<li><a href="http://clojure.org/">Clojure</a> (JVM)</li>
<li><a href="http://msdn.microsoft.com/en-gb/fsharp/default.aspx">F#</a> (based on OCaml, Haskell, and ML) (.Net CLR)</li>
<li><a href="http://www.erlang.org/">Erlang</a> <span style="text-decoration: line-through;">(JVM)</span></li>
</ul>
<p>I&#8217;m not particularly interested in DSL (despite my last post on <a href="http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/">code generators</a>), however as CPUs contain more and more cores, we&#8217;ll need a way to safely write multithreaded code.</p>
<p>The Clojure project has an interesting post on its approach on <a href="http://clojure.org/state">simplifying multithreaded code</a>.</p>
<p>Erlang handles concurrency by only having local variables and providing a way to send messages to and from other threads.</p>
<p>Lastly, <a href="http://www.osl.iu.edu/research/mpi.net/">MPI </a>is a .Net library for distributed processing where the same program executes multiple times and each instance communicates with each other using message passing which sounds very Erlang-like.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
