Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what's Thread local

 
Arunabh Dash
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
In a recent interview i was asked this question ,i.e what's Thread local ?
Can anyone give me brief describtion about it. I only know it is a API.
Even a link where i can get the information is also welcome.

Waiting 4 ur Replys
Arunabh
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ThreadLocal is a class in the JDK that implements an object that has a different value in each thread. Really, it's a lot like a Map whose keys are Threads. In fact, it may even be implemented that way in the JDK. When you set the value, it's like putting the value into the Map, with the key being the current Thread. When you get the value, it's like looking in the Map for an entry with the key being the current Thread.

There's some default value behaviour, too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!