LockFreeCacheOptionsMergeInterval Property

Gets or sets a time period, which may trigger a merge operation into the faster read-only storage even when no new elements are added. If , then time-based merging is disabled.
Default value: .

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public TimeSpan? MergeInterval { get; set; }

Property Value

NullableTimeSpan

Remarks

Even if this property is set, capacity-based merging works as described in the Remarks section of the ThresholdCapacity property.

Even if this property is set, no extra resources (such as timer) are used. No merging occurs if elements are retrieved from the faster read-only cache. A time-based merging may occur only if the dynamically growing storage is accessed.

Once the stored number of elements reaches ThresholdCapacity the value of this property is ignored.

Depending on the targeted platform it is possible that no time-based merging occurs more often than 15 milliseconds.

  Tip

Set this property when it is likely that the number of stored elements will not reach the specified capacities (maybe even InitialCapacity) and you still want to make sure that the stored elements are merged into the faster read-only storage even if no newer elements are added.

See Also