dutor.net
并发
http://www.dutor.net/index.php/tag/并发
Posts Tagged ‘并发’. November 4, 2013. 在一个赋值操作, req- r- opacket = resp;. 按照惯例, req, req- r. 或者 req- r- opacket. 在指令 mov %rax, 0x40(%rdx). 只有一种可能 最初从 (%r13 0x20). October 26, 2013. Page 1 of 1. Latest Posts / 最新文章. AT&T 汇编和 GCC 内联汇编简介. C ] 右值引用 移动语义与完美转发. 程序非主流 – 李子博客. 霸爷 – 系统技术研究. 16 queries in 0.045 seconds.
dutor.net
原子,锁,还有内存屏障
http://www.dutor.net/index.php/2013/10/atomic-lock-memory-barrier
在程序设计的内涵下, 原子 性表示一个操作的中间状态对外的不可见性,体现在内存修改的中间状态不可见,体现在 CPU. 考虑下面三种实现,为了 清晰 ,使用 GCC inline assembly. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54. Uint32 t counter =. Define INCR(n) non atomic incr( n). Non atomic incr (. Mov %0, % eax n. Add $1, % eax n. Mov % eax, %0. Ump atomic incr (. Smp atomic incr (. Lock; incl %0 n. Cpu set t cpuset ;. CPU ZERO (. CPU SET (. Bind threads to specific processor.
dutor.net
之语言特性
http://www.dutor.net/index.php/category/program/language
Archive for ‘之语言特性’ Category. November 25, 2013. AT&T 汇编和 GCC 内联汇编简介. 寄存器名以 ‘%’. 立即数以 ‘$’. 指令格式 instrunction src, dest. 分别为指令名,源操作数,目的操作数,例如 mov $0, %rax. 例如 movb $0, (rax). 相对寻址/寄存器寻址/索引寻址均由 seg:off(base, index, scale). 那么, movq 8(rax, rcx, 16). November 24, 2013. 介绍了 C 11 中的右值引用及其应用 移动语义和完美转发。 November 23, 2013. C ] 右值引用 移动语义与完美转发. 引入的新特性中,除了并发内存模型和相关设施,这些高帅富之外,最引人入胜且接地气的特性就要属 右值引用 了 rvalue reference. 中添加一个元素,这个动作需要先后调用 string: string(const char*), string: string(const string&), string: string(). 注 纯虚函...
dutor.net
tcmalloc
http://www.dutor.net/index.php/tag/tcmalloc
Posts Tagged ‘tcmalloc’. October 20, 2013. October 19, 2013. 的最底层,负责向操作系统申请和释放内存,接口有两个,定义在 src/system-alloc.h .cc. TCMalloc SystemAlloc (. Bytes, size t. Actual bytes, size t. TCMalloc SystemRelease (. Start, size t. Page 1 of 1. Latest Posts / 最新文章. AT&T 汇编和 GCC 内联汇编简介. C ] 右值引用 移动语义与完美转发. 程序非主流 – 李子博客. 霸爷 – 系统技术研究. 16 queries in 0.052 seconds.
dutor.net
并发引起的诡异 Bug 一枚
http://www.dutor.net/index.php/2013/11/weird-bug-by-concurrency
Tair 又 core dump 了。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33. Core was generated by `sbin/tair server -f etc/dataserver.conf'. Program terminated with signal. In request processor: process. At request processor.cpp. Req- r- opacket = resp; (. P/a req $ 36. P/a resp $ 37. P/a req- r $ 38. P/a &req- r- opacket $ 39. Dump of assembler code from 0x482292. Load address of resp to rax 0x0000000000482292. Request processor: process (. Mov %rax, 0x40. P/a $rax $ 40.
dutor.net
memory
http://www.dutor.net/index.php/tag/memory
Posts Tagged ‘memory’. October 26, 2013. Page 1 of 1. Latest Posts / 最新文章. AT&T 汇编和 GCC 内联汇编简介. C ] 右值引用 移动语义与完美转发. 程序非主流 – 李子博客. 霸爷 – 系统技术研究. 16 queries in 0.042 seconds.
dutor.net
[TCMalloc] PageHeap 页面管理
http://www.dutor.net/index.php/2013/10/tcmalloc-page-heap-span
1 2 3 4 5 6 7 8 9 10 11 12. PageID start ;. Length length ;. Number of pages in span. Used when in link list. Used when in link list. Linked list of free objects. Number of non-free objects. Size-class for small objects (or 0). Is the span on a freelist, and if so, which? What freelist the span is on: IN USE if on none, or normal or returned. IN USE, ON NORMAL FREELIST, ON RETURNED FREELIST }. 表示正在使用 ON NORMAL FREELIST. 表示用户已经归还 ON RETURNED FREELIST. 和 ON NORMAL FREELIST. 中的 页表 是为了定位某个地址 由地址可直接得到 pageid.
dutor.net
[TCMalloc] 全局内存分配器
http://www.dutor.net/index.php/2013/10/tcmalloc-sys-allocator
的最底层,负责向操作系统申请和释放内存,接口有两个,定义在 src/system-alloc.h .cc. TCMalloc SystemAlloc (. Bytes, size t. Actual bytes, size t. TCMalloc SystemRelease (. Start, size t. Size, size t. Actual size, size t. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41. Size, size t. Actual size, size t. Size, size t. Actual size, size t. Size, size t. Actual size, size t. Sbrk space [. Mmap space [. Default space [. 1 2 3 4 5 6 7 8 9 10 11 12 13. Mmap space ). 程序非主流 &#...
dutor.net
边走编程
http://www.dutor.net/index.php/category/program
Archive for ‘边走编程’ Category. November 25, 2013. AT&T 汇编和 GCC 内联汇编简介. 寄存器名以 ‘%’. 立即数以 ‘$’. 指令格式 instrunction src, dest. 分别为指令名,源操作数,目的操作数,例如 mov $0, %rax. 例如 movb $0, (rax). 相对寻址/寄存器寻址/索引寻址均由 seg:off(base, index, scale). 那么, movq 8(rax, rcx, 16). November 24, 2013. 介绍了 C 11 中的右值引用及其应用 移动语义和完美转发。 November 23, 2013. C ] 右值引用 移动语义与完美转发. 引入的新特性中,除了并发内存模型和相关设施,这些高帅富之外,最引人入胜且接地气的特性就要属 右值引用 了 rvalue reference. 中添加一个元素,这个动作需要先后调用 string: string(const char*), string: string(const string&), string: string(). 如果出现 s...
dutor.net
AT&T 汇编和 GCC 内联汇编简介
http://www.dutor.net/index.php/2013/11/att-syntax-and-gcc-inlined-assembly
AT&T 汇编和 GCC 内联汇编简介. 寄存器名以 ‘%’. 立即数以 ‘$’. 指令格式 instrunction src, dest. 分别为指令名,源操作数,目的操作数,例如 mov $0, %rax. 例如 movb $0, (rax). 相对寻址/寄存器寻址/索引寻址均由 seg:off(base, index, scale). 那么, movq 8(rax, rcx, 16). Rax, eax, ax, ah, al;. Rbx, ebx, bx, bh, bl;. Rcx, ecx, cx, ch, cl;. Rdx, edx, dx, dh, dl;. Rsi, esi, si;. Rdi, edi, di;. Rbp, ebp;. Rsp, esp;. 整型参数 包括整数、指针等 ,由左至右,分别使用 rdi, rsi, rdx, rcx, r8, r9. 一般 为栈帧 stack frame. 实现 TLS Thread Local Storage. Rbx, rbp, rsp, r12-r15. 圆括号内由 ‘:’. 例如 ‘% eax’. S, %rsi, %esi, %si.