<html><body><div dir="ltr">Hello loom-dev team,<div><br></div><div dir="ltr">Firstly, I'd like to express my appreciation for your work on Project Loom.</div><div dir="ltr">I have a couple of questions regarding ThreadLocal and the motivation behind introducing ScopedValues that I hope you can clarify for me.</div><div dir="ltr"><br></div><div dir="ltr"><ol start="1" style="margin:0px" dir="ltr"><li>I'm starting to deep how ScopedValues works(ref: <font color="#419cff"><span style="--dark-color: var(--NSColor_linkColor);"><a href="https://github.com/openjdk/jdk/blob/dc4bc4f0844b768e83406f44f2a9ee50686b1d9d/src/java.base/share/classes/java/lang/Thread.java#L302">https://github.com/openjdk/jdk/blob/dc4bc4f0844b768e83406f44f2a9ee50686b1d9d/src/java.base/share/classes/java/lang/Thread.java#L302</a></span></font>) and noticed that ScopedValues' snapshots are placed in the same place as the map of ThreadLocals. However, I'm struggling to grasp why a LinkedList of maps within the Thread field is favoured over a HashMap? I understand that ScopedValues have a concept of scope and are immutable, but I'm curious as to why it wasn't considered to introduce a new API for TL that would incorporate scope and immutability. Are there technical reasons that make ScopedValues superior to TL, or was enhancing ThreadLocal (by adding scope and immutability) not a viable option?</li><li>Many users and libraries use ThreadLocal for object pooling(which can have a major performance impact). Do you have any recommendations for migrating these use cases? Perhaps to some form of global cache?</li></ol><div><br></div><div dir="ltr">Best regards,</div><div dir="ltr">Ilya Starchenko</div><div dir="ltr"><br></div><div dir="ltr">P.S. I am not a JDK developer; I am simply trying to gain a deeper understanding of this topic. Thank you for your assistance.<br></div></div></div></body></html>