Java Mailing List Archive

http://www.gg3721.com/

Home » the NHibernate development list »

[NHibernate-development] Thread Locks on ReadOnly Cache

Jesse Napier

2008-01-24

Replies: Find Java Web Hosting

Author LoginPost Reply

I’ve been diving back into the cache sections of NHibernate lately and I started wondering what the value of placing a lock on the Get of a cache item from ReadOnly cache is.  It doesn’t seem to provide any value to me.  It’s not like we perform some additional operation if the value isn’t there.  There’s no lock in NonstrictReadWriteCache or the Hibernate ReadOnlyCache version. 

 

NonStrictReadWrite doesn’t have a lock on the Put either and I’m not totally sure about the value of it on the ReadOnlyCache. MinimalPut is a passed in parameter and it really shouldn’t change throughout the life of the app domain and a get from the cache provider isn’t guaranteed to be thread safe anyways. Just not sure how much we are gaining with the lock.

 

I’d like to remove the locks if we could. Seems like it would help with cache performance in a multithreaded app.

 

Any thoughts?

 

Jesse

 

 

 

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nhibernate-development mailing list
Nhibernate-development@(protected)
https://lists.sourceforge.net/lists/listinfo/nhibernate-development
©2008 gg3721.com - Jax Systems, LLC, U.S.A.