harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [drlvm][kernel_classes] ThreadLocal vulnerability
Date Mon, 20 Nov 2006 21:51:02 GMT
Thomas Hawtin wrote:
> Tim Ellison wrote:
>> Thomas Hawtin wrote:
>>> Some modern code,
>>> such as I believe Spring, creates many ThreadLocal instances, so you may
>>> wish to look further at quality of implementation issues.
>> Ack -- thanks.  What do you call "many"?   100's? 1,000s? more?
> Good question. Googling tends to just pick up ThreadLocals assigned to
> static finals, which aren't so much of an issue. However, a private
> e-mail from someone well known for threading work contains: "There are
> web/EE applications that generate massive numbers (up to millions) of
> ThreadLocals (most are per-instance, not statics), some of which quickly
> become garbage and must be reclaimed reasonably promptly...".

Wow.  Millions of ThreadLocals in use simultaneously, or a churn?  I'm
trying to figure out if we need a WeakIdentityHashMap to collect the
dereferenced keys, or a datastructure that will scale to millions of
keys in active use.

Can you point to an example of such apps so we can try it to see how we
are doing?



Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

View raw message