自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 资源 (10)
  • 收藏
  • 关注

原创 singleton-TrashClean

单例模式,c++11 call_once线程安全;静态变量析构释放单例。

2022-10-02 17:03:54 130 1

原创 Circular Buffer 2

循环队列,队列满时覆盖旧数据,非线程安全,位操作代替取模

2022-10-02 16:56:53 134

转载 开发工具红黑榜

开发工具

2022-08-18 11:48:26 85

翻译 无锁循环队列--只适合一读一写两个线程

template<int buflen, typename T> class TLocklessQueue{protected: T BufData[buflen]; int PutIdx; int GetIdx;public: int MaxSize() { return buflen; } int Len() {

2021-11-30 14:20:29 353

原创 星星之火可以燎原

vi ingnore case search \cfind * == find ./ -name ‘*’ ; find * | xargs grep “xxx”CXX_FLAGS=-DNDEBUG in makefile make assert invalid

2021-08-08 18:10:56 58

原创 linux command name

linux command namevi ingnore case search \cdd – data description/disk dump-- convert data filebc – basic/better calculatornm – namesnl – number of linesod – octal dumptr – translateudev – userspace devulimit – user’s limitumask – user’s maskxar

2021-08-08 08:47:34 80

转载 Go & Nginx & skynet 定时器

Nginx定时器skynet定时器

2021-05-23 14:30:33 112

翻译 2.6内核kfifo

2.6内核kfifokfifo.h```c#include <linux/kernel.h>#include <linux/spinlock.h>#include <linux/stddef.h>#include <linux/scatterlist.h>struct __kfifo { unsigned int in; unsigned int out; unsigned int mask; unsigned int esize;

2021-05-22 20:51:46 234

原创 circular buffer

#ifndef _CIRCULAR_BUFFER_H_2021_03_12#define _CIRCULAR_BUFFER_H_2021_03_12#include #include inline bool is_power_of_2(unsigned int v){return v && (!(v & (v - 1)));}inline unsigned int roundup_pow_of_2(unsigned int v){if (v == 0)retur

2021-04-14 22:14:55 153

转载 无锁文章搜集

无锁同步-C++11之Atomic和CAS;如何理解C ++ 11中的std :: atomic :: compare_exchange_weak无锁队列的实现

2021-03-23 09:43:35 56

转载 Scott Meyers:C++史上最重要的五本书籍和五篇技术文章

Scott Meyers:C++史上最重要的五本书籍和五篇技术文章,csdn,lxwde转载链接:https://blog.csdn.net/njnu_mjn/article/details/38175257

2021-03-22 10:31:28 259

转载 经典永流传2-Lock-Free Code: A False Sense of Security

链接:Lock-Free Code: A False Sense of SecurityTo avoid a race, a lock-free variable must have two key properties that we need to watch for and guarantee: atomicity and orderingcompilers, processors, and caches love to optimize reads and writes, and wi

2021-03-22 10:12:37 120

转载 经典永流传-Exception Handling: A False Sense of Security

Exception Handling: A False Sense of SecurityArgument expressions are fully evaluated before their function is called.v[top–],top在调用拷贝构造返回语句之前已经递减。代码: template T Stack::pop(){ if( top < 0 ) throw ""pop on empty stack""; return v[top--]; /

2021-03-22 09:57:47 209

原创 Performance example source code from Inside the c++ object model(2)

编译环境:gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)例子按4.4节所写:"指向 Member Function之指针"的效率(Pointer-to-Member Efficiency),未包括多继承和虚拟继承float g_cx = 0.f, g_cy = 0.f, g_cz = 0.f;class pt3d{public: float x; float y; float z;public: pt3d(float xx = 0.0,

2021-03-20 13:11:15 71

原创 Performance example source code from Inside the c++ object model

编译环境:gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)例子摘抄自3.5节:对象成员的效率(object member efficiency)constexpr int ITERATION_COUNT = 10000001;void test_plain_double(){ START_TIMING(0); float pA_x = 1.725, pA_y = 0.875, pA_z = 0.478; float pB_x = 0.315, pB

2021-03-18 16:25:42 105

翻译 A predicate for stl algorithm should always be stateless

A predicate for stl algorithm should always be statelessvoid test_remove_if_bug(){ list<int> coll = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; PRINT_ELEMENTS(coll, "coll: "); // remove third element list<int>::iterator pos; int n = 3; int

2021-03-06 13:31:23 86

翻译 Dimensional Analysis in C++ by Template

template <int m, // exponent for mass int d, // exponent for distance int t> // exponent for timeclass Units{public: explicit Units(double initVal = 0) : val(initVal) {} double value() const { return val; } double &value() { return

2021-03-04 15:21:56 100 1

翻译 Instruction_level_parallelism

Instruction_level_parallelismvoid Instruction_level_parallelism(){ unsigned int steps = 1 * 1024 * 1024 * 1024u - 1; cout << steps << endl; int *a = new int[2]; time_t begin = time(nullptr); // Loop 1 for (unsigned int i = 0; i < ste

2021-03-04 14:18:56 176 1

python cookbook

python实用大全英文版第三版。python编程的经典。

2014-03-14

PLSQL中文教程

PLSQL开发者教程。中文版,详细,案头参考。

2014-03-02

dbx调试教程,英文版

dbx 调试手册,比较全面. dbx is an interactive, source-level, command-line debugging tool. Debugging a Program With dbx is intended for programmers with a working knowledge of Fortran, C, or C++, and some understanding of the Solaris ™ operating environment and UNIX ® commands, who want to debug an application usingdbx commands. It includes references to how the same debugging operations can be performed using the Sun WorkShop Debugging window.

2014-03-02

(中英文)-POSIX多线程程序设计-Programming with POSIX Threads

David Butenhof大师作品。Unix/Linux下,依据Posix标准进行多线程程序开发的经典教程。中英文俱在。

2012-10-05

design pattern Gof

经典设计模式书籍,英文版, The first part (Chapters 1 and 2) describes what design patterns are and how they help you design object-oriented software. It includes a design case study that demonstrates how design patterns apply in practice. The second part of the book (Chapters 3, 4, and 5) is a catalog of the actual design patterns.

2012-01-13

Beyond the C++ Standard Library: An Introduction to Boost

Boost带领你远远地超越了C++标准库,它使得C++编程更优雅、更有活力、更高产。首先,我们系统地介绍一下Boost库的主要组成和它们的主要用法。 Björn Karlsson为中级至高级的C++开发者描述了所有58个Boost库的轮廓,并完整叙述了12个可能最有用的库。Karlsson的主题范围从智能指针和类型转换,到容器和数据库结构,解释了如何正确地使用每一个库来改进你的代码。他详细论述了可以让你写出更简明、清晰、易读的代码的高级函数对象。他还带你到Boost的"幕后",看看那些对你创建自己的泛型库有益的工具和技术

2012-01-13

24 hours Qt

不可多得的Qt入门教程,上手很快.全书循序渐进,涵盖Qt基础知识。

2012-01-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除