You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Issue In the 4th chapter of this article, I believe there is a mistake in your demonstration of how to use ThreadLocal, the example does not effectively illustrate the true functionality of ThreadLocal.
The main functionality of ThreadLocal is for thread isolate, actully, you have created two objects, thus they have own threadlocal
object, i believe that there are no share
The purpose of ThreadLocal is to provide thread isolation. However, the code example you provided actually creates two separate ThreadLocal objects, with each thread having its own independent ThreadLocal object. I believe that this does not demonstrate thread sharing and, as a result, fails to illustrate the effect of thread isolation.
The text was updated successfully, but these errors were encountered:
Article and Module Links
https://www.baeldung.com/java-threadlocal
core-java-modules/core-java-concurrency-advanced/src/test/java/com/baeldung/threadlocal/ThreadLocalIntegrationTest.java
Describe the Issue
In the 4th chapter of this article, I believe there is a mistake in your demonstration of how to use ThreadLocal, the example does not effectively illustrate the true functionality of ThreadLocal.
The main functionality of ThreadLocal is for thread isolate, actully, you have created two objects, thus they have own threadlocal
object, i believe that there are no share
The purpose of ThreadLocal is to provide thread isolation. However, the code example you provided actually creates two separate ThreadLocal objects, with each thread having its own independent ThreadLocal object. I believe that this does not demonstrate thread sharing and, as a result, fails to illustrate the effect of thread isolation.
The text was updated successfully, but these errors were encountered: