A single instance of ThreadLocal can store different values for each thread separately.Values set on a thread local instance is
specific to the current Thread and any other code/logic running on this thread can see the same value, but not the values set on the thread local
instance by some other thread.
How Long Thread Local will be alive?
I have found following articles are quite explanatiry to understand pit falls of ThreadLocal.
refer :
http://javarevisited.blogspot.in/2013/01/threadlocal-memory-leak-in-java-web.html
https://plumbr.eu/blog/locked-threads/how-to-shoot-yourself-in-foot-with-threadlocals
specific to the current Thread and any other code/logic running on this thread can see the same value, but not the values set on the thread local
instance by some other thread.
How Long Thread Local will be alive?
I have found following articles are quite explanatiry to understand pit falls of ThreadLocal.
refer :
http://javarevisited.blogspot.in/2013/01/threadlocal-memory-leak-in-java-web.html
https://plumbr.eu/blog/locked-threads/how-to-shoot-yourself-in-foot-with-threadlocals
No comments:
Post a Comment