<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog: Thread Local: A Convenient Abomination.</title>
    <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Thread Local: A Convenient Abomination.</title>
      <description>&lt;p&gt;ThreadLocal variables are a wonderfully convenient way to associate data with a given thread.  Indeed, frameworks like Hibernate take advantage of this to hold session information.  However, the practice depends upon assumption that a thread is equivalent to a unit-of-work.  This is a &lt;em&gt;faulty&lt;/em&gt; assumption&lt;/p&gt;


	&lt;p&gt;Thirteen years ago, while working on my first book, Jim Coplien and I were having a debate on the nature of threads and objects.  He made a clarifying statement that has stuck with me since.  He said: &lt;em&gt;&amp;#8220;An object is an abstraction of function.  A thread is an abstraction of schedule.&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;It has become the norm, in Java applications, to assume that there is a one-to-one correspondence between a thread, and a unit-of-work.  This appears to make sense since every Servlet request has it&amp;#8217;s own particular thread.  Framework authors have built on this assumption by putting unit-of-work related information (e.g. session) into ThreadLocal variables.&lt;/p&gt;


	&lt;p&gt;Clearly, the more ThreadLocal variables that hold unit-of-work related information, the more that the thread and the unit-of-work are related.  While very convenient, the basic assumption is dead wrong.&lt;/p&gt;


	&lt;p&gt;A unit-of-work is a task to be performed.  There is no rule that says that this task must be single threaded.  Nor is there any rule that says that the components of the task must run at the same priority.  Indeed, it is not uncommon for a task to have a high-priority event driven part, and a low priority compute-bound part.&lt;/p&gt;


	&lt;p&gt;Consider, for example, a unit-of-work that makes a request from a third-party-service, and then processes the response with a complex number-crunching algorithm.  We want the request to run at a high priority so that it is not waiting for other low priority compute-bound tasks to finish.  On the other hand, we want the number-cruncher to run at a low priority so that it yields the processor as soon as possible whenever one of the high priority requests needs a few cycles.&lt;/p&gt;


	&lt;p&gt;Clearly these two tasks form a complete unit-of-work, but just as clearly they should run as two different threads&amp;#8212;probably with a queue in between them in a standard producer-consumer model.&lt;/p&gt;


	&lt;p&gt;Where are the unit-of-work related variables?  They can&amp;#8217;t be kept in a ThreadLocal since each part of the task runs in a separate thread.  They can&amp;#8217;t be kept in static variables since there is more than one thread.  The answer is that they have to be passed around between the threads as function arguments on the stack, and recorded in the data structured placed on the queue.&lt;/p&gt;


	&lt;p&gt;So, though convenient, ThreadLocal variables confuse the issue of separating function from schedule.  They tempt us to couple function and schedule together.  This is unfortunate since the correspondence of function and schedule is weak and accidental.&lt;/p&gt;


	&lt;p&gt;What we&amp;#8217;d really like is to be able to create UnitOfWorkLocal variables.&lt;/p&gt;</description>
      <pubDate>Tue, 04 Sep 2007 10:16:31 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:911e858a-8063-4029-adba-a4db194054e3</guid>
      <author>Uncle Bob</author>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination</link>
      <category>Uncle Bob's Blatherings</category>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by mts to mov</title>
      <description>&lt;p&gt;&lt;a href="http://www.mtstoavi.net/mts-to-mov.html" rel="nofollow"&gt;&lt;b&gt;MTS to MOV&lt;/b&gt;&lt;/a&gt; Converter is a powerful and easy-to-use MPEG to AVI converter, which enables you to effortlessly convert MTS to AVI, MTS to MPEG, MTS to MP4, MTS to 3GP, MTS to WMV, MTS to RM, MTS to RMVB, MTS to FLV, MTS to VCD/SVCD/DVD, MTS to iPod MP4, MTS to PSP MP4 and so forth with high quality. It supports adding watermarks,subtitles to the videos.
