- 博客(6)
- 问答 (3)
- 收藏
- 关注
原创 哲学家就餐问题解决方案(java)
public class Solution implements Runnable { Semaphore first=new Semaphore(3); Semaphore second=new Semaphore(2); boolean[] chopsticks =new boolean[5]; @Override public void run() { int id=((int)Thread.currentThread().getId())%5; try { getchopst
2021-06-11 15:18:02 93 1
原创 Definition of Interrupt
External interrupts are raised from outside the CPU.Many I/O devices raiseinterrupts (e.g., keyboard, timer, disk drives, CD-ROM and sound cards). Internal interrupts are raised from within the CPU, either from an error or the interrupt instruction. Er.
2021-06-04 17:34:15 94
原创 makefile的:=
=和:=:=只能引用前文已经定义的变量one:=$(two)two=twoall: echo $(one)#不输出two:=右边可以引用自身再追加one=oneone:=$(one) appendall: @echo $(one)#输出one append
2021-05-26 20:13:37 57
原创 TCP三次握手的个人理解
TCP三次握手过程1.A端发送hello报文。2.B端收到hello报文。A、B目前对彼此能力的了解情况3.B端发送ack报文。4.A端收到ack报文。A、B此时已知的情况5.A端发送ack报文。6.B端收到ack报文。第三次握手可以携带数据了。...
2021-03-22 19:35:34 89
原创 HashMap.putVal方法解析
HashMap.putVal方法解析final V putVal(int hash, K key, V value, boolean onlyIfAbsent, boolean evict) { Node<K, V>[] tab; Node<K, V> p; int n, i; //初始化hashmap if ((tab = table) == null || (n = tab.length) == 0) n = (tab = resize()).le
2021-03-02 12:51:32 117
原创 红黑树删除操作规则
//x=替代节点的替代节点,w=x节点的兄弟节点case 0.0.1 x节点为红色,则将x变黑。case 1. x节点为黑色w节点为红色; 1.1 将w变黑; 1.2 x.p变红; 1.4 如果x是左节点左旋,如果x是右节点右旋; 1.5 改变w节点,如果x是左节点,将w=x.p.right;如果x是右节点w=x.p.left; 1.6 最后根据x和w的情况进行平衡。case 2. 节点x为黑色且兄弟节点w和兄弟节点的子节点都为黑色...
2021-02-04 11:21:14 114
空空如也
这段在linux内核的汇编代码是什么意思?
2021-05-19
Ubuntu搭建openjdk错误
2021-04-03
Hanoi问题,我已经知道要怎么叠,但是不知道在C++结果中的步骤如何得来的。
2019-08-05
TA创建的收藏夹 TA关注的收藏夹
TA关注的人