<?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>Psychic Origami &#187; dayjob</title>
	<atom:link href="http://www.psychicorigami.com/category/dayjob/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.psychicorigami.com</link>
	<description>folding with my brain</description>
	<lastBuildDate>Wed, 03 Aug 2011 19:13:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Class of the day: ConcurrentHashMap</title>
		<link>http://www.psychicorigami.com/2007/03/12/class-of-the-day-concurrenthashmap/</link>
		<comments>http://www.psychicorigami.com/2007/03/12/class-of-the-day-concurrenthashmap/#comments</comments>
		<pubDate>Mon, 12 Mar 2007 20:47:22 +0000</pubDate>
		<dc:creator>john</dc:creator>
				<category><![CDATA[dayjob]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.psychicorigami.com/2007/03/12/class-of-the-day-concurrenthashmap/</guid>
		<description><![CDATA[Well today at work involved me using ConcurrentHashMap and in particular putIfAbsent to severely reduce the need for old-school synchronized blocks. Just a shame that you can&#8217;t pass in arbitrary expressions/blocks that will only be evaluated if the value isn&#8217;t present when you call putIfAbsent. Might become feasible if Java gets closures. There&#8217;s definitely some [...]]]></description>
			<content:encoded><![CDATA[<p>Well today at work involved me using <a href='http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html'><code>ConcurrentHashMap</code></a> and in particular <a href='http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ConcurrentMap.html#putIfAbsent(K,%20V)'><code>putIfAbsent</code></a> to severely reduce the need for old-school <code>synchronized</code> blocks.</p>
<p>Just a shame that you can&#8217;t pass in arbitrary expressions/blocks that will only be evaluated if the value isn&#8217;t present when you call <code>putIfAbsent</code>. Might become feasible if Java gets <a href='http://www.oreillynet.com/onjava/blog/2006/08/will_we_have_closures_in_java.html'>closures</a>.  There&#8217;s definitely some power in the <code>java.util.concurrent</code> package though.</p>
<p>Still it&#8217;s been a while since I&#8217;ve had that kind of satisfaction writing Java code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.psychicorigami.com/2007/03/12/class-of-the-day-concurrenthashmap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

