03 2012 档案

摘要:struct NoCaseCompare : public std::binary_function<std::string, std::string, bool>{ static bool cmp(char c1, char c2) { return toupper(c1) < toupper(c2); } bool operator()(const std::string& s1, const std::string& s2) const { return lexicographical_compare(s1.beg... 阅读全文
posted @ 2012-03-09 23:29 chengfei164 阅读(177) 评论(0) 推荐(0)
摘要:IntroductionC++ is a strongly typed compiler language. Though not as strongly typed as ADA, a C++ compiler will complain if you try to assign an object of one type to an object of another type (if there is no acceptable conversion). Obviously, this requires that the compiler knows all available type 阅读全文
posted @ 2012-03-05 12:53 chengfei164 阅读(230) 评论(0) 推荐(0)
摘要:socket API:工作在不同层面上的socket实际上,Linux内核只提供了一个与套接字相关的系统调用,即sys_socketcall,应用程序的所有套接字调用都会映射到这个系统调用上Linux网络核心数据结构是套接字缓存(socket buffer),简称skb。它代表一个要发送或处理的报文,并贯穿于整个协议栈。1、 套接字缓存skb由两部分组成:(1) 报文数据:它保存了实际在网络中传输的数据;(2) 管理数据:供内核处理报文的额外数据,这些数据构成了协议之间交换的控制信息。当应用程序向一个socket传输数据之后,该socket将创建相应的套接字缓存,并将用户数据拷贝到缓存中。当报 阅读全文
posted @ 2012-03-02 17:53 chengfei164 阅读(534) 评论(0) 推荐(0)
摘要:原文: http://blog.sina.com.cn/s/blog_70c9335b010125l7.htmlA quick briefing about myself - I joined Facebook in early 2007 and have been through many challenging projects. A lot of problems were new and unseen. A lot were above the scale history has ever seen. A lot of hard times but also great times. 阅读全文
posted @ 2012-03-02 12:12 chengfei164 阅读(122) 评论(0) 推荐(1)
摘要:原文链接:http://bbs.chinaunix.net/thread-2055231-1-1.html1. 内核初始化: *内核建立好内核页目录页表数据库,假设物理内存大小为len,则建立了[3G--3G+len]::[0--len]这样的虚地址vaddr和物理地址paddr的线性对应关系; *内核建立一个page数组,page数组和物理页面系列完全是线性对应,page用来管理该物理页面状态,每个物理页面的虚地址保存在page->virtual中; *内核建立好一个free_list,将没有使用的物理页面对应的page放入其中,已经使用的就不用放入了;线性映射简化了内核中虚拟地址和物 阅读全文
posted @ 2012-03-02 09:48 chengfei164 阅读(367) 评论(0) 推荐(1)