Skip to content

Commit 26b79a5

Browse files
authored
Update README.md
Some additonal description, deleted wrong pumlid
1 parent e210e4e commit 26b79a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tls/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ layout: pattern
33
title: Thread Local Storage
44
folder: tls
55
permalink: /patterns/tls/
6-
pumlid: 5Sd13OGm30NHLg00uZlTc62HeCI9x6-s_ONJF6dMghd5AM5jAS3qdSZubwwA4aUuM1uAKQGyEg6CpZxSwUQ7jrEyNhfD1iJKwNql2Cr9aB-ci9vczFO7
6+
pumlid:
77
categories: Concurrency
88
tags:
99
- Java
1010
- Difficulty-Intermediate
1111
---
1212

1313
## 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
14+
Securing variables global to a thread, i.e. class variables if a Callable object,
15+
against being spoiled by other threads using the same instance of the Callable object
1616

1717
![alt text](./etc/tls.png "Thread Local Storage")
1818

1919
## Applicability
2020
Use the Thread Local Storage in any of the following situations
2121

22-
* when you use class variables in your Runnable Object that are not read-only
22+
* when you use class variables in your Callable Object that are not read-only and you use the same Callable instance in more than one thread running in parallel
23+
* when you use static variables in your Callable Object that are not read-only and more than one instances of the Callable may run in parallel threads.

0 commit comments

Comments
 (0)