随笔分类 - 算法
算法
摘要:测试:private static void TestIdWorker() { HashSet set = new HashSet(); IdWorker idWorker1 = new IdWorker(0, 0); IdWorker idWorker2 = new IdWorker(1, 0); ...
阅读全文
摘要:/// /// 加权随机负载均衡算法 /// public static class WeightRandom { static Dictionary dic = new Dictionary { { "192.168.1.12", 1}, {"192.168.1.13"...
阅读全文
摘要:/// /// IP Hash负载均衡算法 /// public static class IpHash { static Dictionary dic = new Dictionary { { "192.168.1.12", 1}, {"192.168.1.13", 1 ...
阅读全文
摘要:/// /// 加权轮询算法 /// public static class WeightRoundRobin { private static object obj = new object(); private static int pos = 0; static Dictionary dic = ...
阅读全文
摘要:/// /// 轮询负载均衡算法 /// public static class RoundRobin { private static object obj = new object(); static Dictionary dic = new Dictionary { { "192....
阅读全文

浙公网安备 33010602011771号