<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<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/"
	>

<channel>
	<title>Pure Danger Tech</title>
	<link>http://tech.puredanger.com</link>
	<description>Alex Miller's technical blog</description>
	<pubDate>Fri, 09 May 2008 14:33:15 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>JavaOne: BOF beer night</title>
		<link>http://tech.puredanger.com/2008/05/09/javaone-bof-beer-night/</link>
		<comments>http://tech.puredanger.com/2008/05/09/javaone-bof-beer-night/#comments</comments>
		<pubDate>Fri, 09 May 2008 14:33:15 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
		
	<category>Java</category>
	<category>JavaOne</category>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/05/09/javaone-bof-beer-night/</guid>
		<description><![CDATA[Thursday night was a lot of fun.  I guess Smashmouth was playing but I don&#8217;t know anyone that went - anyone hear how it went?  I was ready to relax a bit after my talk so it was a fun night.  I went to dinner with some other NFJS speakers and had [...]]]></description>
			<content:encoded><![CDATA[<p>Thursday night was a lot of fun.  I guess Smashmouth was playing but I don&#8217;t know anyone that went - anyone hear how it went?  I was ready to relax a bit after my talk so it was a fun night.  I went to dinner with some other NFJS speakers and had a great time and met some new people.  </p>
<p>Then I headed to the the Guice BOF, which was a fun crowd.  They talked about the upcoming Guice 2.0 and the interesting new features.  Unfortunately, I&#8217;ve only played a bit with Guice so I can&#8217;t say that I found it personally meaningful, but it sounded like some good stuff.  I thought the idea of using custom annotations was interesting.  Plus they had copious quantities of beer.</p>
<p>Then it seemed like that whole crowd migrated en masse to the Java Posse BOF (also beer enabled from Atlassian).  The Java Posse do a podcast of Java news of course and this was a live episode.  They took a bunch of polls of the audience.  Given the exuberant crowd, I&#8217;m not sure how much you can draw from the responses. :)  </p>
<p>Some little tidbits that they threw out that I found interesting.</p>
<ul>
<li>Scala is the new Java - I know the posse love the Scala and I think it&#8217;s an amazing language but I&#8217;m just not seeing it as the &#8220;new Java&#8221;.</li>
<li>Kindle runs Java - I guess it was unknown before that the new Kindle e reader device from Amazon runs Java (on Linux).  Pretty cool</li>
<li>What is Duke? - there was a brief discussion of what the Java mascot actually is.  Someone said it&#8217;s based on the shape of the communicator device in Star Trek.  None other than Josh Bloch said &#8220;Duke is the bastard child of a scrubbing bubble&#8221;.  Sounded like an authoritative source to me.</li>
</ul>
<p>I asked a question and got a free copy of the new Effective Java at the BOF, which I am quite happy about.  </p>
<p>Overall a fun night!  (I don&#8217;t think Smashmouth could have competed.)
</p>
]]></content:encoded>
			<wfw:commentRSS>http://tech.puredanger.com/2008/05/09/javaone-bof-beer-night/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Shared flow</title>
		<link>http://tech.puredanger.com/2008/05/09/shared-flow/</link>
		<comments>http://tech.puredanger.com/2008/05/09/shared-flow/#comments</comments>
		<pubDate>Fri, 09 May 2008 14:10:49 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
		
	<category>programming</category>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/05/09/shared-flow/</guid>
		<description><![CDATA[I went to dinner last night with a bunch of other speakers from the No Fluff tour and had a great time.  One little interesting tidbit of conversation was about shared flow state.  As programmers, we&#8217;re all familiar with solo flow state when you&#8217;re in the zone, writing code.  We were talking [...]]]></description>
			<content:encoded><![CDATA[<p>I went to dinner last night with a bunch of other speakers from the No Fluff tour and had a great time.  One little interesting tidbit of conversation was about shared flow state.  As programmers, we&#8217;re all familiar with solo flow state when you&#8217;re in the zone, writing code.  We were talking about pair programming, which when it&#8217;s good, is a shared flow state and can be even richer than solo flow.</p>
<p>I mentioned that another case of this I&#8217;ve experienced is playing viola in a quartet.  You are very intensely aware of what the other three people are doing (even though that may be evident externally) and you are all trying to accomplish the same thing.  It&#8217;s exhilarating in a very unique way.</p>
<p>Of course, sex is another good example of shared flow state.  :)   </p>
<p>Anyone have any others?
</p>
]]></content:encoded>
			<wfw:commentRSS>http://tech.puredanger.com/2008/05/09/shared-flow/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Twitter good</title>
		<link>http://tech.puredanger.com/2008/05/08/twitter-good/</link>
		<comments>http://tech.puredanger.com/2008/05/08/twitter-good/#comments</comments>
		<pubDate>Fri, 09 May 2008 05:55:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
		
	<category>Twitter</category>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/05/08/twitter-good/</guid>
		<description><![CDATA[Just saw this post about reasons people Twitter.  After having been on Twitter for 2 weeks I completely disagree with all of these except maybe weakly on #4 - I don&#8217;t use it for any of those reasons.  
So far the benefits I&#8217;ve seen from using Twitter:

News - I see links and news [...]]]></description>
			<content:encoded><![CDATA[<p>Just saw <a href="http://www.stephenforte.net/PermaLink,guid,101a4c35-b2f3-4774-9781-7bb77f9a052c.aspx">this post</a> about reasons people Twitter.  After having been on Twitter for 2 weeks I completely disagree with all of these except maybe weakly on #4 - I don&#8217;t use it for any of those reasons.  </p>
<p>So far the benefits I&#8217;ve seen from using Twitter:</p>
<ol>
<li>News - I see links and news of interest to me faster than I do via blogs and feeds.  Twitter is an amplifier.  If the people you follow share your interests, anything popping from there is far more likely to be interesting to you than the average blog entry.  I&#8217;m a blogaholic and I&#8217;ve almost stopped reading blogs in the last couple weeks yet feel more connected.</li>
<li>Breadth - I&#8217;ve casually met a lot of people through Twitter due to common friends that I never would have met otherwise.</li>
<li>Depth - You can actually twitter someone that you don&#8217;t know well and end up having lunch with them.  Or you can just twitter out loud and someone will find you.  This is particularly useful in cases where there are large congregations of people with similar interests like conferences, but probably useful anywhere.</li>
<li>Serendipity - I&#8217;ve been able to talk to users of our products due to posts on Twitter and that was really cool.  There&#8217;s no way I would have had that interaction otherwise. </li>
</ol>
<p>I do understand that Twitter is not for everyone.  But so far I&#8217;ve enjoyed it.  I don&#8217;t know if Twitter will survive or not but I think microblogging will in some form.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://tech.puredanger.com/2008/05/08/twitter-good/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>JavaOne: Geert Bevin on Java as API</title>
		<link>http://tech.puredanger.com/2008/05/08/javaone-geert-bevin-on-java-as-api/</link>
		<comments>http://tech.puredanger.com/2008/05/08/javaone-geert-bevin-on-java-as-api/#comments</comments>
		<pubDate>Thu, 08 May 2008 17:44:33 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
		
	<category>Java</category>
	<category>gwt</category>
	<category>Terracotta</category>
	<category>JavaOne</category>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/05/08/javaone-geert-bevin-on-java-as-api/</guid>
		<description><![CDATA[Actually Geert&#8217;s talk was called &#8220;Boldly Go Where Java Has Never Gone Before&#8221; but to me it was really centered on the idea of Java-the-language as interface.  You can really divide the Java platform up between two specifications - the language spec and the VM spec.  Above the language spec you have Java [...]]]></description>
			<content:encoded><![CDATA[<p>Actually Geert&#8217;s talk was called &#8220;Boldly Go Where Java Has Never Gone Before&#8221; but to me it was really centered on the idea of Java-the-language as interface.  You can really divide the Java platform up between two specifications - the language spec and the VM spec.  Above the language spec you have Java source.  Between the two you have byte code and below the VM spec you have runtimes.  </p>
<p>Everyone is quite familiar with the fact that other languages can be compiled to bytecode and the JVM can be reused as runtime on the bottom part of the stack.  Geert&#8217;s talk was about the top half however.  </p>
<p>He focused on four technologies all of which use Java unmodified at the top but do fun things in the middle or bottom layers:</p>
<ol>
<li><a href="http://terracotta.org">Terracotta</a> - extends the semantics of normal Java concurrent programs to spread heap objects and coordination across a cluster of JVMs.  In this case Terracotta hits the middle third by transforming the bytecode.  The runtime is used unchanged.</li>
<li><a href="http://rife.org">RIFE</a> - implements continuations to alllow &#8220;save game&#8221; and &#8220;resume game&#8221; semantics to your web conversations.  I loved the game analogy and the audience liked it too.  This is done again through bytecode modification in the middle tier with an unchanged runtime.</li>
<li><a href="http://code.google.com/android/">Android</a> - Android is Google&#8217;s development environment for mobile apps.  It uses normal Java language and even compiles to byte code, but then transforms that byte code into a different byte code to run on a different VM entirely - the Dalvik VM.</li>
<li><a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a> - GWT allows you to write web apps in Java, then compiles the Java source into Javascript, thus completely replacing both the byte code AND the runtime.</li>
</ul>
<p>In all, this was a very fun talk and makes an important point about Java-the-language being every bit as important as Java-the-VM.  </p>
<p>In late breaking news, Geert will be repeating this talk Friday at 2:50 in Room 133 so you still have a chance to catch it if you want.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://tech.puredanger.com/2008/05/08/javaone-geert-bevin-on-java-as-api/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>JavaOne: Cliff Click on Data Races</title>
		<link>http://tech.puredanger.com/2008/05/08/javaone-cliff-click-on-data-races/</link>
		<comments>http://tech.puredanger.com/2008/05/08/javaone-cliff-click-on-data-races/#comments</comments>
		<pubDate>Thu, 08 May 2008 17:32:44 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
		
	<category>Java</category>
	<category>concurrency</category>
	<category>JavaOne</category>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/05/08/javaone-cliff-click-on-data-races/</guid>
		<description><![CDATA[Cliff&#8217;s talk focused on what data races are, why they happen, and how to debug them.  A data race occurs when you have at least two threads accessing the same data and at least one of them is writing, and there is no ordering defined based on the Java memory model (by using synchronization, [...]]]></description>
			<content:encoded><![CDATA[<p>Cliff&#8217;s talk focused on what data races are, why they happen, and how to debug them.  A data race occurs when you have at least two threads accessing the same data and at least one of them is writing, and there is no ordering defined based on the Java memory model (by using synchronization, volatiles, Locks, etc).  In this case, instruction reorderings can occur either in the hostpot JIT or in the hardware itself that will give you surprising results.</p>
<p>In fixing data races, a key thing to remember is that the memory barrier (synchronization, etc) must be present on all threads involved.  If not, reorderings will still cause data races.</p>
<p>Cliff outlined the most common data races he sees:</p>
<ol>
<li>Double read with write in the middle:
<pre>
           T1                                          T2
	if(p != null)
							p = null
		p.field
</pre>
<p>This one is particularly nasty because on the left side, the read of p and the field actually will get done together in JIT&#8217;ed code most of the time so will show no issue.  So, it only happens on infrequently used paths that happen to come under heavy contention.  In other words, the NPE will show up just as a system comes under heavy load.
</li>
<li>Two writes with read in the middle:
<pre>
           T1                                          T2
	size = size * 2;
							array[size-1]
	array = new[size]
</pre>
</li>
<li>Double-checked locking - horse.kill().beat()</li>
<li>Partial or no synchronization on data structures like HashMap - lots of subtle bugs if you believe you can use unsynchronized maps with single writer and cleverly catch exceptions</li>
</ul>
<p>Cliff then went through tools for debugging data races:</p>
<ul>
<li>Visual inspection - current state of the practice, very slow, doesn&#8217;t scale, need an expert in both concurrency AND in the domain</li>
<li>Printing / logging - make noise at each read/write of shared variable (but be careful about avoiding string construction).  Use per-thread ring buffer.  When error occurs, timestamp all buffers so you can reconstruct.  Usually the offending thread will have been messing with the data just before the error occurred. This works but is very invasive.</li>
<li>Tools - currently tools don&#8217;t scale into production.  He did plug FindBugs as being able to detect many of the common data race problems (which matches my experience as well).  </li>
</ul>
<p>He mentioned some flags from the Azul VM that might be incorporated to the Sun VM at some point for helping to detect problems - one would autolock unsynchronized collections (since they rarely have contention), and another would throw an exception if racing in collections.</p>
<p>In general, this talk was weird as it had two possible audiences and probably didn&#8217;t serve either too well.  Those experienced in concurrency probably could have gotten what they needed in 10 minutes.  And those inexperienced were probably completely lost in the data flow analysis as he went through them really fast.  As it was, he hit his talk summary about 25 minutes in and opened for questions at 30 minutes which seemed like some strange pacing.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://tech.puredanger.com/2008/05/08/javaone-cliff-click-on-data-races/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
