Java ThreadLocal

Publié le: 20 septembre 2020
sur la chaîne: Jakob Jenkov
37,387
1.1k

The Java ThreadLocal class is capable of keeping a single value internally per thread that accesses it. That means, that if multiple threads share a Java ThreadLocal, each of them can set their own value inside the ThreadLocal without overwriting each other's values. When getting the value again, each thread will get the latest value it has set on the ThreadLocal - and not any value set by other threads.

Chapters
0:00 Java ThreadLocal introduction incl. set() and get()
3:18 Java ThreadLocal remove() method
5:20 Java ThreadLocal with initial value
8:33 Set value lazily on Java ThreadLocal
10:21 Using a Java ThreadLocal from within an thread pool
11:39 Java InheritableThreadLocal

Java ThreadLocal - text:
http://tutorials.jenkov.com/java-conc...

Java Concurrency - text / video
http://tutorials.jenkov.com/java-conc...
   • Java Concurrency and Multithreading  

Java Examples GitHub repo:
https://github.com/jjenkov/java-examples


Sur cette page du site, vous pouvez voir la vidéo en ligne Java ThreadLocal durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Jakob Jenkov 20 septembre 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 37,387 fois et il a aimé 1.1 mille téléspectateurs. Bon visionnage!