&lt;a href="http://www.mtstoavi.net/mts-to-mp4.html" rel="nofollow"&gt;&lt;b&gt;MTS to MP4&lt;/b&gt;&lt;/a&gt;
&lt;a href="http://www.mtstoavi.net/mts-to-wmv.html" rel="nofollow"&gt;&lt;b&gt;MTS to WMV&lt;/b&gt;&lt;/a&gt;
&lt;a href="http://www.mtstoavi.net/mts-to-mpg.html" rel="nofollow"&gt;&lt;b&gt;MTS to MPG&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 28 Dec 2011 20:03:47 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:254db4a4-7b7c-4d8a-9824-6bc979a12b9a</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-193004</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by beats by dr dre</title>
      <description>&lt;p&gt;A university student&lt;a href="http://www.drdrebeatsheadphones-australia.com" rel="nofollow"&gt;beats by dr dre&lt;/a&gt; caught by the enemy, the enemy tied him at the poles,&lt;a href="http://www.drdrebeatsheadphones-australia.com/justbeats-solo-purple-onear-headphones-with-controltalk-p-234.html" rel="nofollow"&gt;just beats solo headphones purple&lt;/a&gt; and then asked him: say, where are you? You do not say it electrocuted! S&lt;a href="http://www.drdrebeatsheadphones-australia.com/cheap-drdre-beats-studio-limited-edition-headphones-blackyellow-p-185.html" rel="nofollow"&gt;cheap dr.dre beats studio headphones balck/yellow&lt;/a&gt;tudents back to the enemy a word, the result was electrocuted, he said: I am TVU.&lt;a href="http://www.drdrebeatsheadphones-australia.com/cheap-beats-by-drdre-pro-performance-professional-headphones-white-p-192.html" rel="nofollow"&gt;Hot sale beats by dr dre pro  headphones&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 15 Nov 2011 03:36:49 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:45874149-9f6a-449a-b79a-59c39ad5c593</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-173102</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by christian louboutin</title>
      <description>&lt;p&gt;Berkeley had a liberal element in the student body who tended to be quite active. I think that&#8217;s in general a feature of intellectually active places.&lt;/p&gt;</description>
      <pubDate>Thu, 03 Nov 2011 11:38:47 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:176f76c5-2478-4861-9fbe-642922872ad0</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-167728</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by christian louboutin</title>
      <description>&lt;p&gt;The professional design make you foot more comfortable. Even more tantalizing,this pattern make your legs look as long as you can,it will make you looked more attractive.Moveover,it has reasonable price.If you are a popular woman,do not miss it.&lt;/p&gt;


	&lt;p&gt;Technical details of Christian Louboutin Velours Scrunch Suede Boots Coffee:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;Color: Coffee
Material: Suede
4(100mm) heel
Signature red sole x&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Fashion, delicate, luxurious Christian louboutins shoes on sale, one of its series is Christian Louboutin Tall Boots, is urbanism collocation. This Christian louboutins shoes design makes people new and refreshing. Red soles shoes is personality, your charm will be wonderful performance.&lt;/p&gt;</description>
      <pubDate>Thu, 03 Nov 2011 11:16:15 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:584a6cd1-582d-4c62-9178-ea6d8cdce150</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-167708</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Tips For Bowling</title>
      <description>&lt;p&gt;Berkeley had a liberal element in the student body who tended to be quite active. I think that&amp;#8217;s in general a feature of intellectually active places.&lt;/p&gt;</description>
      <pubDate>Thu, 20 Oct 2011 15:51:25 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:a8d3e2c7-1864-42ff-a126-26bc986fb5da</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-160289</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Gucci taschen</title>
      <description>&lt;p&gt;Ich mag dieses Artikels, sind besonders gut.&lt;/p&gt;</description>
      <pubDate>Wed, 19 Oct 2011 22:23:43 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3994962f-1816-4076-a4b5-42be265e22dd</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-159868</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by sarviv</title>
      <description>&lt;p&gt;i go dhis&lt;/p&gt;</description>
      <pubDate>Wed, 05 Oct 2011 14:11:39 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5ffd9ae1-57b6-43f4-9ee2-c9b6ddebc90e</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-150570</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by shanewatson404@gmail.com</title>
      <description>&lt;p&gt;I really &lt;a href="http://mechanicalengineeringjobdescription.com/" rel="nofollow"&gt;Mechanical Engineering Job Description&lt;/a&gt; love this articles and you &lt;a href="http://chiefexecutiveofficerjobdescription.net/" rel="nofollow"&gt;Chief Executive Officer Job Description&lt;/a&gt; can read those articles that &lt;a href="http://desktopsupportjobdescription.com/" rel="nofollow"&gt;Desktop Support Job Description&lt;/a&gt; to very much attractive for the info &lt;a href="http://policeofficerjobdescription.net/" rel="nofollow"&gt;Police Officer Job Description&lt;/a&gt; You can never forget this info and improve your knowledge in this blog&lt;/p&gt;</description>
      <pubDate>Sat, 01 Oct 2011 04:23:36 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:74fba6f6-e781-467d-b90c-e0042fd60e3c</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-148876</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by drosim</title>
      <description>&lt;p&gt;ok&lt;/p&gt;</description>
      <pubDate>Sat, 17 Sep 2011 17:38:32 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1e21f666-f743-4b61-8370-ad3d36c61186</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-141955</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by beats by dre store</title>
      <description>&lt;p&gt;with the intuitive and clear interface, it is very easy even for the beginner. So you can have a try of this excellent PDF to EPUB converter. It will benefit you a lo&lt;a href="http://www.drdrebeatsheadphones-australia.com" rel="nofollow"&gt;beats by dre sale&lt;/a&gt;
