摘要:
ConcurrentDictionary> mailBoxes = new ConcurrentDictionary>(); int maxBoxes = 5; CancellationTokenSource cancelationTokenSource = new CancellationTokenSource(); CancellationT... 阅读全文
posted @ 2017-12-15 15:39
武胜-阿伟
阅读(342)
评论(0)
推荐(0)
摘要:
public static void AddRange(this ConcurrentBag @this, IEnumerable toAdd) { foreach (var element in toAdd) { @this.Add(element); } } 阅读全文
posted @ 2017-12-15 15:34
武胜-阿伟
阅读(891)
评论(1)
推荐(1)
摘要:
public static TValue GetOrAdd( this Dictionary dictionary, TKey key, Func valueFactory) { TValue value; if (!dictionary.TryGetValue(key, out value)) { value = valueFactory(ke... 阅读全文
posted @ 2017-12-15 15:31
武胜-阿伟
阅读(869)
评论(0)
推荐(0)
摘要:
var sessionId = a.Session.SessionID.ToString(); userDic.AddOrUpdate( authUser.UserId, sessionId, (key, oldValue) => sessionId); static class Extension 阅读全文
posted @ 2017-12-15 15:26
武胜-阿伟
阅读(6943)
评论(0)
推荐(0)
摘要:
/// /// 对象池 /// /// public class ObjectPool { private readonly ConcurrentBag _buffer; private readonly Func _createFunc; private readonly Action _reset... 阅读全文
posted @ 2017-12-15 11:29
武胜-阿伟
阅读(211)
评论(0)
推荐(0)
浙公网安备 33010602011771号