File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ layout : pattern
3
+ title : Thread Local Storage
4
+ folder : tls
5
+ permalink : /patterns/tls/
6
+ pumlid : 5Sd13OGm30NHLg00uZlTc62HeCI9x6-s_ONJF6dMghd5AM5jAS3qdSZubwwA4aUuM1uAKQGyEg6CpZxSwUQ7jrEyNhfD1iJKwNql2Cr9aB-ci9vczFO7
7
+ categories : Concurrency
8
+ tags :
9
+ - Java
10
+ - Difficulty-Intermediate
11
+ ---
12
+
13
+ ## Intent
14
+ Securing variables global to a thread, i.e. class variables of the Runnable object,
15
+ against being spoiled by other threads using the same instance of the Runnable object
16
+
17
+ ![ alt text] ( ./etc/tls.png " Thread Local Storage ")
18
+
19
+ ## Applicability
20
+ Use the Thread Local Storage in any of the following situations
21
+
22
+ * when you use class variables in your Runnable Object that are not read-only
You can’t perform that action at this time.
0 commit comments