<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:rawvoice="http://www.rawvoice.com/rawvoiceRssModule/"
	>
<channel>
	<title>Comments on: C++ and Threading</title>
	<atom:link href="http://enfranchisedmind.com/blog/posts/c-and-threading/feed/" rel="self" type="application/rss+xml" />
	<link>http://enfranchisedmind.com/blog/posts/c-and-threading/</link>
	<description>programming, politics, &#38; other religious issues</description>
	<lastBuildDate>Wed, 08 Feb 2012 14:16:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: The Blog&#8217;s Most Popular Posts &#124; Enfranchised Mind</title>
		<link>http://enfranchisedmind.com/blog/posts/c-and-threading/#comment-34390</link>
		<dc:creator>The Blog&#8217;s Most Popular Posts &#124; Enfranchised Mind</dc:creator>
		<pubDate>Sun, 12 Apr 2009 04:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/archive/2006/10/21/163#comment-34390</guid>
		<description>[...] C++ and Threading [...]</description>
		<content:encoded><![CDATA[<p>[...] C++ and Threading [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dschibut</title>
		<link>http://enfranchisedmind.com/blog/posts/c-and-threading/#comment-33761</link>
		<dc:creator>dschibut</dc:creator>
		<pubDate>Tue, 30 Sep 2008 01:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/archive/2006/10/21/163#comment-33761</guid>
		<description>I started this discussion to discuss public available web proxies:

Which are really anonymous?

Which can be used with facebook, myspace etc, in other words: are fresh ?

Which can you recommend?

Thanks for your help,
Dschibut

P.S.: In my land, the freedom of speech is somehow constrained, please give me a hint, if you are not sure about your recommendation.</description>
		<content:encoded><![CDATA[<p>I started this discussion to discuss public available web proxies:</p>
<p>Which are really anonymous?</p>
<p>Which can be used with facebook, myspace etc, in other words: are fresh ?</p>
<p>Which can you recommend?</p>
<p>Thanks for your help,<br />
Dschibut</p>
<p>P.S.: In my land, the freedom of speech is somehow constrained, please give me a hint, if you are not sure about your recommendation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Cheap Sitcom Clip Scene Blog Post &#124; Enfranchised Mind</title>
		<link>http://enfranchisedmind.com/blog/posts/c-and-threading/#comment-33559</link>
		<dc:creator>The Cheap Sitcom Clip Scene Blog Post &#124; Enfranchised Mind</dc:creator>
		<pubDate>Tue, 15 Jul 2008 04:59:28 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/archive/2006/10/21/163#comment-33559</guid>
		<description>[...] &#8220;I’m reading this post on the C++ committee’s dealings on threading, and, I am pleased to announce, there is absolutely no chance what so ever of anything sane, workable, or sensible accidentally arising from these precedings.&#8221; (C++ and Threading) [...]</description>
		<content:encoded><![CDATA[<p>[...] &#8220;I’m reading this post on the C++ committee’s dealings on threading, and, I am pleased to announce, there is absolutely no chance what so ever of anything sane, workable, or sensible accidentally arising from these precedings.&#8221; (C++ and Threading) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bhurt-aw</title>
		<link>http://enfranchisedmind.com/blog/posts/c-and-threading/#comment-2111</link>
		<dc:creator>bhurt-aw</dc:creator>
		<pubDate>Thu, 01 Feb 2007 02:18:38 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/archive/2006/10/21/163#comment-2111</guid>
		<description>OK.  They&#039;ve managed to avoid the single-lock deadlock situation.  But at this point I have to ask: what the hell good is an upgradeable lock, as opposed to a a normal write lock?  If the access pattern isn&#039;t a (relatively) long read-only phase followed by a relatively short modification phase, it&#039;s not worth it.  Especially considering that most modifications want to start their (destructive) modifications almost immediately.  

I can only think of one situation where it&#039;d be usefull- with hash tables, when you have to grow or shrink the entire hashtable.  While populating the new hashtable, you can still allow read-only access to the old hashtable.  Only at the end, when you want to update the pointers to point to the new hashtable, do you need an exclusive write lock.  But even here it&#039;s wrong to use, as the common case is that you&#039;re not resizing the table on an insert or remove.  If fact, you almost never are- only 1 time in N or less (where N is the number of elements in the table) are you resizing the table, otherwise hashtables don&#039;t have O(1) amoritized insert/remove cost.  In the common case you just want to go straight for the write lock, as the read-only phase will be almost nil.  So what use is upgradeable, again?

The next thing is that my opinion of C++ is born of actually having programmed in it professionally.  Also note that I&#039;m not that much of an elitist when it comes to languages.  While I prefer Ocaml and Haskell as languages, I still very much like C, and have been known to voluntarily program in PHP, Perl, and Visual Basic.  Heck, I&#039;ve even been known to argue that for certain jobs, Perl or Visual Basic are &lt;em&gt;better&lt;/em&gt; tools than Ocaml!  So this isn&#039;t just lisp-style snobbery.  The intense dislike I bear against C++ is earned.

&lt;BLOCKQUOTE&gt;To assume mass-stupidity from a group of internationally recognized experts of a field, any field, appears to me to be less than a bright thing to do. Yes, groups of experts do make mistakes. It happens more often than I’d like. But I’ll take those results over groups of non-experts any day.

And fwiw, I’ve been monitoring the technical conversation regarding the C++ memory model (Hans Boehm among the active participants) over the past several months. Trust me, these guys know what they’re doing. Publicly ridicule them at the risk of your own reputation. &lt;/BLOCKQUOTE&gt;

If that group of so-called experts &lt;em&gt;consistently&lt;/em&gt; display poor judgement and lack of fundamental knowledge, then it&#039;s a pretty safe bet that they will continue to do so.  And the fact that there was a smattering of smart people involved doesn&#039;t matter- as generally the smart people get shouted down by the idiots.  Hans Boehm is a pretty smart guy.  So is Colin Powell.

Given the shock people had when Hans showed the reordering problem, I have to conclude that the C++ committee knows as much about the reality of multithreaded programming as the neocons do of the middle east.  Now, I suppose it&#039;s possible that this report of the goings on at the meeting are completely false to fact.  I wasn&#039;t there, but I haven&#039;t heard of anyone claiming this.  But if it is even roughly or approximately true, I&#039;m pretty safe with this opinion.

For example- looking at the spec you posted, I notice one glaring thing.  They&#039;re using templates to express an is-a relationship.  This strikes me as being a classic, gold-standard example of what normal object inheritance.  And yet, they use templates.  One wonders why.  The only reason I can come up with is that templates are &quot;cool&quot;, and that the same proposal, except using object inheritance instead of templates, would have a much reduced chance of passing muster with the standards committee for stylistic reasons.  &quot;This is C++, not Java!&quot;  Either that, or the people writting the standard don&#039;t understand object orieted design (this isn&#039;t the first time this has happened with C++, witness iostreams).</description>
		<content:encoded><![CDATA[<p>OK.  They&#8217;ve managed to avoid the single-lock deadlock situation.  But at this point I have to ask: what the hell good is an upgradeable lock, as opposed to a a normal write lock?  If the access pattern isn&#8217;t a (relatively) long read-only phase followed by a relatively short modification phase, it&#8217;s not worth it.  Especially considering that most modifications want to start their (destructive) modifications almost immediately.  </p>
<p>I can only think of one situation where it&#8217;d be usefull- with hash tables, when you have to grow or shrink the entire hashtable.  While populating the new hashtable, you can still allow read-only access to the old hashtable.  Only at the end, when you want to update the pointers to point to the new hashtable, do you need an exclusive write lock.  But even here it&#8217;s wrong to use, as the common case is that you&#8217;re not resizing the table on an insert or remove.  If fact, you almost never are- only 1 time in N or less (where N is the number of elements in the table) are you resizing the table, otherwise hashtables don&#8217;t have O(1) amoritized insert/remove cost.  In the common case you just want to go straight for the write lock, as the read-only phase will be almost nil.  So what use is upgradeable, again?</p>
<p>The next thing is that my opinion of C++ is born of actually having programmed in it professionally.  Also note that I&#8217;m not that much of an elitist when it comes to languages.  While I prefer Ocaml and Haskell as languages, I still very much like C, and have been known to voluntarily program in PHP, Perl, and Visual Basic.  Heck, I&#8217;ve even been known to argue that for certain jobs, Perl or Visual Basic are <em>better</em> tools than Ocaml!  So this isn&#8217;t just lisp-style snobbery.  The intense dislike I bear against C++ is earned.</p>
<blockquote><p>To assume mass-stupidity from a group of internationally recognized experts of a field, any field, appears to me to be less than a bright thing to do. Yes, groups of experts do make mistakes. It happens more often than I’d like. But I’ll take those results over groups of non-experts any day.</p>
<p>And fwiw, I’ve been monitoring the technical conversation regarding the C++ memory model (Hans Boehm among the active participants) over the past several months. Trust me, these guys know what they’re doing. Publicly ridicule them at the risk of your own reputation. </p></blockquote>
<p>If that group of so-called experts <em>consistently</em> display poor judgement and lack of fundamental knowledge, then it&#8217;s a pretty safe bet that they will continue to do so.  And the fact that there was a smattering of smart people involved doesn&#8217;t matter- as generally the smart people get shouted down by the idiots.  Hans Boehm is a pretty smart guy.  So is Colin Powell.</p>
<p>Given the shock people had when Hans showed the reordering problem, I have to conclude that the C++ committee knows as much about the reality of multithreaded programming as the neocons do of the middle east.  Now, I suppose it&#8217;s possible that this report of the goings on at the meeting are completely false to fact.  I wasn&#8217;t there, but I haven&#8217;t heard of anyone claiming this.  But if it is even roughly or approximately true, I&#8217;m pretty safe with this opinion.</p>
<p>For example- looking at the spec you posted, I notice one glaring thing.  They&#8217;re using templates to express an is-a relationship.  This strikes me as being a classic, gold-standard example of what normal object inheritance.  And yet, they use templates.  One wonders why.  The only reason I can come up with is that templates are &#8220;cool&#8221;, and that the same proposal, except using object inheritance instead of templates, would have a much reduced chance of passing muster with the standards committee for stylistic reasons.  &#8220;This is C++, not Java!&#8221;  Either that, or the people writting the standard don&#8217;t understand object orieted design (this isn&#8217;t the first time this has happened with C++, witness iostreams).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Howard Hinnant</title>
		<link>http://enfranchisedmind.com/blog/posts/c-and-threading/#comment-2050</link>
		<dc:creator>Howard Hinnant</dc:creator>
		<pubDate>Tue, 30 Jan 2007 16:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://enfranchisedmind.com/blog/archive/2006/10/21/163#comment-2050</guid>
		<description>If anyone is interested in reading the actual proposal for the read/write/upgradable locks it is here:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html

Because I&#039;m writing into a category titled &quot;Why C++ Sucks&quot; I have reservations that anyone will take the time.  However I wanted to at least put to rest the notion that the C++ committee is unaware of the problems concerned with upgrading two read locks.

The paper at the url above proposes 3 types of mutexes (and associated locks):  sharable, upgradable and exclusive.  Call these read, upgradable and write if you wish, I&#039;m not married to the names.  There is no blocking upgrade path from sharable to exclusive.  One can only upgrade from an upgradable to an exclusive.  And though an upgradable mutex can share ownership with multiple sharables, it can not share with any other upgradable.  Therefore there can be only one mutex at a time that is trying to upgrade to exclusive.

Avoiding the deadlock discussed in this blog is the entire reason the upgradable mutex exists in the proposal.

Admittedly there is a 2-word type-o / think-o in the proposal under the definition of unlock_upgradable_and_lock().  My bad.  It has been noted and will be corrected should these words approach a technical report or a standard.

&gt; Never mind the niggling little implementation details. ...Of course, the &gt; only nit they could find to pick was with his spelling.

Or perhaps it was because the people I presented to had the benefit of the presentation, explaining many details.  And this audience was also aware of the years of research, plus actual working implementation behind the proposal.

To assume mass-stupidity from a group of internationally recognized experts of a field, any field, appears to me to be less than a bright thing to do.  Yes, groups of experts do make mistakes.  It happens more often than I&#039;d like.  But I&#039;ll take those results over groups of non-experts any day.

And fwiw, I&#039;ve been monitoring the technical conversation regarding the C++ memory model (Hans Boehm among the active participants) over the past several months.  Trust me, these guys know what they&#039;re doing.  Publicly ridicule them at the risk of your own reputation.</description>
		<content:encoded><![CDATA[<p>If anyone is interested in reading the actual proposal for the read/write/upgradable locks it is here:</p>
<p><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2094.html</a></p>
<p>Because I&#8217;m writing into a category titled &#8220;Why C++ Sucks&#8221; I have reservations that anyone will take the time.  However I wanted to at least put to rest the notion that the C++ committee is unaware of the problems concerned with upgrading two read locks.</p>
<p>The paper at the url above proposes 3 types of mutexes (and associated locks):  sharable, upgradable and exclusive.  Call these read, upgradable and write if you wish, I&#8217;m not married to the names.  There is no blocking upgrade path from sharable to exclusive.  One can only upgrade from an upgradable to an exclusive.  And though an upgradable mutex can share ownership with multiple sharables, it can not share with any other upgradable.  Therefore there can be only one mutex at a time that is trying to upgrade to exclusive.</p>
<p>Avoiding the deadlock discussed in this blog is the entire reason the upgradable mutex exists in the proposal.</p>
<p>Admittedly there is a 2-word type-o / think-o in the proposal under the definition of unlock_upgradable_and_lock().  My bad.  It has been noted and will be corrected should these words approach a technical report or a standard.</p>
<p>&gt; Never mind the niggling little implementation details. &#8230;Of course, the &gt; only nit they could find to pick was with his spelling.</p>
<p>Or perhaps it was because the people I presented to had the benefit of the presentation, explaining many details.  And this audience was also aware of the years of research, plus actual working implementation behind the proposal.</p>
<p>To assume mass-stupidity from a group of internationally recognized experts of a field, any field, appears to me to be less than a bright thing to do.  Yes, groups of experts do make mistakes.  It happens more often than I&#8217;d like.  But I&#8217;ll take those results over groups of non-experts any day.</p>
<p>And fwiw, I&#8217;ve been monitoring the technical conversation regarding the C++ memory model (Hans Boehm among the active participants) over the past several months.  Trust me, these guys know what they&#8217;re doing.  Publicly ridicule them at the risk of your own reputation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

