<?xml version='1.0' encoding='utf-8' ?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>urn:wd:wdlabs.com:atom1:twilight</id>
  <title>The Twilight Report</title>
  <subtitle>Your Home For Snappy Repartee</subtitle>
  <author>
    <name>應龍</name>
  </author>
  <link rel="alternate" type="text/html" href="http://www.wdlabs.com/twilight" />
  <link rel="self" type="text/xml" href="http://www.wdlabs.com/twilight/atom" />
  <updated></updated>
  <link rel="service.feed" type="application/x.atom+xml" href="http://www.wdlabs.com/twilight/atom" title="The Twilight Report" />
    <entry>
      <id>urn:wd:wdlabs.com:atom1:twilight:20080925.1203</id>
      <link rel="alternate" type="text/html" href="http://www.wdlabs.com/twilight/entry/20080925.1203" />
      <issued>2008-09-25T16:03:00</issued>
      <title>lp0 on fire</title>
      <published>2008-09-25T16:03:00</published>
      <updated>2008-09-25T16:03:00</updated>
      <content type="html">&lt;p&gt;I wonder why they bother teaching concurrency in computer science.
There is this &lt;a href=&quot;http://en.wikipedia.org/wiki/Dining_philosophers_problem&quot;&gt;funny problem&lt;/a&gt; 
they teach you,
involving &lt;i&gt;n&lt;/i&gt; philosophers and &lt;i&gt;n&lt;/i&gt; forks and a big pot of spaghetti
which, if you solve it wrongly, could cause &lt;i&gt;n&lt;/i&gt; philosophers to
die of starvation.  It's a well understood problem, and there are tones
of tools to address it properly, most of which have been around for 
decades on every platform imaginable.&lt;/p&gt;

&lt;p&gt;When I was working on parallel abstraction and timing at The Company,
I went to a lot of effort to make sure that it worked concurrently.
This put me in conflict with people who were too lazy to make sure
their code worked properly in parallel.  I even tried to make tools
to make it easier for them to make code parallel safe, but no, that
was too much effort, even though it mostly amounted to using a different
class with the exact same interface.&lt;/p&gt;

&lt;p&gt;In my current job at &lt;small&gt;s-mart&lt;/small&gt; we use a locking mechanism which 
has an inherent race condition.  Which means if something goes wrong
it might corrupt data.  Admittedly, the odds of that are quite low,
but I don't understand why we don't use proper locking (ie. flock),
which isn't conceptually any more complicated than the
&quot;simple&quot;&lt;sup&gt;[&lt;a href=&quot;#20080925.12031&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt; locking scheme that we use.  In my 
last job at Company 2, we had a similar locking scheme, but
it was hand coded, they didn't even bother to re-use the &quot;simple&quot;
locking scheme provided by perl for systems that don't have 
flock&lt;sup&gt;[&lt;a href=&quot;#20080925.12032&quot;&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;/p&gt;

&lt;p&gt;I found this list of the 
&lt;a href=&quot;http://technologizer.com/2008/09/18/errormessage/&quot;&gt;The Thirteen Greatest Error Messages of All Time&lt;/a&gt;.
I can't help but wonder if a bit more time thinking about 
concurrency could have kept some of these from happening often
enough to make the list.&lt;/p&gt;
&lt;br/&gt;&lt;br/&gt;&lt;hr width=&quot;20%&quot; align=&quot;left&quot;/&gt;
&lt;ol&gt;
	&lt;li&gt;&lt;a name=&quot;20080925.12031&quot;&gt;&lt;/a&gt;read as: broken&lt;/li&gt;
	&lt;li&gt;&lt;a name=&quot;20080925.12032&quot;&gt;&lt;/a&gt;and even Windows perl has adequate flock emulation now,
so why is anyone using this again?&lt;/li&gt;
&lt;/ol&gt;
</content>
    </entry>
</feed>
    


