[concurrency-interest] reusing threads and thread local state

Osvaldo Pinali Doederlein osvaldo at visionnaire.com.br
Wed May 4 07:30:46 EDT 2005


Hi,

Gregg Wonderly wrote:
> Larry Riedel wrote:
> I don't use threadlocals myself because it is just as easy to use a
> Hashtable<Thread,Hashtable<String,?>> via a static factory which I can 
> control access to and manage clearing etc on my own.

Humm... I always assumed that ThreadLocal is more efficient and it
should play better with thread deaths.  I see in the source that it's
indeed highly customized an optimized, using its own implementation of
Map, private variables from Thread etc.  Not to mention quoting Donald
Knuth's algorithms, so I feel better using it ;)

A+
Osvaldo

-- 
-----------------------------------------------------------------------
Osvaldo Pinali Doederlein                   Visionnaire Informática S/A
osvaldo at visionnaire.com.br                http://www.visionnaire.com.br
Arquiteto de Tecnologia                          +55 (41) 337-1000 #223



More information about the Concurrency-interest mailing list