This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes ThreadLocal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "ThreadLocal" Watch "ThreadLocal" New topic


Dhaval Shah
Ranch Hand

Joined: Jun 10, 2005
Posts: 56
Can anyone please tell me the significance of ThreadLocal class ? i.e. as per the application point of view

Thanks and Regards,<br />Dhaval Shah<br />SCJP 1.4<br />SCWCD 1.4
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 9953

Have a look at:

[My Blog] [JavaRanch Journal]
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Some people find it helpful to conceptualise a thread local as being an associative type that is keyed by the type Thread. Simply, a Map<Thread, T>. The analogy is quite useful and not dangerous (i.e. there is little opportunity to be misled).

Tony Morris
Java Q&A (FAQ, Trivia)
I agree. Here's the link:
subject: ThreadLocal
Similar Threads
Design Connection with respect to DataBase Connection
ThreadLocal and GC
thrading + class instance
Is this thread safe? Simple question.
Some ThreadLocal issues