That's a good idea.  My only concern is that Retrotranslator, which we
use to build 1.4 jars, would need to know how to handle it.
Otherwise, it looks like that would be a good replacement for all our
map-based caches.

Don

On 9/21/07, Shepherd, Darren S <[EMAIL PROTECTED]> wrote:
> Don,
>
> Your right about OgnlUtils, that was a dumb mistake overlooking that.  I was 
> actually more concerned about the SpringObjectFactory.  I noticed it wasn't 
> synchronized, but I'm concerned about the performance of making it 
> synchronized.  The ObjectFactory is accessed so frequently that I personally 
> think making it externally synchronized would impose a big performance 
> impact.  Do you agree?
>
> Could I suggest that instead of using a HashMap, we could use a 
> java.util.concurrent.ConcurrentHashMap.  ConcurrentHashMap does not allow 
> nulls though (not sure if that's an issue).
>
> The same argument to use ConcurrentHashMap for SpringObjectFactory I think 
> applies to changing OgnlUtils to use ConcurrentHashMap instead of an 
> externally synchronized HashMap.
>
> Darren
>
> -----Original Message-----
> From: Don Brown [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 20, 2007 9:56 AM
> To: Struts Developers List
> Subject: Re: Multithreaded use of HashMap
>
> OgnlUtil properly protects its caches by surrounding them in
> synchronized blocks, but you are right, the SpringObjectFactory class
> does not.  I fixed it in trunk.
>
> Don
>
> On 9/20/07, Shepherd, Darren S <[EMAIL PROTECTED]> wrote:
> > I noticed two different cases where a HashMap is being used in a 
> > multithreaded read/write manner.  As we all know the java HashMap 
> > implementation does not allow concurrent read/writes that are not 
> > externally synchronized.  Is there some reason I should not be concerned?  
> > The classes are OgnlUtils and SpringObjectFactory.  Both classes are 
> > actually xworks API.  Is xworks a different project?  Should this question 
> > be directed towards a different list?
> >
> >
> >
> > Darren
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to