&lt;a href="http://www.drdrebeatsheadphones-australia.com" rel="nofollow"&gt;cheap beats by dre&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 23 Aug 2011 02:39:25 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f27cd018-e948-4eda-85cb-5b7baf5022a4</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-131617</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by beats by dre store</title>
      <description>&lt;p&gt;with the intuitive and clear interface, it is very easy even for the beginner. So you can have a try of this excellent PDF to EPUB converter. It will benefit you a lo&lt;/p&gt;</description>
      <pubDate>Tue, 23 Aug 2011 02:38:50 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:ec9e9c58-40ec-4d91-a2cd-ae9778280142</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-131615</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by husky tool boxes</title>
      <description>&lt;p&gt;Kinda cerebral for me)) You&amp;#8217;re too clever i guess&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Sun, 21 Aug 2011 08:37:12 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:323f56d1-86f1-4ef4-8e54-2da4047321aa</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-130299</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Bowtrol</title>
      <description>&lt;p&gt;it needs a bokmark so i can come back to it later ,nice stuff&lt;/p&gt;</description>
      <pubDate>Mon, 08 Aug 2011 15:59:35 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1a46c6a4-1329-46a1-bd38-7ebff523cb8b</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-125725</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by air max 24/7 cheap</title>
      <description>&lt;p&gt;Cool stuff. Icon generator rocks! Thanks for these links.&lt;/p&gt;</description>
      <pubDate>Wed, 06 Jul 2011 07:47:04 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3ea6b6f0-ac30-4833-8311-84d6f3629853</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-115256</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by ?????? ???</title>
      <description>&lt;p&gt;shop  good for me&lt;/p&gt;</description>
      <pubDate>Wed, 15 Jun 2011 12:03:23 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:caa6e965-8078-4864-b684-8654cbbb4946</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-111180</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Epub Conversion</title>
      <description>&lt;p&gt;Looking for more post and it&amp;#8217;s really useful to me&amp;#8230;.&lt;/p&gt;</description>
      <pubDate>Wed, 08 Jun 2011 07:24:11 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:463cafe3-10db-460b-9064-4e9e6582c461</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-109054</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Pondicherry Jobs</title>
      <description>&lt;p&gt;Thanks for the good post&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Wed, 08 Jun 2011 07:23:17 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d62b6a43-104b-405c-9f53-1cdadc2e7cfc</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-109053</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Jewellery</title>
      <description>&lt;p&gt;Online UK costume and fashion jewellery shop with,
