摘要: Bufferevents Every bufferevent has an input buffer and an output buffer. These are of type "struct evbuffer". When you have data to write ona bufferev 阅读全文
posted @ 2018-08-07 20:13 wanfeng_42 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 并发线程最大个数的受两个因素影响:栈的大小和用户空间大小 32位系统中,用户空间地址范围为0x00000000 ~ 0xC0000000 大小为3GB 64位系统中,用户空间地址范围为0x00000000 00000000 ~ 0x00007FFF FFFFFFFF 大小为128TB 栈的大小可以通 阅读全文
posted @ 2018-07-30 15:49 wanfeng_42 阅读(486) 评论(0) 推荐(0) 编辑
摘要: What the lowest level of the Libevent API does: Provides a consistent interface to various select() replacements, using the most efficient version ava 阅读全文
posted @ 2018-07-27 20:42 wanfeng_42 阅读(2290) 评论(0) 推荐(0) 编辑
摘要: 使用gdb之前,首先要通过gcc的-g选项生成调试信息$ gcc -g -Wall 源文件 启动:$ gdb 可执行文件 设置断点:break 断点break可简写为b,断点可通过函数名、文件内的行号等来设置,如果不指定断点位置,就在下一行设置断点。设好的断点可以通过 info break来确认 条 阅读全文
posted @ 2018-07-13 16:08 wanfeng_42 阅读(348) 评论(0) 推荐(0) 编辑
摘要: 第1章 初识Linux shell内存存储单元按组划分成很多块,这些块称作页面(page).内核创建了第一个进程(称为init进程)来启动系统上所有其他进程.Linux系统将硬件设备当成特殊的文件,称为设备文件. 第3章 基本的bash shell命令/etc/passwd文件包含了所有系统用户账户 阅读全文
posted @ 2018-07-12 17:04 wanfeng_42 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Makefile 的规则target ... : prerequisites ...command target 也就是一个目标文件,可以是 Object File,也可以是执行文件。还可以是一个标签。 prerequisites 就是要生成那个 target 所需要的文件或是目标 。 comman 阅读全文
posted @ 2018-07-12 16:37 wanfeng_42 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 昨天做了网易的实习生笔试(一首凉凉送给自己),其中有道问答题是这样的 指出基类构造函数、派生类构造函数,派生类成员变量构造函数的调用顺序,并出他们的析构函数调用顺序。 代码运行结果如下: 首先是类A的实例a,输出第一行的“A”;因为B是A的派生类,B在实例化时会先调用A的构造函数,然后调用自己的构造 阅读全文
posted @ 2018-03-29 19:58 wanfeng_42 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 按照ISO C的规定,一个进程可以登记32个终止处理程序(exit handler),这些终止处理程序(即函数)将由exit自动调用,在exit自动调用之前,需要使用atexit函数登记这些函数。 以下是各实现提供的终止处理程序个数限制: atexit函数原型: 其中atexit的参数是一个函数地址 阅读全文
posted @ 2018-03-20 18:06 wanfeng_42 阅读(141) 评论(0) 推荐(0) 编辑
摘要: leetcode的第一题,很简单。 题目如下 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that e 阅读全文
posted @ 2018-03-15 18:40 wanfeng_42 阅读(154) 评论(0) 推荐(0) 编辑