Lazily populates and caches values associated with a particular key.

Namespace:  Gallio.Common.Collections
Assembly:  Gallio (in Gallio.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public class LazyCache<TKey, TValue>
Visual Basic (Declaration)
Public Class LazyCache(Of TKey, TValue)

Type Parameters

TKey
TValue

Remarks

Instances of this type are safe for use by multiple concurrent threads. In the case of a race occurs between two threads that result in the population of the same key, the populator function may be called concurrently with two requests for the same key. The winner of the race gets to store its value in the cache for later use. However, the loser of the race will discard its value and use the newly cached instead.

Inheritance Hierarchy

System..::.Object
  Gallio.Common.Collections..::.LazyCache<(Of <(TKey, TValue>)>)

See Also