2012年12月28日

Windows下C++的同步机制的演变

摘要: Windows with C++ - The Evolution of Synchronization in Windows and C++介绍了如下概念:critical sectionmutexeventslim reader/writer lockcondition variableC++11的mutex和condition_variable 阅读全文

posted @ 2012-12-28 13:51 fresky 阅读(181) 评论(0) 推荐(0) 编辑

什么情况下要替换C++自带的new和delete

摘要: c++ - Why would one replace default new and delete operators? - Stack Overflow用来检测用户错误,比如(1)new的时候可以记录所有new出来的地址,然后用户忘记delete时帮用户delete(2)new出地址时前后放一些记号,防止overrun和underrun用来提高效率用来收集统计数据,比如(1)地址分布,生存期分... 阅读全文

posted @ 2012-12-28 11:26 fresky 阅读(352) 评论(0) 推荐(0) 编辑

怎么回答哪个更快的问题

摘要: Which is faster? | Fabulous Adventures In Coding1. 为什么问?你该自己测试一下2. 真的需要知道吗?等你遇到performance问题时再考虑3. 这真的是瓶颈吗?4. 哪个快哪个慢重要吗?5. 更快是什么意思?启动速度还是运行速度?最坏情况下还是正常情况下?6. 你看到big picture了吗?除了速度还有很多别的东西,比如内存。 阅读全文

posted @ 2012-12-28 10:35 fresky 阅读(120) 评论(0) 推荐(0) 编辑

导航