commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: Digester and Threads Question
Date Wed, 24 Mar 2004 19:30:26 GMT
No problem!  That will definitely work, but it might be a little better to
use a pool rather than a ThreadLocal.  With a pool, you won't necessarily
have to have a new instance for every thread.  The pool will only create one
if it's absolutely necessary (i.e. the pool is empty when a thread wants to
borrow an object from it).  So, if it's quite uncommon for requests to be
simultaneously using a Digester for this purpose, you might even get by with
only ONE instance.  Plus, a ThreadLocal is associated with a SPECIFIC Thread
object.  So, if your appserver doesn't use a thread pooling mechanism (most
do, however), you really won't be saving yourself anything.  Just some
thoughts. :-)


-----Original Message-----
From: Adrian Perez Jorge [mailto:aperez@ignos.com] 
Sent: Wednesday, March 24, 2004 2:20 PM
To: Jakarta Commons Users List
Subject: Re: Digester and Threads Question


Hey!  That's just what I was looking for! (Well... I didn't search too 
much) Thank you very much James for your answer, thank you very much 
Alan for your question ;)

 This list is just cool .  Cheers,

Adrian.

James Carman wrote:

>Check out the ThreadLocal class for this.  It's part of the core Java
>language and is designed for just this case.
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org






---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message