<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Finding Thread-unsafe Code</title>
	<atom:link href="http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/</link>
	<description>Linux, politics, and other interesting things</description>
	<lastBuildDate>Thu, 09 Feb 2012 01:09:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: etbe</title>
		<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/comment-page-1/#comment-19550</link>
		<dc:creator>etbe</dc:creator>
		<pubDate>Tue, 16 Jun 2009 13:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://etbe.coker.com.au/?p=1200#comment-19550</guid>
		<description>foo and Nick: Thanks for the suggestion, I&#039;m investigating that now.

Chris: That&#039;s interesting for HPC, but not of much use for what I&#039;m doing.  I have to work with the standard Milter libraries which don&#039;t support such things.

Bill: Good point, that&#039;s one of the many rough edges in my code.  I trimmed the OTHERS list, it&#039;s the entries from Sun&#039;s list that didn&#039;t appear when I searched the man pages - mostly functions with no reentrant versions.  Your idea is much better.</description>
		<content:encoded><![CDATA[<p>foo and Nick: Thanks for the suggestion, I&#8217;m investigating that now.</p>
<p>Chris: That&#8217;s interesting for HPC, but not of much use for what I&#8217;m doing.  I have to work with the standard Milter libraries which don&#8217;t support such things.</p>
<p>Bill: Good point, that&#8217;s one of the many rough edges in my code.  I trimmed the OTHERS list, it&#8217;s the entries from Sun&#8217;s list that didn&#8217;t appear when I searched the man pages &#8211; mostly functions with no reentrant versions.  Your idea is much better.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Farrow</title>
		<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/comment-page-1/#comment-19542</link>
		<dc:creator>Bill Farrow</dc:creator>
		<pubDate>Mon, 15 Jun 2009 19:30:54 +0000</pubDate>
		<guid isPermaLink="false">http://etbe.coker.com.au/?p=1200#comment-19542</guid>
		<description>On my system I needed to remove the duplicate functions names before compiling the library.  Added &quot;sort -u&quot; to the code.  Actually you might want merge the $OTHERS into the list before sorting and removing duplicates.

- for n in $OTHERS $(ls -1 /usr/share/man/man3/*_r.*&#124;sed -e &quot;s/^.*\///&quot; -e &quot;s/_r\..*$//&quot;&#124;grep -v ^lgamma) ; do
+ for n in $OTHERS $(ls -1 /usr/share/man/man3/*_r.*&#124;sed -e &quot;s/^.*\///&quot; -e &quot;s/_r\..*$//&quot;&#124;grep -v ^lgamma &#124; sort -u) ; do</description>
		<content:encoded><![CDATA[<p>On my system I needed to remove the duplicate functions names before compiling the library.  Added &#8220;sort -u&#8221; to the code.  Actually you might want merge the $OTHERS into the list before sorting and removing duplicates.</p>
<p>- for n in $OTHERS $(ls -1 /usr/share/man/man3/*_r.*|sed -e &#8220;s/^.*\///&#8221; -e &#8220;s/_r\..*$//&#8221;|grep -v ^lgamma) ; do<br />
+ for n in $OTHERS $(ls -1 /usr/share/man/man3/*_r.*|sed -e &#8220;s/^.*\///&#8221; -e &#8220;s/_r\..*$//&#8221;|grep -v ^lgamma | sort -u) ; do</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Samuel</title>
		<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/comment-page-1/#comment-19529</link>
		<dc:creator>Chris Samuel</dc:creator>
		<pubDate>Sun, 14 Jun 2009 11:49:12 +0000</pubDate>
		<guid isPermaLink="false">http://etbe.coker.com.au/?p=1200#comment-19529</guid>
		<description>I&#039;d take issue with the statement that non-threaded programs can&#039;t take advantage of CPUs and are slower than threaded ones. :-)

Many HPC codes are non-threaded MPI programs, they take full advantage of multiple cores.  In fact we&#039;ve seen one particular code available in both a threaded SMP version and a pure MPI version and found that the MPI version makes far more efficient use of an SMP system (scales better) than the SMP version.

Regarding threading being faster, Tridge has already &lt;a href=&quot;http://lists.samba.org/archive/samba-technical/2004-December/038301.html&quot; rel=&quot;nofollow&quot;&gt;made a convincing case back in 2004&lt;/a&gt; (mentioned in passing at a LUV meeting way back when it was in the Telstra building) that threads are always slower than processes, asides from when the OS is very broken.</description>
		<content:encoded><![CDATA[<p>I&#8217;d take issue with the statement that non-threaded programs can&#8217;t take advantage of CPUs and are slower than threaded ones. :-)</p>
<p>Many HPC codes are non-threaded MPI programs, they take full advantage of multiple cores.  In fact we&#8217;ve seen one particular code available in both a threaded SMP version and a pure MPI version and found that the MPI version makes far more efficient use of an SMP system (scales better) than the SMP version.</p>
<p>Regarding threading being faster, Tridge has already <a href="http://lists.samba.org/archive/samba-technical/2004-December/038301.html" rel="nofollow">made a convincing case back in 2004</a> (mentioned in passing at a LUV meeting way back when it was in the Telstra building) that threads are always slower than processes, asides from when the OS is very broken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/comment-page-1/#comment-19528</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sun, 14 Jun 2009 07:20:02 +0000</pubDate>
		<guid isPermaLink="false">http://etbe.coker.com.au/?p=1200#comment-19528</guid>
		<description>Some related work:

Helgrind is a thread debugger which finds data races in multithreaded programs
http://valgrind.org/info/tools.html

Nick Nethercote has done some additional work on looking for non reentrant functions called by signal handlers:
http://valgrind.org/downloads/variants.html?njn</description>
		<content:encoded><![CDATA[<p>Some related work:</p>
<p>Helgrind is a thread debugger which finds data races in multithreaded programs<br />
<a href="http://valgrind.org/info/tools.html" rel="nofollow">http://valgrind.org/info/tools.html</a></p>
<p>Nick Nethercote has done some additional work on looking for non reentrant functions called by signal handlers:<br />
<a href="http://valgrind.org/downloads/variants.html?njn" rel="nofollow">http://valgrind.org/downloads/variants.html?njn</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: foo</title>
		<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/comment-page-1/#comment-19527</link>
		<dc:creator>foo</dc:creator>
		<pubDate>Sun, 14 Jun 2009 07:04:05 +0000</pubDate>
		<guid isPermaLink="false">http://etbe.coker.com.au/?p=1200#comment-19527</guid>
		<description>Does helgrind help?

http://valgrind.org/docs/manual/hg-manual.html</description>
		<content:encoded><![CDATA[<p>Does helgrind help?</p>
<p><a href="http://valgrind.org/docs/manual/hg-manual.html" rel="nofollow">http://valgrind.org/docs/manual/hg-manual.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: etbe</title>
		<link>http://etbe.coker.com.au/2009/06/14/finding-thread-unsafe-code/comment-page-1/#comment-19526</link>
		<dc:creator>etbe</dc:creator>
		<pubDate>Sun, 14 Jun 2009 06:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://etbe.coker.com.au/?p=1200#comment-19526</guid>
		<description>glandium: Good point.  But then you need to grep the output for the functions in question, you have the ptrace overhead, and when it does flag a problem you won&#039;t know the back-trace of it.</description>
		<content:encoded><![CDATA[<p>glandium: Good point.  But then you need to grep the output for the functions in question, you have the ptrace overhead, and when it does flag a problem you won&#8217;t know the back-trace of it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