Online UK costume and fashion jewellery shop with,
Online UK costume and fashion jewellery shop with,
Online UK costume and fashion jewellery shop with,&lt;/p&gt;</description>
      <pubDate>Sat, 04 Jun 2011 06:05:23 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:64b7ae84-98a2-42ba-a6c9-d1220cb5c346</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-108070</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by beats by dr dre headphones</title>
      <description>&lt;p&gt;I found that his foot odors never bring us to death.I never regret buying these &lt;a href="http://www.drebeatsstudio.com/beats-by-dr-dre-studio-c-3.html" rel="nofollow"&gt;beats by dr dre studio&lt;/a&gt; for him.
These &lt;a href="http://www.drebeatsstudio.com/beats-by-dr-dre-solo-c-5.html" rel="nofollow"&gt;beats by dr dre solo&lt;/a&gt; are just the same as selling in the franchise store.Or even better.&lt;/p&gt;</description>
      <pubDate>Fri, 03 Jun 2011 23:58:40 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:13507680-b28b-4531-b414-7b75f9ea03fc</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-107901</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by christian louboutin shoes on sale</title>
      <description>&lt;p&gt;These &lt;a href="http://www.blacklouboutinshoes.com/pumps-c-2.html" rel="nofollow"&gt;christian louboutin patent leather pumps&lt;/a&gt; are just the same as selling in the franchise store.Or even better.
Quite cheap &lt;a href="http://www.blacklouboutinshoes.com/platforms-c-3.html" rel="nofollow"&gt;christian louboutin leather platform pumps&lt;/a&gt;.I could say this is the best one I have ever ordered online.&lt;/p&gt;</description>
      <pubDate>Fri, 03 Jun 2011 08:35:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2b122c6c-88c5-4095-a99f-52459c7b624d</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-107735</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by ?????? ???????</title>
      <description>&lt;p&gt;This research I developed the quantitative reasoning.&lt;/p&gt;</description>
      <pubDate>Mon, 23 May 2011 16:40:32 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e3779ca9-9095-4514-bc02-1770457507aa</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-102770</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by okey oyunu oyna </title>
      <description>&lt;p&gt;interesting issue &amp;#8230;&lt;/p&gt;


	&lt;p&gt;internette g&#246;r&#252;nt&#252;l&#252; olarak &lt;a href="http://www.okeyoyunu-oyna.com" rel="nofollow"&gt;okey oyunu oyna&lt;/a&gt;, ger&#231;ek kisilerle tanis,
 turnuva heyecanini yasa.&lt;/p&gt;</description>
      <pubDate>Wed, 27 Apr 2011 11:37:55 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:0a879d98-df48-4c83-bb87-b46c36991f61</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-91806</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by rx oakley sunglasses</title>
      <description>&lt;p&gt;Tremendously educational many thanks, I reckon your trusty readers would definitely want even more writing like this carry on the excellent hard work.&lt;/p&gt;</description>
      <pubDate>Mon, 25 Apr 2011 01:23:02 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:93721679-5721-4535-a0ef-abdace792d55</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-90195</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by jaychouchou</title>
      <description>&lt;p&gt;To be, or not to be- that is a question.Whether &lt;a href="http://www.voien.com/" rel="nofollow"&gt;ipad bag&lt;/a&gt; tis nobler in the mind to suffer The slings and &lt;a href="http://www.fjblcy.com/" rel="nofollow"&gt;Game Controllers&lt;/a&gt; arrows of outrageous fortune Or to take arms against a sea of troubles, And &lt;a href="http://www.dewkett.com/" rel="nofollow"&gt;USB Gadgets&lt;/a&gt; by opposing end them.66666666666&lt;/p&gt;</description>
      <pubDate>Sat, 19 Mar 2011 02:37:24 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d9184894-50cf-4b09-925e-ffcbfa2b2557</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-73855</link>
    </item>
    <item>
      <title>"Thread Local: A Convenient Abomination." by Designer Sunglasses</title>
      <description>&lt;p&gt;At fashion-world4u you find  Imitation&lt;/p&gt;</description>
      <pubDate>Thu, 10 Mar 2011 04:24:23 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:7e5ae16a-c79b-474c-891e-8c1af99aceda</guid>
      <link>http://blog.objectmentor.com/articles/2007/09/04/thread-local-a-convenient-abomination#comment-71549</link>
    </item>
  </channel>
</rss>

