This commit is contained in:
Ilkka Seppälä
2019-12-13 21:09:28 +02:00
parent 0335c61512
commit b2b1ba95eb
127 changed files with 282 additions and 450 deletions

View File

@ -3,11 +3,9 @@ layout: pattern
title: Thread Local Storage
folder: tls
permalink: /patterns/tls/
pumlid:
categories: Concurrency
categories: Idiom
tags:
- Java
- Difficulty-Intermediate
- Performance
---
## Intent
@ -19,5 +17,5 @@ Securing variables global to a thread against being spoiled by other threads. Th
## Applicability
Use the Thread Local Storage in any of the following situations
* when you use class variables in your Callable / Runnable object that are not read-only and you use the same Callable instance in more than one thread running in parallel.
* when you use static variables in your Callable / Runnable object that are not read-only and more than one instances of the Callable / Runnable may run in parallel threads.
* When you use class variables in your Callable / Runnable object that are not read-only and you use the same Callable instance in more than one thread running in parallel.
* When you use static variables in your Callable / Runnable object that are not read-only and more than one instances of the Callable / Runnable may run in parallel threads.