2013年10月9日

摘要: 究竟什么是用户态,什么是内核态,这两个基本概念以前一直理解得不是很清楚,根本原因个人觉得是在于因为大部分时候我们在写程序时关注的重点和着眼的角度放在了实现的功能和代码的逻辑性上,先看一个例子:1)例子C代码1.voidtestfork(){2.if(0==fork()){3.printf(“createnewprocesssuccess!\n”);4.}5.printf(“testforkok\n”);6.}这段代码很简单,从功能的角度来看,就是实际执行了一个fork(),生成一个新的进程,从逻辑的角度看,就是判断了如果fork()返回的是则打印相关语句,然后函数最后再打印一句表示执行完整个t 阅读全文
posted @ 2013-10-09 15:59 tripod 阅读(273) 评论(0) 推荐(0)
摘要: The page cachecachespages of files to optimize file I/O. The buffer cache caches disk blocks to optimize block I/O.Prior to Linux kernel version 2.4, the two caches were distinct: Files were in the page cache, disk blocks were in the buffer cache. Given that most files arerepresentedby a filesystem 阅读全文
posted @ 2013-10-09 15:22 tripod 阅读(313) 评论(0) 推荐(0)

导航