<?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"
	>

<channel>
	<title>dholm.com</title>
	<atom:link href="http://www.dholm.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dholm.com</link>
	<description>Risen from the ashes of previous iterations</description>
	<pubDate>Fri, 04 Jul 2008 16:20:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Tumblelog: 080704</title>
		<link>http://www.dholm.com/2008/07/04/tumblelog-080704/</link>
		<comments>http://www.dholm.com/2008/07/04/tumblelog-080704/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 16:20:03 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=85</guid>
		<description><![CDATA[$ cheat bash, a Bash cheat sheet.
Programmer competency matrix, in case you want to know what your good and bad traits are.
The Ultimate Guide to Rock, Paper, Scissors, if you find the original game somewhat lacking.

FlyBack is a GUI to provide similar functionality as Apple&#8217;s Time Machine for Linux using existing tools.
PDF format becomes ISO [...]]]></description>
			<content:encoded><![CDATA[<p><a title="$ cheat bash" href="http://cheat.errtheblog.com/s/bash/">$ cheat bash</a>, a Bash cheat sheet.</p>
<p><a title="Programmer Competency Matrix" href="http://www.indiangeek.net/wp-content/uploads/Programmer%20competency%20matrix.htm">Programmer competency matrix</a>, in case you want to know what your good and bad traits are.</p>
<p><a title="The Ultimate Guide to Rock, Paper, Scissors" href="http://iceland.sportsontheweb.net/shore/rpc-guide/">The Ultimate Guide to Rock, Paper, Scissors</a>, if you find the original game somewhat lacking.</p>
<p><a href="http://www.dholm.com/wp-content/uploads/2008/07/lime-in-coconut.jpg"><img class="alignnone size-medium wp-image-86" title="Lime in Coconut" src="http://www.dholm.com/wp-content/uploads/2008/07/lime-in-coconut.jpg" alt="" width="300" height="229" /></a></p>
<p><a title="FlyBack - Apple's Time Machine for Linux" href="http://flyback-project.org/">FlyBack</a> is a GUI to provide similar functionality as Apple&#8217;s Time Machine for Linux using existing tools.</p>
<p><a title="PDF format becomes ISO standard" href="http://www.iso.org/iso/pressrelease.htm?refid=Ref1141">PDF format becomes ISO standard</a> ISO 32000-1.</p>
<p><a title="Computerworld - Hands on: 12 quick hacks for Firefox 3" href="http://www.computerworld.com.au/index.php/id;1924825184">Computerworld - Hands on: 12 quick hacks for Firefox 3</a> contains some useful tricks that apply to, you guessed it, Firefox 3. Such as having gmail handle mailto: URLs or installing extensions designed for Firefox 2.</p>
<p><a title="DIY Drones" href="http://diydrones.ning.com/">DIY Drones</a> is a community of people who are building their own unmanned aerial vehicles (UAVs).</p>
<p><a title="Martian Headsets" href="http://www.joelonsoftware.com/items/2008/03/17.html">Martian Headsets</a> is an interesting analysis of the state if IE8 being &#8220;standards compliant&#8221; by default.</p>
<p><a title="My first but awesome NESp" href="http://forums.benheck.com/viewtopic.php?p=295702">My first but awesome NESp</a> is a portable NES in a NES cartridge and I want one!</p>
<p><a title="RailsConf Git Talk" href="http://www.gitcasts.com/posts/railsconf-git-talk">RailsConf Git Talk</a> by Scott Chacon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/07/04/tumblelog-080704/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tumblelog: 080702</title>
		<link>http://www.dholm.com/2008/07/02/tumblelog-080702/</link>
		<comments>http://www.dholm.com/2008/07/02/tumblelog-080702/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 14:47:29 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=82</guid>
		<description><![CDATA[code_swarm is a software visualization tool showing source contributions made to a specific project. Here is an example of a visualization of Eclipse.
When all your troubles seems so far away&#8230;
An Introduction to TCP/IP, written so that most people should be able to grasp the concept.

HowTo: Create a Reverse SSH Tunnel is a handy guide for [...]]]></description>
			<content:encoded><![CDATA[<p><a title="code_swarm" href="http://vis.cs.ucdavis.edu/~ogawa/codeswarm/">code_swarm</a> is a software visualization tool showing source contributions made to a specific project. <a title="code_swarm - Eclipse (short ver.)" href="http://www.vimeo.com/1130828">Here</a> is an example of a visualization of <a title="Eclipse.org" href="http://www.eclipse.org/">Eclipse</a>.</p>
<p><a title="When all your troubles seems so far away..." href="http://wikisingers.com/shark.html">When all your troubles seems so far away&#8230;</a></p>
<p><a title="An Introduction to TCP/IP" href="http://learn-networking.com/tcp-ip/an-introduction-to-tcpip">An Introduction to TCP/IP</a>, written so that most people should be able to grasp the concept.</p>
<p><a title="Tira Ecol - Bugzilla" href="http://en.tiraecol.net/modules/comic/comic.php?content_id=161"><img class="alignnone" src="http://mirror7.escomposlinux.org/comic/ecol-160-e.png" alt="ecol-160-e" width="480" /></a></p>
<p><a title="Raiden's Realm: HowTo: Create a Reverse SSH Tunnel" href="http://www.raiden.net/?cat=2&amp;aid=429">HowTo: Create a Reverse SSH Tunnel</a> is a handy guide for those times when you need access to a machine protected behind a firewall outside of your control, i.e. at work.</p>
<p><a title="Gary's weather forecasting stone" href="http://designit.com/blog/wp-content/uploads/2008/04/gary.jpg">Gary&#8217;s weather forecasting stone</a></p>
<p><a title="Learn 10 good UNIX usage habits" href="http://www-128.ibm.com/developerworks/aix/library/au-badunixhabits.html?ca=lnxw01GoodUnixHabits">Learn 10 good UNIX usage habits</a> and save yourself some time by doing it right the first time.</p>
<p><a title="Elevator Psychology" href="http://video.google.com/videoplay?docid=3434714271274189234">Elevator Psychology</a>, fascination and hilarious all at the same time. (Flash required)</p>
<p><a title="Logic Goats" href="http://www.flying-pig.co.uk/pagesv/logicgoat.html">Logic Goats</a>, even your children will understand how a CPU works thanks to the logic goats.</p>
<p><a title="An lsof Primer" href="http://dmiessler.com/study/lsof/">An lsof Primer</a> for those of us who have happened to walk past this excellent little tool.</p>
<p><a title="Miss iPhone Piggy" href="http://www.youtube.com/watch?v=NYBFY98lWcU">Miss iPhone Piggy</a> tries to buy several thousand dollars worth of iPhones only to discover there is a one phone per person limit. (Flash required)</p>
<p><a title="GoUFFS - RBuild" href="http://gouffs.googlepages.com/rbuild">RBuild</a> is a build system similar to Linux&#8217; kbuild written in Ruby.</p>
<p><a title="Wikipedia: List of problems solved by MacGyver" href="http://en.wikipedia.org/wiki/List_of_problems_solved_by_MacGyver">List of problems solved by MacGyver</a>, found via <a title="xkcd - MacGyver Gets Lazy" href="http://www.xkcd.com/444/">xkcd 444</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/07/02/tumblelog-080702/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tumblelog: 080701</title>
		<link>http://www.dholm.com/2008/07/01/81/</link>
		<comments>http://www.dholm.com/2008/07/01/81/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 18:01:31 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=81</guid>
		<description><![CDATA[Roland TB-303 teardown, the wrong people managed to get their hands on a TB-303 and did the unthinkable.
SystemTap is an instrumentation framework for Linux and a reinvention of DTrace.
Linux EEPROM Programmer is a description on how to build a really cheap EEPROM programmer that you can use in Linux.
MorphOS 2.0 release notes, apparently hell froze [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Roland TB-303" href="http://www.flickr.com/photos/27688089@N03/sets/72157605885610767/">Roland TB-303 teardown</a>, the wrong people managed to get their hands on a TB-303 and did the unthinkable.</p>
<p><a title="SystemTap" href="http://sourceware.org/systemtap/">SystemTap</a> is an instrumentation framework for Linux and a reinvention of DTrace.</p>
<p><a title="Linux EEPROM Programmer" href="http://outflux.net/software/pkgs/EPROM/">Linux EEPROM Programmer</a> is a description on how to build a really cheap EEPROM programmer that you can use in Linux.</p>
<p><a title="MorphOS 2.0 release notes" href="http://www.morphos-team.net/releasenotes-2.0.html">MorphOS 2.0 release notes</a>, apparently hell froze over in the middle of the summer. After 3+ years of waiting a lot of people should be celebrating right about now.</p>
<p><a title="Interactive Linux Kernel Map" href="http://www.makelinux.net/kernel_map">Interactive Linux Kernel Map</a> provides a graphical overview of the Linux kernel source. You can even click on specific parts of it to locate the related source code.</p>
<p><a title="vNES" href="http://www.virtualnes.com/">vNES</a> is a Nintendo Entertainment System emulator written in Java. They have several games available on their website which you play simply by clicking on them. Apparently support for non-x86 is sketchy.</p>
<p><a title="VX32 Virtual Extension Environment" href="http://pdos.csail.mit.edu/~baford/vm/">VX32 Virtual Extension Environment</a> is a library which provides a sandbox for executing untrusted x86 code.</p>
<p><a title="pw0nd.com - Internet humor and funny pictures" href="http://pw0nd.com/">pw0nd.com - Internet humor and funny pictures</a>, the title says it all.</p>
<p><a title="I would just like to say..." href="https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2008-May/004196.html">Ubuntu appreciation</a>, always welcome.</p>
<p><a title="Why I Run UNIX" href="http://www.clapper.org/bmc/docs/run-unix.html">Why I Run UNIX</a> is an insightful collection of arguments why this particular person has chosen UNIX over other operating systems.</p>
<p><a title="YTMND - YTMND for the Blind" href="http://blueballblindness.ytmnd.com/">YTMND for the Blind</a>, crazy blue balls accompanied by a vocal explanation of what is going on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/07/01/81/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My first tumble entry</title>
		<link>http://www.dholm.com/2008/06/30/my-first-tumble-entry/</link>
		<comments>http://www.dholm.com/2008/06/30/my-first-tumble-entry/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 14:49:40 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Software]]></category>

		<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=80</guid>
		<description><![CDATA[After realizing that some of the most valuable feeds I track are simple tumblelogs I decided to start my own tumble category. A lot of the time I find that I have stumbled upon a valuable link only to never find it again when I really need it. Now I will at least have a [...]]]></description>
			<content:encoded><![CDATA[<p>After realizing that some of the most valuable feeds I track are simple tumblelogs I decided to start my own tumble category. A lot of the time I find that I have stumbled upon a valuable link only to never find it again when I really need it. Now I will at least have a place to collect them, other than my ever growing list of bookmarks, and at the same time be able to share them with the world.</p>
<p><a title="Anarchaia: A tumblelog by Christian Neukirchen" href="http://anarchaia.org/">Anarchaia: A tumblelog by Christian Neukirchen</a> is the tumblelog that ignited my love for tumblers. It has a healthy mix of technology, art and poetry and is updated almost daily.</p>
<p><a title="SNES APU on a PC" href="http://www.raphnet.net/electronique/snes_apu/snes_apu_en.php">SNES APU on a PC</a>, a project to create an interface between the audio processing unit of a SNES with a PC.</p>
<p><a title="POHMELFS" href="http://tservice.net.ru/~s0mbre/old/?section=projects&amp;item=pohmelfs">POHMELFS</a> is a new distributed networking filesystem for Linux which is showing remarkable results when compared to NFS or even localized filesystems.</p>
<p><a title="Xpra" href="http://partiwm.org/wiki/xpra">Xpra, Persistent Remote Applications for X</a>, is like screen but for X applications. This is something I think we have all been waiting for a very long time.</p>
<p><a title="Epic take-apart: HP Color LaserJet 2600n" href="http://www.evilmadscientist.com/article.php/laserjet">Epic take-apart: HP Color LaserJet 2600n</a>, apparently these printers cost less new with fully loaded OEM toners than buying replacement toners does and for that reason people rather buy a new printer than only replace their toners. Evil Mad Scientist Laboratories got their hands on one of these throw-aways and decided to take it apart.</p>
<p><a title="C++ Style Guide" href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google C++ Style Guide</a>. If you need a good basis for your internal style guide or just some good ideas to expand an existing guide this is a good place to go. I do not agree with all of their rules though. I can also recommend the Ellemtel Telecommunication Systems Laboratories, <a title="Programming in C++, Rules and Recommendations" href="http://www.doc.ic.ac.uk/lab/cplus/c++.rules/">Programming in C++, Rules and Recommendations</a>, although it is slightly dated.</p>
<p><a title="Bannalia: trivial notes on themes diverse" href="http://bannalia.blogspot.com/">Bannalia: trivial notes on themes diverse</a> is the personal blog of Joaquín M López Muñoz. A really smart guy doing some awesome stuff with C++ template metaprogramming which I have been enjoying for a couple of weeks now.</p>
<p><a title="C++ Frequently Questioned Answers" href="http://yosefk.com/c++fqa/">C++ FQA Lite</a>, an interesting analysis of the well known <a title="C++ FAQ LITE" href="http://www.parashift.com/c++-faq-lite/">C++ FAQ Lite</a> by Marshall Cline.</p>
<p><a title="LGD" href="http://www.atari.st/">LGD</a>, since the Atari STe was my first computer Little Green Desktop has held a special place in my heart for a long time. Oh how I miss those old days when computers (as in hardware) were still exciting.</p>
<p><a title="Practical Common Lisp" href="http://gigamonkeys.com/book/">Practical Common Lisp</a>, a free book for the beginner in common Lisp, a language which is far more interesting than the parentheses give light of.</p>
<p>I removed the &#8220;<em>deathtrap</em>&#8221; category today since that project never really panned out. The only two articles that were related to it have been transferred to the &#8220;<em>personal</em>&#8221; category.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/06/30/my-first-tumble-entry/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Saga of Bloodninja, good Friday fun</title>
		<link>http://www.dholm.com/2008/06/27/the-saga-of-bloodninja-good-friday-fun/</link>
		<comments>http://www.dholm.com/2008/06/27/the-saga-of-bloodninja-good-friday-fun/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 15:12:45 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=79</guid>
		<description><![CDATA[I have been wondering what the references to &#8220;I put on my robe and wizard hat&#8221; in xkcd meant and decided to Google it. Apparently it is a reference to a guy, known primarily as Bloodninja, who enters cybersex chat rooms and role plays in unexpected ways. Turns out he is hilarious and you can [...]]]></description>
			<content:encoded><![CDATA[<p>I have been wondering what the references to &#8220;<em>I put on my robe and wizard hat</em>&#8221; in <a title="xkcd - A web comic of romance, sarcasm, math, and language - By Randall Munroe" href="http://www.xkcd.com/">xkcd</a> meant and decided to Google it. Apparently it is a reference to a guy, known primarily as Bloodninja, who enters cybersex chat rooms and role plays in unexpected ways. Turns out he is hilarious and you can read about his antics <a title="The Saga of Bloodninja" href="http://people.ambrosiasw.com/~andrew/funny/bloodcyber.html">here</a>.</p>
<p>Note: His material might not be 100% SFW.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/06/27/the-saga-of-bloodninja-good-friday-fun/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Source Control by Shingle</title>
		<link>http://www.dholm.com/2008/06/26/source-control-by-shingle/</link>
		<comments>http://www.dholm.com/2008/06/26/source-control-by-shingle/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 13:21:10 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=77</guid>
		<description><![CDATA[While reading about &#8220;The Stalled Server Room&#8221; over at The Daily WTF I found this other great entry on the source control by shingle model. Apparently some guy, so afraid of using any tools to aid in his development, used an actual shingle in order to manage who had the right to modify the base [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dholm.com/wp-content/uploads/2008/06/shingle.jpeg"><img class="alignleft size-medium wp-image-78" title="shingle" src="http://www.dholm.com/wp-content/uploads/2008/06/shingle.jpeg" alt="" width="150" height="150" /></a>While reading about &#8220;<a title="The Stalled Server Room" href="http://thedailywtf.com/Articles/The-Stalled-Server-Room.aspx">The Stalled Server Room</a>&#8221; over at The Daily WTF I found this other great entry on the source control by shingle model. Apparently some guy, so afraid of using any tools to aid in his development, used an actual shingle in order to manage who had the right to modify the base libraries in the project.</p>
<p>Read the whole story titled &#8220;<a title="The Source Control Shingle" href="http://thedailywtf.com/Articles/The-Source-Control-Shingle.aspx">The Source Control Shingle</a>&#8220;, it&#8217;s hilarious. Surprise, surprise, they are developing on Windows! <img src='http://www.dholm.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/06/26/source-control-by-shingle/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rear axle cleanup</title>
		<link>http://www.dholm.com/2008/06/12/rear-axle-cleanup/</link>
		<comments>http://www.dholm.com/2008/06/12/rear-axle-cleanup/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 09:04:34 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Automotive]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=73</guid>
		<description><![CDATA[As you might already know I bought an &#8216;88 Camaro IROC last year. Being a moderately old car it of course requires some attention in order to keep it in good shape, that is also one of the reasons I got it since I felt the need for a new hobby. The undercarriage of the [...]]]></description>
			<content:encoded><![CDATA[<p>As you might already know I bought an &#8216;88 Camaro IROC last year. Being a moderately old car it of course requires some attention in order to keep it in good shape, that is also one of the reasons I got it since I felt the need for a new hobby. The undercarriage of the car had been sealed pretty well with corrosion protection but there were a few minor spots where rust had gotten a hold and the rear axle was mostly unprotected so I decided that is what I would spend my time on last autumn.</p>
<p><a href="http://www.dholm.com/wp-content/uploads/2008/06/rear-axle-1.jpg"><img class="alignnone size-medium wp-image-74" title="rear-axle-1" src="http://www.dholm.com/wp-content/uploads/2008/06/rear-axle-1.jpg" alt="Rear axle, before work" width="300" height="225" /></a></p>
<p><a href="http://www.dholm.com/wp-content/uploads/2008/06/rear-axle-2.jpg"><img class="alignnone size-medium wp-image-75" title="rear-axle-2" src="http://www.dholm.com/wp-content/uploads/2008/06/rear-axle-2.jpg" alt="Rear axle, before work (closeup)" width="300" height="225" /></a></p>
<p>The idea was to remove as much of the rust as possible and seal the components to prevent them from future attacks. For that purpose I used a recirculating spot blaster and aluminum silicate blasting abrasive to clean up the worst parts and a steel wire wheel brush fitted on a standard drill to polish the blasted surface. Having never blast cleaned anything in my life it took a while to figure out the proper technique and hence it took me quite some time to clean up the surface but it was a learning experience and I actually enjoyed it.</p>
<p>Sadly the batteries in my camera ran out so I was never able to take any pictures of the polished axle but last week I was finally able to snap a photo of the end result. I&#8217;ve been driving the car and apparently have picked up a couple of seed capsules which stuck to the corrosion protection I put on. They account for all the small white spots that you see on the following picture.</p>
<p><a href="http://www.dholm.com/wp-content/uploads/2008/06/rear-axle-3.jpg"><img class="alignnone size-medium wp-image-76" title="rear-axle-3" src="http://www.dholm.com/wp-content/uploads/2008/06/rear-axle-3.jpg" alt="Rear axle, after work" width="480" /></a></p>
<p>My next project will be to convert the air conditioning system from R-12 to R-134a.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/06/12/rear-axle-cleanup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Synchronized variable access in C++</title>
		<link>http://www.dholm.com/2008/06/02/synchronized-variable-access-in-c/</link>
		<comments>http://www.dholm.com/2008/06/02/synchronized-variable-access-in-c/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 15:20:52 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=69</guid>
		<description><![CDATA[I&#8217;m working with an API for a closed source library that comes with a recommendation of using two separate threads when passing it data in order to ensure that the data pipelines are never empty. I&#8217;ve been doing it for a while but recently we had a lot of stability issues. After some digging I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working with an API for a closed source library that comes with a recommendation of using two separate threads when passing it data in order to ensure that the data pipelines are never empty. I&#8217;ve been doing it for a while but recently we had a lot of stability issues. After some digging I tried to rewrite the two threads into one that multiplexed the calls instead and suddenly stability was back again. I think that if you recommend that people access your API via threads it would be nice to indicate that some calls aren&#8217;t thread safe, but no.</p>
<p>I decided to design a generic type that would allow synchronized access to any kind of variable while utilizing RAII to ensure that it is unlocked automatically. The task turned out to be a little more complicated than I first expected but after some trial and error I came up with a solution that I found had a good functionality/aesthetic ratio.</p>
<pre>template &lt;typename T&gt;
class SynchronizedVariable : public boost::non_copyable {
public:
    class Accessor {
    public:
        T* operator-&gt;() {
            return m_variable;
        }

        const T* operator-&gt;() const {
            return m_variable;
        }

    private:
        Accessor(const boost::recursive_mutex::scoped_lock&amp; lock, T* variable) :
            m_lock(lock),
            m_variable(variable) { }

        const boost::recursive_mutex::scoped_lock&amp; m_lock;
        T* m_variable;

        friend class SynchronizedVariable&lt;T&gt;;
    };

    SynchronizedVariable(const T&amp; variable) :
        m_mutex(),
        m_variable(variable) { }

    SynchronizedVariable() :
        m_mutex(),
        m_variable() { }

    const Accessor get() const {
        return Accessor(m_mutex, &amp;m_variable);
    }

    Accessor get() {
        return Accessor(m_mutex, &amp;m_variable);
    }

private:
    mutable boost::recursive_mutex m_mutex;
    T m_variable;
};</pre>
<p><em>SynchronizedVariable</em> is the actual container for the variable and you can either pass it a constant reference to an existing instance which will be copied or create a new empty instance. The idea is that you should not be able to retain an external copy which can be accessed unprotected. It is of course possible to access the original instance if the variable is copied but this is a limited case of programming error.</p>
<p>Subsequent accesses to the variable must go through an instance of the <em>SynchronizedVariable&lt;T&gt;::Accessor</em> object which ensures that the variable is protected by a mutex and that it is automatically unlocked when the accessor goes out of scope. It is of course possible to add <em>lock</em>/<em>unlock</em> methods to it so that the user can limit the scope of the lock. Personally I try to limit all my scopes as much as possible, especially in areas of code which is executed frequently and during performance sensitive moments.</p>
<p>Accessor is storing the variable as a pointer rather than a reference. The reasoning behind this is that <em>operator-&gt;</em> has to return a pointer so storing a reference does not make a lot of sense. There is also a lot of mutex locking/unlocking going on if you instantiate the accessor in frequently called small scopes so be prepared to dust off <em>gprof</em> if you suspect that this is the case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/06/02/synchronized-variable-access-in-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Screen as a Serial Terminal</title>
		<link>http://www.dholm.com/2008/05/28/screen-as-a-serial-terminal/</link>
		<comments>http://www.dholm.com/2008/05/28/screen-as-a-serial-terminal/#comments</comments>
		<pubDate>Wed, 28 May 2008 10:04:26 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=72</guid>
		<description><![CDATA[While googling how to revert local changes in my git working tree I found a great blog entry titled Screen as Serial Terminal. Like the author I had no idea you could use screen as a serial terminal but it is actually pretty nifty since Minicom, even though a great application, usually is a little [...]]]></description>
			<content:encoded><![CDATA[<p>While googling how to revert local changes in my git working tree I found a great blog entry titled <a title="Screen as Serial Terminal" href="http://bryan-murdock.blogspot.com/2008/02/screen-as-serial-terminal.html">Screen as Serial Terminal</a>. Like the author I had no idea you could use screen as a serial terminal but it is actually pretty nifty since <a title="Minicom" href="http://alioth.debian.org/projects/minicom/">Minicom</a>, even though a great application, usually is a little overkill for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/05/28/screen-as-a-serial-terminal/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unsolved Mysteries</title>
		<link>http://www.dholm.com/2008/05/23/unsolved-mysteries/</link>
		<comments>http://www.dholm.com/2008/05/23/unsolved-mysteries/#comments</comments>
		<pubDate>Fri, 23 May 2008 12:23:49 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=71</guid>
		<description><![CDATA[Here is a collection of some of the most well known unsolved mysteries (links to Wikipedia). They make for good reading on a rainy day.
Wow! Signal - Possibly extraterrestrial signal caught by SETI on August 15, 1977
Valentich Disappearance - Disappeared without a trace in a Cessna October 21, 1978 after reporting that he encountered a [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a collection of some of the most well known unsolved mysteries (links to <a title="Wikipedia" href="http://www.wikipedia.org/">Wikipedia</a>). They make for good reading on a rainy day.</p>
<p><a title="Wow! Signal" href="http://en.wikipedia.org/wiki/Wow!_signal">Wow! Signal</a> - Possibly extraterrestrial signal caught by SETI on August 15, 1977<a title="Wow! Signal" href="http://en.wikipedia.org/wiki/Wow!_signal"><br />
</a><a title="Valentich Disappearance" href="http://en.wikipedia.org/wiki/Frederick_Valentich">Valentich Disappearance</a> - Disappeared without a trace in a Cessna October 21, 1978 after reporting that he encountered a strange flying object<br />
<a title="Roanoke Colony" href="http://en.wikipedia.org/wiki/Roanoke_Colony">The Lost Colony</a> - 16th century colony where all the inhabitants disappeared<br />
<a title="Mary Celeste" href="http://en.wikipedia.org/wiki/Mary_Celeste">Mary Celeste</a> - Brigantine ghost ship discovered outside the strait of Gibraltar in December, 1872<br />
<a title="Felix Moncla" href="http://en.wikipedia.org/wiki/Felix_Moncla">Felix Moncla</a> - USAF pilot that disappeared while pursuing an unidentified flying object in 1953<br />
<a title="Ararat Anomaly" href="http://en.wikipedia.org/wiki/Ararat_anomaly">Ararat Anomaly</a> - Unidentified object visible via satellite and aerial reconnaissance in a hard to reach location on mount Ararat<br />
<a title="Oak Island Money Pit" href="http://en.wikipedia.org/wiki/Oak_Island_Money_Pit">Oak Island</a> - Location of a strange pit that many believe contain a hidden treasure<a title="Oak Island Money Pit" href="http://en.wikipedia.org/wiki/Oak_Island_Money_Pit"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2008/05/23/unsolved-mysteries/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
