c++_vscode_头文件问题
from: https://github.com/microsoft/vscode-cpptools/issues/1041
What does gcc tell you the include path should be? Run this command and make sure all of the paths printed out are listed in your c_cpp_properties.json: gcc -v -E -x c++ -
vscode快捷键失效
在编辑时,遇到ctrl + L 失效,下方状态栏显示waiting for new input。修复方式:https://github.com/microsoft/vscode/issues/115296
Run the command Developer: Toggle Keyboard Shortcuts Troubleshooting
This will activate logging of dispatched keyboard shortcuts and will open an output panel with the corresponding log file.
Press exactly the keybinding you desire (cmd+L)
check what VS Code detects and what command is invoked.
English
Is it any wonder: 难怪
asset : a useful or valuable thing, person, or quality.
inbound: 可以简单理解为归国的,返回的(例如飞机等等)
designate
throttle spectator tile portion accustom primitive niche terminology perspective hierarchical radically widget elaborate covert breach strive legitimate modulation congest innocuous Intermediary probe stealthy bloat perspective prevalent mutual leverage slate protagonist spotlight debut episode relay oblivious catty exterior cluster gra ...
汇编语言种类
from: https://en.wikipedia.org/wiki/X86_assembly_language#Examples_2
x86 assembly language has two main syntax branches: Intel syntax and AT&T syntax.[7] Intel syntax is dominant in the DOS and Windows world, and AT&T syntax is dominant in the Unix world, since Unix was created at AT&T Bell Labs.[8]
Many x86 assemblers use Intel syntax, including FASM, MASM, NASM, TASM, and YASM. GAS, which originally used AT&T syntax, has supported both syntaxes since version 2.10 via the .intel ...
long_jump_and_short_jump
The the furthest short jump on x86 is +/-127 bytes away or it is a long jump.
long jump and short jump own different prefixes which are EB for short jump, E9 for long jump
linux内核设计的艺术
linux内核设计的艺术1.1 启动biosCPU启动时,CS = 0xFFFF, IP = 0x0000,初始地址为CS:IP = 0xFFFF0,即bios的起始地址为0xFFFF0。
bios至关重要的作用,建立中断向量表和中断服务程序。
1.2 加载操作系统内核程序并为保护模式做准备 对于 Linux 0.11 操作系统而言 计算机将分三批 逐次加载操作 系统的 内 核代码。第一批 由BIOS 中int 0x19 把第一扇 bootsect 的内容加载到 内存 ; 第二批,第三批bootsect 的指挥, 分别把其后4 个遍和随后240 个区的内容加载至内存。
1.2.1 加载第一部分代码——引导程序(bootsect)将第一扇区的内容装载到内存0x7C00处
1.2.2 加载第二部分代码——setup1. bootsect对内存的规划bootsect对于内存规划如下:
SETUPLEN = 4
BOOTSEG = 0x07c0
INITSEG = 0x9000
SETUPSEG = 0x ...
并发多核_惰性链表与无锁链表
惰性链表惰性链表与无所链表类似,使用marked域用于标识是否仍然在链表中,可以避免很多有问题的情况。(false代表在链表中,反之则不在)。
删除过程包含逻辑删除与物理删除(与无锁链表一致),逻辑删除表示仅将marked修改为true,物理删除表示从链表完全删除。
删除的通用做法,对于pred和cur都要加锁(pred == previous)
无锁链表使用CompareAndSet()方法,实现了add()和remove()方法。看上去很简单,但是印象不深刻….一种非常奇怪的感觉233。
并发多核_11次作业
RequirementsExercise 158:
\1. 掌握并发Chained HashSet实现;
\2. 掌握读写锁(Readers-Writers Lock)使用。
作业提交:
写出代码,并结合代码阐述读写锁的原理及使用。(不需要编程运行)
Answer 1:什么时候会发生resize(): If any bucket’s elements’ amount exceeds the threshold, double the capacity of the chain.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697public class SimpleHashSet{ protected capacity; protected ...
并发多核_并发哈希和固有并行
第十一讲 并发哈希和固有并行一、封闭寻址哈希集封闭寻址算法将冲突元素(哈希值相同的元素)放在相同的桶中。每个桶用无锁链表实现。若桶太满,则需要调整表的大小(扩容)。
哈希表存在扩容问题:
为桶中元素的个数设定上限;
桶阈值:若任意一个桶的大小超过上限,则将哈希表的大小加倍。
全局阈值:若超过上限的桶的数量超过一定比例,则将哈希表的大小加倍。满载率是表中元素的个数与表的大小(即桶的数量与桶的大小的乘积)之比。在 Java 中,满载率(load factor)达到 0.75 时,就需要调整哈希表的大小。
并发多核_共享计数
第十讲 共享计数对于基于锁的并发数据结构实现而言,锁本身即构成顺序瓶颈,导致对临界区的访问只能是顺序的。这类顺序瓶颈是由计算任务决定的,不允许并发或者并行,正如在(第 6 讲)空转锁的并发实现中通过队列机制来达到理想的顺序性能。
为了利用多核性能优势,提出有界池(Pool)概念,含有put, remove方法。
一、软件组合树二、静态一致池和计数器这里不理解,这里的图,自己静态一致。这里需要问一下
三、计数网计数网(Counting Network):任意多个令牌以任意次序从任意输入线进入网络,都将在输出线上输出;且不论令牌在输入线上是如何分布的,在输出线上的分布都是平衡的,且首先在顶线输出。
步进特性例如,一个计数网有四条输入线和四条输出线(自上而下分别称作 1 线、2 线、3 线和 4 线)。若令牌数 n=4k(即令牌数是 4 的倍数,k >= 0),则每条输出线上输出的令牌是一样多的(即每条输出线都输出 k 个令牌)。若 n=4k+1,则 1 线上会多输出一个令牌(即 1 线输出 k+1 个令牌,其余三线各输出 k 个令牌)。若 n= ...












