> From: lightbulb432 [mailto:[EMAIL PROTECTED]
> Subject: RE: Is ThreadLocal safe to use in servlets
>
> Is it safe to assume that this is the way to go, or are
> there ever, ever any times when it would be less desirable
> to go this route than the default thread-pool-per-c
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
lb,
lightbulb432 wrote:
> I have another question about using ThreadLocal as an instance variable in a
> threadsafe Singleton. If the Singleton has 5 instance methods, each of which
> requires use of the value stored in the ThreadLocal, I see one opti
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Martin,
Martin Gainty wrote:
> Just so I understand..you're advocating ThreadLocal over immutable
> variables or Local variables?
ThreadLocals... ya know: the power of thread variables with the
convenience of local variables.
Get with the program. T
To conserve resources when multiple elements are configured.
> No point in having a multitude of idle threads when some s
> are only lightly used or the usage pattern varies with time.
Is it safe to assume that this is the way to go, or are there ever, ever any
times when it would be less desir
> From: lightbulb432 [mailto:[EMAIL PROTECTED]
> Subject: RE: Is ThreadLocal safe to use in servlets
>
> When might an advanced Tomcat user need to play with this
> Executor element?
To conserve resources when multiple elements are configured.
No point in having a multitude
> From: Martin Gainty [mailto:[EMAIL PROTECTED]
> Subject: Re: Is ThreadLocal safe to use in servlets
>
> Just so I understand..you're advocating ThreadLocal over
> immutable variables or Local variables?
Not at all - just pointing out the ramifications of using ThreadLocal
ne 23, 2007 4:34 PM
Subject: RE: Is ThreadLocal safe to use in servlets
From: lightbulb432 [mailto:[EMAIL PROTECTED]
Subject: Re: Is ThreadLocal safe to use in servlets
A different way of asking this question is where/when
does Tomcat start the Thread that handles a given
request, and what is
Thanks again. This has been a very enlightening thread (no pun intended).
Caldarale, Charles R wrote:
>
> Normally, there's a thread pool per . Tomcat 6 introduces
> the ability to share thread pools across multiple s, via the
> element. (I haven't tried it.)
>
When might an advanced Tomca
> From: lightbulb432 [mailto:[EMAIL PROTECTED]
> Subject: RE: Is ThreadLocal safe to use in servlets
>
> Based on the behavior you specified of ThreadLocals sticking
> around after the webapp is undeployed, is it correct to say
> that the thread pool you mentioned is global t
values in the session listeners that are inserted elsewhere in the same
request that created/invalidated a session, or bound/unbound a session
attribute.
Caldarale, Charles R wrote:
>
>> From: lightbulb432 [mailto:[EMAIL PROTECTED]
>> Subject: Re: Is ThreadLocal safe to use in ser
> From: lightbulb432 [mailto:[EMAIL PROTECTED]
> Subject: Re: Is ThreadLocal safe to use in servlets
>
> A different way of asking this question is where/when
> does Tomcat start the Thread that handles a given
> request, and what is executed in the context of that
>
You mention the use of filters, which leads me to the question of where is it
safe to start using a request-scoped object stored in a ThreadLocal? Would
it be safe to use in a filter, listener, or only once request processing
gets to the servlet?
A different way of asking this question is where/w
> From: lightbulb432 [mailto:[EMAIL PROTECTED]
> Subject: Is ThreadLocal safe to use in servlets
>
> Are ThreadLocal variables safe to use with servlets?
They're great for keeping track of bits and pieces for a given request,
but can lead to GC problems if used for data with a longer lifetime.
K
they are absolutely perfect to reduce parameter pumping through many
layers of code. But you should set and reset them properly, best in a
filter.
regards
Leon
On 6/2/07, lightbulb432 <[EMAIL PROTECTED]> wrote:
Are ThreadLocal variables safe to use with servlets? There are some cases
where it
14 matches
Mail list logo