2014年4月15日
摘要: volatile变量直接在CPU和内存之间交换,不通过一级、二级缓存。考虑下面的代码:代码:123456789101112131415161718class Gadget{public:void Wait() {while (!flag_){Sleep(1000); // sleeps for 10... 阅读全文
posted @ 2014-04-15 15:47 上海—Michael 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 本机:win7(x86),4G内存#include"stdafx.h"#include#include#include#includeusing namespace std;HANDLE hHeap;int _tmain(int argc, _TCHAR* argv[]){ SYSTEM_INFO ... 阅读全文
posted @ 2014-04-15 13:23 上海—Michael 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: #include #include #include using namespace std; int main() { SYSTEM_INFO systemInfo; GetSystemInfo(&systemInfo); cout <<setw(20) << "处理器掩... 阅读全文
posted @ 2014-04-15 12:37 上海—Michael 阅读(344) 评论(0) 推荐(0) 编辑