Why should Java ThreadLocal variables be static
- by kellyfj
I was reading that JavaDoc for Threadlocal here
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ThreadLocal.html
and it says
"ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID). "
But my question is why did they choose to make it static (typically) - it makes it a bit confusing to have "per thread" state but its static?