并行计算
文章平均质量分 79
yxc135
此用户很懒,没有任何简介
展开
-
重要宏收录
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))//volatile确保不被编译器优化省略,且每次必须直接从内存读值#define DEFINE_PER_THREAD(type, name) \ struct { \ __typeof__(type) v \原创 2013-09-09 21:21:42 · 1352 阅读 · 0 评论 -
多线程优化——超线程与多核
超线程是利用原创 2014-06-13 00:01:40 · 2679 阅读 · 0 评论 -
Memory Cache Control 摘录
The store buffer is associated with the processors instruction execution units. Itallows writes to system memory and/or the internal caches to be saved and in somecases combined to optimize the pr转载 2013-09-16 22:35:46 · 1088 阅读 · 0 评论 -
一个关于Memory Reordering的实验
Instruction Reordering有两种,包括Compiler Reordering和Memory Reordering。 Intel官方列出的有关Memory Reordering的情况总共有8种: Neither Loads Nor Stores Are Reordered with Like Operations Stores Are Not Reor原创 2013-09-16 22:08:52 · 1601 阅读 · 0 评论 -
Store-buffer forwarding
Many modern microprocessors implement store buffer forwarding which is a mechanism that improves microprocessor performance by completing a younger dependent load operation by using data from an old转载 2013-09-14 16:57:30 · 1411 阅读 · 0 评论 -
light-weight sync 和 heavy-weight sync
Reprint:http://www.ibm.com/developerworks/systems/articles/powerpc.htmlThe barrier created by the sync instruction is more comprehensive in that it orders all storage accesses regardless of class.转载 2013-09-13 20:02:37 · 1062 阅读 · 0 评论 -
RISC和CICS指令流水线的区别
Reprint:http://www.surf.org.uk/articles/CISC_vs._RISC.htmlRISC architectures lend themselves more towards pipelining than CISC architectures for many reasons. As RISC architectures have a smalle转载 2013-09-13 19:59:59 · 5224 阅读 · 0 评论 -
一个关于Lightweight Mutex 和 Heavyweight Mutex的实验
Reprint:http://preshing.com/20111124/always-use-a-lightweight-mutexIn multithreaded programming, we often speak of locks (also known as mutexes). But a lock is only a concept. To actually use转载 2013-09-13 20:16:04 · 1157 阅读 · 0 评论 -
Acquire and Release Semantics
关于 Acqurie Semantics 和 Release Semantics 的解释,感觉MSDN上的解释最容易理解:(http://msdn.microsoft.com/en-us/library/ff540496.aspx)An operation has acquire semantics if other processors will always see its e转载 2013-09-13 20:11:55 · 2126 阅读 · 0 评论 -
处理器、CPU、核的区别
Reprint:http://www.tomshardware.com/forum/342869-28-difference-processor-coreThe terms 'Processor', 'Core', and 'CPU' are all poorly defined and have undergone many changes in meaning over the y转载 2013-09-05 08:37:19 · 2193 阅读 · 0 评论 -
一个关于Weakly-Ordered CPU的实验
Reprint:http://preshing.com/20121019/this-is-why-they-call-it-a-weakly-ordered-cpuOn this blog, I’ve been rambling on about lock-free programming subjects such as acquire and release semanti转载 2013-09-12 15:35:09 · 1436 阅读 · 0 评论 -
ARM和x86架构的区别与应用
ARM is a RISC (Reduced Instruction Set Computing) architecture while x86 being a CISC (Complex Instruction Set Computing) one.ARM is a RISC (Reduced Instruction Set Computing) archit转载 2013-09-12 14:51:31 · 1437 阅读 · 0 评论 -
C语言内嵌汇编:__asm__ __volatile__
转自unbutun的博客:http://blog.csdn.net/unbutun/article/details/6123472gcc内嵌汇编简介在内嵌汇编中,可以将C语言表达式指定为汇编指令的操作数,而且不用去管如何将C语言表达式的值读入哪个寄存器,以及如何将计算结果写回C 变量,你只要告诉程序中C语言表达式与汇编指令操作数之间的对应关系即可, GCC会自动插入代码完成必要的操转载 2013-09-10 20:22:36 · 6598 阅读 · 0 评论 -
跨平台获取CPU cache line大小的方法
Reprint:http://strupat.ca/2010/10/cross-platform-function-to-get-the-line-size-of-your-cache/ 注意获得的cache line大小单位为字节。#ifndef GET_CACHE_LINE_SIZE_H_INCLUDED#define GET_CACHE_LINE_SIZE_H_INC转载 2013-09-09 21:26:02 · 4189 阅读 · 0 评论 -
多线程优化——Cache Align
有的时候,使用多线程的速度原创 2014-06-12 12:02:11 · 4646 阅读 · 0 评论