Link Details

Link 41895 thumbnail
User 217101 avatar

By gst
via blog.objectmentor.com
Published: Sep 16 2007 / 22:10

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 faulty assumption 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: “An object is an abstraction of function. A thread is an abstraction of schedule.” (discussed here: http://www.infoq.com/news/2007/09/confusing_uow_with_threads InfoQ: Confusing unit-of-work with threads )
  • 13
  • 1
  • 1160
  • 513

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.