> From: Bill Davidson [mailto:bill...@gmail.com] 
> Subject: Re: iCal4j and ThreadLocal

> It still felt a bit fuzzy to me.  It's getting a little more 
> in focus but it's kind of a weird thing.

There's a lot of baggage implemented to support ThreadLocal.  It's one of those 
deceptively easy-to-use Java concepts that utilizes a lot of plumbing 
underneath the covers (e.g., a specialized per-thread expandable hash map, weak 
references).  The basic implementation is that of a hash map per thread, using 
the ThreadLocal object as the key, and the reference from the argument to 
ThreadLocal.set() as the value.  There's no actual requirement that the values 
are in fact thread-local, but they usually are so that synchronization can be 
avoided.

Then there's InheritableThreadLocal, which explicitly shares nominally 
thread-local values across threads...

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to