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
)
Add your comment
Voters For This Link (13)
-
gst -
bloid -
zis -
MarisO -
madlep -
puredanger -
debasishg -
Konstantin.Scheglov -
unchqua -
adobni -
peter_lawrey -
hangstrap -
dfuchs