
Linux开发
Linux开发
wzq2009
这个作者很懒,什么都没留下…
展开
-
LFU 与 LRU
A least frequently used (LFU) policy will replace the line that has been referenced the fewest times over some past time window. A least recently used (LRU) policy will replace the line that was last ...原创 2020-01-28 11:14:47 · 184 阅读 · 0 评论 -
深入理解计算机系统shell lab - 一个简单shell的实现
/* * tsh - A tiny shell program with job control * * <Put your name and login ID here> */#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h&...原创 2019-11-04 15:03:07 · 1369 阅读 · 0 评论 -
CS:APP3e 深入理解计算机系统_3e CacheLab实验
详细的题目要求和实验资源可以到教材官网或者课程官网获取。本次实验难点在Part B的64 * 64部分,主要介绍这一部分。Part A: 编写缓存模拟器前期准备:getopt和fscanf系列库函数对于这次实验很重要,不太明白的可以man一下,或者参考这两篇文章:Linux下getopt()函数的简单使用 C 库函数 - fscanf()注意事项:1.由于...翻译 2019-11-04 14:57:57 · 408 阅读 · 0 评论 -
CS:APP3e 深入理解计算机系统_3e Y86-64模拟器指南
详细的题目要求和资源可以到http://csapp.cs.cmu.edu/3e/labs.html或者http://www.cs.cmu.edu/~./213/schedule.html 获取。虽然我们学校第四章没有要求做实验(Architecture Lab),但课后作业用到了Y86-64的模拟器,也是实验材料的一部分。我在编译模拟器的时候遇到了两个困难,解决后在这分享一下。...转载 2019-08-28 13:23:38 · 233 阅读 · 0 评论 -
深入理解计算机系统(第三版)作业题答案(第二章)
https://www.cnblogs.com/machao/p/8397961.html我发现,当把这些题做完之后对本章知识的理解才算有点小进步。下边的答案主要参考了这两个网站:http://blog.youkuaiyun.com/zhanyu1990/article/details/24936663 https://dreamanddead.gitbooks.io/csapp-3e-solut...原创 2019-07-19 09:45:43 · 3928 阅读 · 2 评论 -
Linux-based Futex Locks
void mutex_lock (int *mutex){ int v; /* Bit 31 was clear, we got the mutex (the fastpath) */ if (atomic_bit_test_set (mutex, 31) == 0) return; atomic_increment (mutex); while (1) { if (atomic_bit_test_set (mutex, 31) == 0) {原创 2020-05-24 10:49:45 · 277 阅读 · 0 评论 -
程序的加载过程——阅读CSAPP第九章虚拟内存总结
启动一个程序即开启一个进程,系统先要加载磁盘文件,系统把磁盘的程序文件按图1(a)的组织形式映射到虚拟内存。虚拟内存的组织形式是由内核的一些特殊结构维护的,如图1(b)所示,linux内核为系统的每一个进程维护着一个单独的task结构。task结构包含或指向所有的内核需要运行一个进程的信息(例如,PID,用户栈指针,可执行目标文件的名字,程序计数器(program counter ))。task结...原创 2019-11-28 14:13:35 · 305 阅读 · 0 评论