<?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"
	>
<channel>
	<title>Comments for Dragons in the Algorithm</title>
	<atom:link href="http://mcherm.com/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://mcherm.com</link>
	<description>Adventures in Programming</description>
	<pubDate>Fri, 05 Dec 2008 09:12:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
		<item>
		<title>Comment on Searching, Thread-count and a Thanksgiving Miracle by mcherm</title>
		<link>http://mcherm.com/permalinks/1/searching-thread-count-and-a-thanksgiving-miracle#comment-3824</link>
		<dc:creator>mcherm</dc:creator>
		<pubDate>Wed, 26 Nov 2008 15:23:48 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/blog/?p=22#comment-3824</guid>
		<description>Len:
Thanks for the edit. Fixed.</description>
		<content:encoded><![CDATA[<p>Len:<br />
Thanks for the edit. Fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Searching, Thread-count and a Thanksgiving Miracle by Len Olin</title>
		<link>http://mcherm.com/permalinks/1/searching-thread-count-and-a-thanksgiving-miracle#comment-3686</link>
		<dc:creator>Len Olin</dc:creator>
		<pubDate>Mon, 24 Nov 2008 16:21:45 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/blog/?p=22#comment-3686</guid>
		<description>Interesting article. Hash tables are really cool. It's nice to know who invented them. The response from C. Luhn was the coolest part, though. Nice looking turkey too.

One fix: "size of the group" - you have "side of the group"</description>
		<content:encoded><![CDATA[<p>Interesting article. Hash tables are really cool. It&#8217;s nice to know who invented them. The response from C. Luhn was the coolest part, though. Nice looking turkey too.</p>
<p>One fix: &#8220;size of the group&#8221; - you have &#8220;side of the group&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Election Guide, Nov 2008 by Elena</title>
		<link>http://mcherm.com/permalinks/1/election-guide-nov-2008#comment-1480</link>
		<dc:creator>Elena</dc:creator>
		<pubDate>Sun, 02 Nov 2008 15:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=189#comment-1480</guid>
		<description>Thanks for your thoughtful commentaries on local elections!  I'm doing my homework for Tuesday and enjoyed reading your analysis on these smaller races that I don't know much about.</description>
		<content:encoded><![CDATA[<p>Thanks for your thoughtful commentaries on local elections!  I&#8217;m doing my homework for Tuesday and enjoyed reading your analysis on these smaller races that I don&#8217;t know much about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Separation of Concerns by mcherm</title>
		<link>http://mcherm.com/permalinks/1/separation-of-concerns#comment-1013</link>
		<dc:creator>mcherm</dc:creator>
		<pubDate>Mon, 27 Oct 2008 19:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=127#comment-1013</guid>
		<description>By the way, this approach would obviously have advantages for internationalization, but even if you never plan to support more than one language, it is still useful.</description>
		<content:encoded><![CDATA[<p>By the way, this approach would obviously have advantages for internationalization, but even if you never plan to support more than one language, it is still useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Threadsafe Java Servlets by mcherm</title>
		<link>http://mcherm.com/permalinks/1/threadsafe-java-servlets#comment-374</link>
		<dc:creator>mcherm</dc:creator>
		<pubDate>Tue, 30 Sep 2008 11:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=97#comment-374</guid>
		<description>When I searched around on the web for other descriptions of this problem and perhaps for people who have solutions (other than locking on the session) I found almost nothing that talked about it. It sometimes makes you wonder... am I imagining things? Is the problem real but everyone in the world is ignoring it, or is it that I am just confused about the issues.

Well, it turns out that I'm not the only one. Joe Campbell pointed me toward a well-written article by article by Brian Goetz that describes this problem in detail. Brian is one of the world's top experts on Java threading -- among other things he is the author of "Java Concurrency in Practice". So I am not confused... there IS a real issue here, and 99% of all web applications are broken.</description>
		<content:encoded><![CDATA[<p>When I searched around on the web for other descriptions of this problem and perhaps for people who have solutions (other than locking on the session) I found almost nothing that talked about it. It sometimes makes you wonder&#8230; am I imagining things? Is the problem real but everyone in the world is ignoring it, or is it that I am just confused about the issues.</p>
<p>Well, it turns out that I&#8217;m not the only one. Joe Campbell pointed me toward a well-written article by article by Brian Goetz that describes this problem in detail. Brian is one of the world&#8217;s top experts on Java threading &#8212; among other things he is the author of &#8220;Java Concurrency in Practice&#8221;. So I am not confused&#8230; there IS a real issue here, and 99% of all web applications are broken.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Threadsafe Java Servlets by mcherm</title>
		<link>http://mcherm.com/permalinks/1/threadsafe-java-servlets#comment-364</link>
		<dc:creator>mcherm</dc:creator>
		<pubDate>Wed, 24 Sep 2008 12:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=97#comment-364</guid>
		<description>Daniel:

Ah... apparently I misused the term "copy on write". I was actually envisioning an immutable data structure held by reference in the (mutable) Session, just as you describe. This works great for threads that do reading (they can work with the copy that was valid when the thread began, even if subsequent updates occur). But I'm still trying to figure out he details for threads that do writes. I don't quite understand your statement, "Once you add simple Mutex locking to the shared mutable variable, then you’re good to go!" but hopefully I'll figure it out.

I _do_ wonder why there aren't more published solutions out there for this problem.</description>
		<content:encoded><![CDATA[<p>Daniel:</p>
<p>Ah&#8230; apparently I misused the term &#8220;copy on write&#8221;. I was actually envisioning an immutable data structure held by reference in the (mutable) Session, just as you describe. This works great for threads that do reading (they can work with the copy that was valid when the thread began, even if subsequent updates occur). But I&#8217;m still trying to figure out he details for threads that do writes. I don&#8217;t quite understand your statement, &#8220;Once you add simple Mutex locking to the shared mutable variable, then you’re good to go!&#8221; but hopefully I&#8217;ll figure it out.</p>
<p>I _do_ wonder why there aren&#8217;t more published solutions out there for this problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Threadsafe Java Servlets by mcherm</title>
		<link>http://mcherm.com/permalinks/1/threadsafe-java-servlets#comment-363</link>
		<dc:creator>mcherm</dc:creator>
		<pubDate>Wed, 24 Sep 2008 12:46:02 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=97#comment-363</guid>
		<description>Joe:

I would love to hear about a servlet container that provides some kind of support *other* than the ability to process the requests one-at-a-time for a user (same as locking on the Session). I was under the impression that neither Tomcat, JBoss, WebSphere nor WebLogic offered that. Am I wrong about one of these, or do you know of another container which does?

As for the "double object creation" issue, I'll stop by your desk sometime; I'd be interested to hear your ideas.</description>
		<content:encoded><![CDATA[<p>Joe:</p>
<p>I would love to hear about a servlet container that provides some kind of support *other* than the ability to process the requests one-at-a-time for a user (same as locking on the Session). I was under the impression that neither Tomcat, JBoss, WebSphere nor WebLogic offered that. Am I wrong about one of these, or do you know of another container which does?</p>
<p>As for the &#8220;double object creation&#8221; issue, I&#8217;ll stop by your desk sometime; I&#8217;d be interested to hear your ideas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Threadsafe Java Servlets by Daniel Spiewak</title>
		<link>http://mcherm.com/permalinks/1/threadsafe-java-servlets#comment-362</link>
		<dc:creator>Daniel Spiewak</dc:creator>
		<pubDate>Wed, 24 Sep 2008 00:46:41 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=97#comment-362</guid>
		<description>Very nice analysis.  The biggest problem with concurrency is that people don't think about it sufficiently, leading to all those grand issues with mutable state, locking etc.

My personal favorite solution (for the moment) is the one undertaken by Clojure: immutable, persistent (*not* copy-on-write!) data structures referenced by shared mutable refs with concurrency semantics.  Unfortunately, to get the full impact of Clojure's references, you really need a transactional memory model, which isn't exactly something you can retrofit onto a language.  Still, "altering" an immutable data structure and storing the result in a shared mutable field is a lot better than actually modifying a single, shared mutable data structure.  Once you add simple Mutex locking to the shared mutable variable, then you're good to go!

As an aside, persistent data structures are a *lot* better than copy-on-write.  They're both fully-immutable, but copy-on-write is hideously inefficient for write operations since the entire structure must be copied.  Persistent data structures share structure between new and old versions.  With a fully-persistent data structure (like singly-linked lists), you don't need to copy anything on write, just make the new head point its tail to the old list.  More complicated data structures (like red-black trees) usually end up copying a little more, but almost never the entire structure.

Optimally, a fully-immutable data structure should preserve all of the performance guaranties of its mutable counterpart.  This is usually hard to achieve, but when it can be done the results are extremely compelling.</description>
		<content:encoded><![CDATA[<p>Very nice analysis.  The biggest problem with concurrency is that people don&#8217;t think about it sufficiently, leading to all those grand issues with mutable state, locking etc.</p>
<p>My personal favorite solution (for the moment) is the one undertaken by Clojure: immutable, persistent (*not* copy-on-write!) data structures referenced by shared mutable refs with concurrency semantics.  Unfortunately, to get the full impact of Clojure&#8217;s references, you really need a transactional memory model, which isn&#8217;t exactly something you can retrofit onto a language.  Still, &#8220;altering&#8221; an immutable data structure and storing the result in a shared mutable field is a lot better than actually modifying a single, shared mutable data structure.  Once you add simple Mutex locking to the shared mutable variable, then you&#8217;re good to go!</p>
<p>As an aside, persistent data structures are a *lot* better than copy-on-write.  They&#8217;re both fully-immutable, but copy-on-write is hideously inefficient for write operations since the entire structure must be copied.  Persistent data structures share structure between new and old versions.  With a fully-persistent data structure (like singly-linked lists), you don&#8217;t need to copy anything on write, just make the new head point its tail to the old list.  More complicated data structures (like red-black trees) usually end up copying a little more, but almost never the entire structure.</p>
<p>Optimally, a fully-immutable data structure should preserve all of the performance guaranties of its mutable counterpart.  This is usually hard to achieve, but when it can be done the results are extremely compelling.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Threadsafe Java Servlets by Joe Campbell</title>
		<link>http://mcherm.com/permalinks/1/threadsafe-java-servlets#comment-361</link>
		<dc:creator>Joe Campbell</dc:creator>
		<pubDate>Wed, 24 Sep 2008 00:01:10 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=97#comment-361</guid>
		<description>It should be noted the HttpSession is not inherently ThreadSafe or not - its just an interface that dictates what a servlet httpsession should provide not 'how' it should provide it.

It is certainly possible to provide an implementation within your given container that supports the threading safety that you are looking for.  I would even venture to say that in some of the more popular servlet containers it is more then likely to already have been dealt with as an issue in the default implementation of the session.

There are also well known ways to deal with the 'double' object creation issues that you outline.  I would be interested in talking to you about the problem you are attempting to solve so as to understand if you may be solving a problem that has already been dealt with.

Just my $0.02.
    Joe</description>
		<content:encoded><![CDATA[<p>It should be noted the HttpSession is not inherently ThreadSafe or not - its just an interface that dictates what a servlet httpsession should provide not &#8216;how&#8217; it should provide it.</p>
<p>It is certainly possible to provide an implementation within your given container that supports the threading safety that you are looking for.  I would even venture to say that in some of the more popular servlet containers it is more then likely to already have been dealt with as an issue in the default implementation of the session.</p>
<p>There are also well known ways to deal with the &#8216;double&#8217; object creation issues that you outline.  I would be interested in talking to you about the problem you are attempting to solve so as to understand if you may be solving a problem that has already been dealt with.</p>
<p>Just my $0.02.<br />
    Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The Secret to Making Chrome by film fan</title>
		<link>http://mcherm.com/permalinks/1/the-secret-to-making-chrome#comment-354</link>
		<dc:creator>film fan</dc:creator>
		<pubDate>Tue, 16 Sep 2008 11:37:53 +0000</pubDate>
		<guid isPermaLink="false">http://mcherm.com/?p=89#comment-354</guid>
		<description>i keep learning about more and more advantages and features with Chrome, with privacy, for example; now if only they would take care of it's cookie management glitches...</description>
		<content:encoded><![CDATA[<p>i keep learning about more and more advantages and features with Chrome, with privacy, for example; now if only they would take care of it&#8217;s cookie management glitches&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

