摘要: 一.技术框架 多线程实现生产者-多消费者模型 二.语言 c++ 三.db服务器架构 技术细节说明 1.智能指针对象的使用 pOrder是个智能指针对象,因为post的function是异步回调的,可能在执行doExecuteCreateOrder的时候pOrder已经析构了,为了保证pOrder的生命周期做成智能指针对象. 2.Va... 阅读全文
posted @ 2018-03-13 23:38 小巍 阅读(122) 评论(0) 推荐(0) 编辑
摘要: http://blog.chinaunix.net/uid-14114479-id-2932024.html 阅读全文
posted @ 2017-06-05 23:58 小巍 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 简介 Aho-Corasick算法简称AC算法,通过将模式串预处理为确定有限状态自动机,扫描文本一遍就能结束。其复杂度为O(n),即与模式串的数量和长度无关。 思想 自动机按照文本字符顺序,接受字符,并发生状态转移。这些状态缓存了“按照字符转移成功(但不是模式串的结尾)”、“按照字符转移成功(是模式 阅读全文
posted @ 2017-06-04 22:59 小巍 阅读(1041) 评论(0) 推荐(0) 编辑
摘要: 原理: 分治->递归->保存中间结果+递推 步骤 1.找子问题 2. 确定状态: 3. 找出状态转移方程: 三种形式 1)记忆递归型优点:只经过有用的状态,没有浪费。递推型会查看一些没用的状态,有浪费缺点:可能会因递归层数太深导致爆栈,函数调用带来额外时间开销。总体来说,比递推型慢。2) “我为人人 阅读全文
posted @ 2017-06-04 12:54 小巍 阅读(97) 评论(0) 推荐(0) 编辑
摘要: gdbserver host:10000 --attach `ps x|grep 4.1.4.1|sed -n '1p'|awk '{print $1}'` tail -F 61_debug201611020000001 3.杀死多个Process Pkill -9 +ProcessName 启动时 阅读全文
posted @ 2017-03-12 11:42 小巍 阅读(116) 评论(0) 推荐(0) 编辑
摘要: ctrl+w ctrl+tneocomplcache 一.模式1.普通模式(命令模式)2.插入模式(i,a,o)3.命令模式(:set number)4.可视乎模式(v)5.替换模式(R) 翻屏ctrl+f ctrl+b 一页 ctrl+d ctrl+u 用CTRL+G看文件名和详细路径 移动光标类 阅读全文
posted @ 2017-03-12 11:40 小巍 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Centos 6.6 1.vi /etc/selinux/configSELINUX=disabledreboot2.service iptables stop 3.smbpasswd -a leave 4.vi /etc/samba/smb.conf [public]security = shar 阅读全文
posted @ 2017-03-12 11:38 小巍 阅读(76) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdlib.h>#include <stdio.h> typedef struct buf{ char* datas[5]; int n;}buf_t; buf_t buffer; void* thr_func(void* arg){ in 阅读全文
posted @ 2016-12-04 23:09 小巍 阅读(87) 评论(0) 推荐(0) 编辑