[concurrency-interest] reusing threads and thread local state

Joshua Bloch jbloch at gmail.com
Sat Apr 30 13:33:17 EDT 2005


I couldn't disagree more strongly.  It's equally reasonable to ask to
iterate through all of the fields contained in an instance (whatever
their access level).  Both are blatant violations of the access
guarantees offered by the language.  People have been writing classes
using ThreadLocal for years under the impression that a private
ThreadLocal really is private.  To change the rules at this late date
would be unthinkable.



On 30 Apr 2005 17:25:52 -0000, Larry Riedel <larryr at saturn.sdsu.edu> wrote:
> It seems to me plainly reasonable to ask to be able
> to iterate through all the ThreadLocals associated
> with a particular Thread, as well as to be able to
> clear each one found via iteration, regardless of
> whether there is a provided method which promises
> to clear all the ThreadLocals, or whether clearing
> them would (not) put the Thread in a pristine state.
> Larry
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest

More information about the Concurrency-interest mailing list