想写篇关于CountDownLatch的文章,看来看去,觉得最好的还是JavaDoc,那就JavaDoc把。 A synchronization aid that allows one or more threads to wait until a set of operations being p ...
分类:
其他好文 时间:
2018-05-16 00:29:02
阅读次数:
188
之前在张神的QQ群里偶尔间聊到了关于这个的问题,我这里写一下我所认知的三次握手&四次挥手,若有错误之处,请路过的大佬们指正。 首先简单的科普一下什么是三次握手,什么是四次挥手。 1、三次握手: C-->S:[SYN] 在么 syn:synchronization(同步) S-->C:[SYN,ACK ...
分类:
其他好文 时间:
2018-04-28 13:59:06
阅读次数:
171
Django 自定义模板标签,使用时报错 is not a registered tag library.
分类:
其他好文 时间:
2018-04-26 12:02:30
阅读次数:
3037
什么Zookeeper Zookeeper是一个分布式开源框架,提供了协调分布式应用的基本服务,它向外部应用暴露一组通用服务——分布式同步(Distributed Synchronization)、命名服务(Naming Service)、集群维护(Group Maintenance)等,简化分布式 ...
分类:
其他好文 时间:
2018-04-26 01:11:40
阅读次数:
171
前言 线程间的通信主要通过共享对字段的访问和对象引用字段的引用,可能会产生两种错误,线程干扰和内存一致性错误。Java的同步就是防止这些错误,但当多个线程访问同一资源会导致线程执行缓慢,甚至暂停执行。 线程干扰(Thread Interference) 例子 class Counter { priv ...
分类:
编程语言 时间:
2018-04-25 00:16:11
阅读次数:
174
linux时间有两个。一个是系统时间,一个是硬件时间! 同步国家时间的时候会出现报错:no server suitable for synchronization found 现在国家授权的 210.72.145.44 暂时不能使用 本文章主要讲ntpdate: 一、安装ntp yum instal ...
分类:
系统相关 时间:
2018-04-24 19:00:09
阅读次数:
218
Zhejiang University has 40000 students and provides 2500 courses. Now given the registered course list of each student, you are supposed to output the ...
分类:
其他好文 时间:
2018-04-22 21:46:49
阅读次数:
164
http://bindog.github.io/blog/2015/03/10/synchronization in multiplayer networked game lockstep/ 游戏的暴击几率是“假”的 ...
分类:
其他好文 时间:
2018-04-22 10:41:59
阅读次数:
141
临界区(Critical Sections) 摘要 临界区(Critical Section) 用来实现“排他性占有”。适合范围时单一进程的各线程之间。 特点 一个局部对象,不是一个核心对象 快速而有效率 不能够同时有一个以上的Critical Section被等待 无法侦测是否已经被某个线程放弃 ...
分类:
编程语言 时间:
2018-04-16 14:38:47
阅读次数:
175
来源:http://www.importnew.com/7010.html HashMap和Hashtable的区别 HashMap和Hashtable都实现了Map接口,但决定用哪一个之前先要弄清楚它们之间的分别。主要的区别有:线程安全性,同步(synchronization),以及速度。 要注意 ...
分类:
其他好文 时间:
2018-04-11 15:46:22
阅读次数:
142