Re: [Opensymphony-oscache] Error in mass concurrence!

Andres March <[email protected]> Fri, 15 Apr 2005 08:23:16 -0700
Newsgroups gmane.comp.java.open-symphony.os-cache
Message-ID <[email protected]>
I'll definitely look at this next.  Thanks for pointing it out.  Good 
luck with the move.

Chris Miller wrote:

>Yes special care is required when handling the NRE and this code ignores that completely. However I think there's more to it than this. I've just taken a very quick look at the changes that were made to make cache.removeEntry() public. It doesn't look like thread-safety has been taken into account! Take a look at line 390 of AbstractConcurrentReadCache - the internal calls that are made to remove() are taking care to synchronize as required. So just making removeEntry() public is definitely going to cause problems.
>
>One thing we *definitely* don't want to do is sync on GeneralCacheAdministrator.getFromCache() - that will both kill performance and cause implementation problems for users. The fix needs to go with removeEntry(). Without looking into this in more detail my first guess is that synchronizing the removeEntry() call might be enough. This hopefully won't affect performance too much since:
>
>a) removeEntry() wasn't exposed previously anyway
>b) internal calls to it are synchronized already
>
>I'm not sure it's ideal though since there will be some double-syncing going on internally. It's not clear to me what this will do to performance.
>
>Andres can you please take a look at your change a little more closely? Give me a buzz if you need a hand and I'll do what I can. I'm moving house tomorrow though so I likely won't be online for a few days!
>
>Cheers,
>Chris
>
>---------------------------------------------------------------------
>Posted via Jive Forums
>http://forums.opensymphony.com/thread.jspa?threadID=1556&messageID=4879#4879
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
>
>  
>