- 博客(6)
- 收藏
- 关注
转载 树状结构 Tree data structure in C#
delegate void TreeVisitor<T>(T nodeData);class NTree<T>{ private T data; private LinkedList<NTree<T>> children; public NTree(T data) { ...
2017-12-20 17:24:00 147
转载 wrap ConcurrentDictionary in BlockingCollection
ConcurrentDictionary<int, BlockingCollection<string>> mailBoxes = new ConcurrentDictionary<int, BlockingCollection<string>>(); int maxBoxes = 5; Canc...
2017-12-15 15:39:00 73
转载 ConcurrentBag扩展 批量加入
public static void AddRange<T>(this ConcurrentBag<T> @this, IEnumerable<T> toAdd) { foreach (var element in toAdd) { @this.Add(element); ...
2017-12-15 15:34:00 440
转载 Dictionary GetOrAdd
public static TValue GetOrAdd<TKey,TValue>( this Dictionary<TKey,TValue> dictionary, TKey key, Func<TKey, TValue> valueFactory){ TValue value; if (!dicti...
2017-12-15 15:31:00 151
转载 ConcurrentDictionary AddOrUpdate
var sessionId = a.Session.SessionID.ToString();userDic.AddOrUpdate( authUser.UserId, sessionId, (key, oldValue) => sessionId);static class ExtensionMethods{ // Either Add...
2017-12-15 15:26:00 1286
转载 object pool
/// <summary> /// 对象池 /// </summary> /// <typeparam name="T"></typeparam> public class ObjectPool<T> { private readonly Concurren...
2017-12-15 11:29:00 76
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人