At 11:48 AM 10/12/2004, Ryan Heath wrote
>Merrill wrote:
>> This is where the ReaderWriterLock concept is appropriate
>
>Yes, it sure is, but in my case I'd like to extented it a bit, the
>RWlock should not be held on the cache itself but on the item in the
>cache. Let me explain:
>Say the cache holds item A and B, A never expires but B expires every 10s.
>When the RWlock is held on the cache no one can read item A if a
>thread is " writing" item B, since all readers are blocked until there
>is no writer (waiting).
>While when holding the lock on the item itself A can always be read
>regardless the stage of item B. Anyone an idea how to implement this
>(in a .net language) ?
>
>// Ryan

The easiest way would be to put all never-expires items in their own cache that never 
needs to be locked at all.




J. Merrill / Analytical Software Corp

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

Essential .NET: building applications and components with CSharp
August 30 - September 3, in Los Angeles
http://www.develop.com/courses/edotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to